사생활 보호 설정
https://gamjia.tistory.com
Updated News
Mini Rooms
답글수 [0]
What Friends Say
한마디로 표현해봐~
1촌평 관리
77884번 약수의 개수와 덧셈
GamJia 2023. 3. 28. 18:29
코딩테스트 연습 - Level 1 - 약수의 개수와 덧셈
https://programmers.co.kr/learn/courses/30/lessons/77884
#include <string> #include <vector> using namespace std; int solution(int left, int right) { int answer = 0; for(int i=left;i<=right;i++) { int count=0; for(int j=1;j<=i;j++) { if(i%j==0) { count++; } } if(count%2==0) { answer+=i; } else { answer-=i; } } return answer; }