이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |