Submission #1006453

#TimeUsernameProblemLanguageResultExecution timeMemory
1006453christinelynnGame (IOI14_game)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define int long long #define pb push_back #define repp(i,x,n) for(int i=x;i<=n;i++) #define repo(i,x,n) for(int i=x;i>=n;i--) #define cy cout<<"Yes"<<endl #define cn cout<<"No"<<endl #define r0 return 0 #define fi first #define se second #define liow ios_base::sync_with_stdio(false);cin.tie(NULL) #define jelek cout<<"jelek"<<endl #define pii pair<int,int> #define all(v) v.begin(),v.end() #define pi pair<pair<int,int>,pair<int,int>> #define p4 pair<pii,pii> #define fl fflush(stdout) using namespace std; const int mod=1e9+7,maxn=1e6+5,N=(1<<17),INF=1e18; int freq[1505]; int N; void initialize(int n){ N=n; } bool hasEdge(int u,int v){ freq(max(u,v))++; return freq[max(u,v)]=max(u,v); } //signed main() { // liow; // int t=1; //// cin>>t; // while(t--){ // solve(); // } //}

Compilation message (stderr)

game.cpp:22:5: error: conflicting declaration 'long long int N'
   22 | int N;
      |     ^
game.cpp:19:32: note: previous declaration as 'const long long int N'
   19 | const int mod=1e9+7,maxn=1e6+5,N=(1<<17),INF=1e18;
      |                                ^
game.cpp: In function 'void initialize(long long int)':
game.cpp:24:4: error: assignment of read-only variable 'N'
   24 |   N=n;
      |   ~^~
game.cpp: In function 'bool hasEdge(long long int, long long int)':
game.cpp:28:16: error: 'freq' cannot be used as a function
   28 |   freq(max(u,v))++;
      |                ^
game.cpp:29:24: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   29 |   return freq[max(u,v)]=max(u,v);
      |          ~~~~~~~~~~~~~~^~~~~~~~~