이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/* 문제
*/
// 2014.
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <functional>
#include <cstring>
#include <string>
#include <map>
using namespace std;
long long Q[2000000];
map <long long, int> M;
int main()
{
long long n;
scanf("%lld", &n);
Q[0] = 0;
for (int i = 1; i < 2000000; i++)
{
Q[i] = (Q[i - 1] + (long long)i)%n;
M[Q[i]]++;
}
int ans = 0;
for (map<long long , int> :: iterator it = M.begin(); it != M.end(); it++)
{
ans++;
}
printf("%d\n", ans - 1);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |