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 <cstdio>
#include <memory.h>
using namespace std;
int main()
{
int past;
bool aa[1000][1000];
memset(aa,false,sizeof(aa));
int n;
scanf("%d",&n);
int now,cnt = 0;;
past = 0;
for(int i = 1; i <= n*n; i++)
{
now = (past + i) % n;
if(!aa[past][now] && past != now)
{
aa[past][now] = aa[now][past] = true;
cnt++;
}
past = now;
}
printf("%d\n",cnt);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |