Submission #9240

#TimeUsernameProblemLanguageResultExecution timeMemory
9240altertainWiring (kriii2_W)C++98
4 / 4
0 ms1672 KiB
#include <vector> #include <map> #include <set> #include <stack> #include <algorithm> #include <sstream> #include <iostream> #include <cstdio> #include <cmath> #include <string> #include <cctype> #include <cstring> #include <queue> #include <cassert> using namespace std; typedef long long LL; typedef vector<string> VS; typedef vector<int> VI; typedef pair<int,int> PII; typedef vector<PII> VPII; #define MP make_pair #define ST first #define ND second #define PB push_back #define FOR(i,a,b) for( int i=(a); i<(b); ++i) #define FORD(i,a,b) for( int i=(a); i>(b); --i) #define REP(i,n) for(int i=0; i<(n); ++i) #define ALL(X) (X).begin(),(X).end() #define SZ(X) (int)(X).size() #define FORE(it,X) for(__typeof((X).begin()) it=(X).begin(); it!=(X).end();++it) int main() { LL n; cin>>n; if (n % 2) cout<<n/2<<endl; else cout<<n-1<<endl; /* FOR(n, 3, 20) { int p[21][21]={0,}; REP(i,n*n) { int a,b; a = i*(i+1)/2 % n; b = (i+1)*(i+2)/2 % n; p[a][b]=p[b][a]=1; } int s= 0; REP(i,n) FOR(j,i+1,n) s+=p[i][j]; cout<<n<<": "<<s<<endl; } */ return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...