This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#include<memory.h>
int vis[1001][1001];
int main()
{
long long int N;
scanf("%lld", &N);
/*for(N = 1; N <= 1000; N += 2){
int cur = 0, old;
int c = 0;
memset(vis, 0, sizeof(vis));
for(int j = N*N, k = 1;j>0;j--, k++)
{
old = cur;
cur = cur + k;
if(cur >= N) cur %= N;
//printf("%d\n", cur);
if(old!=cur && vis[old][cur] == 0) {
c++;
vis[old][cur] = 1;
vis[cur][old] = 1;
}
}
if(c != N-1){
printf("%d %d\n", N, c);
}
}*/
if(N % 2 == 0) printf("%lld\n", N-1);
else printf("%lld\n", N/2);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |