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<cassert>
#include<cstring>
#include<map>
#include<set>
#include<time.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<utility>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<limits>
using namespace std;
long long gcd( long long b, long long s ){
return (s!=0) ? gcd( s, b%s ) : b;
}
bool v[1005][1005];
int back ( int n ){
memset( v, 0, sizeof( v ) );
int p = 0;
for(int i=1; i<=n*n; i++){
v[(p+i)%n][p] = 1;
v[p][(p+i)%n] = 1;
p = (p+i)%n;
}
int c = 0;
for(int i=0; i<n; i++)
for(int j=i+1; j<n; j++)
if( v[i][j] )
++c;
return c;
}
int main(){
//freopen("in.txt", "r", stdin);
//freopen("input.txt", "r", stdin);
long long n, ans;
scanf("%lld", &n);
if( n & 1 )
ans = n/2;
else
ans = n-1;
printf("%lld\n", ans);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |