Submission #9238

#TimeUsernameProblemLanguageResultExecution timeMemory
9238maniacWiring (kriii2_W)C++98
4 / 4
0 ms2664 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...