Submission #933982

#TimeUsernameProblemLanguageResultExecution timeMemory
933982Saul0906City (JOI17_city)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define rep(a,b,c) for(int a=b; a<c; a++) #define repa(a,b) for(auto a:b) #define ll long long #define pb push_back using namespace std; const int lim=3e5+5; ll tim=0, tin[lim], tout[lim]; vector<int> ady[lim]; void dfs(int u, int p){ tin[u]=tim++; repa(v,ady[u]){ if(v!=p) dfs(v,u); } tout[u]=tim++; } void Encode(int N, int *A, int *B){ rep(i,0,N-1){ ady[A[i]].pb(B[i]); ady[B[i]].pb(A[i]); } dfs(1,0); rep(i,1,N+1){ ll x=1e6+tin[i]; x*=1e6+tout[i]; Code(i,x); } }
#include <bits/stdc++.h> #define rep(a,b,c) for(int a=b; a<c; a++) #define repa(a,b) for(auto a:b) #define ll long long using namespace std; void InitDevice(){ return; } const ll md=1e6; int Answer(ll S, ll T){ ll a, b, c, d; b=(S%md); b=(S/=md); a=(S%md); d=(T%md); d=(T/=md); d=(T%md); if(a<=c && d<=b) return 1; if(c<=a && b<=d) return 0; return 2; }

Compilation message (stderr)

Encoder.cpp: In function 'void Encode(int, int*, int*)':
Encoder.cpp:29:3: error: 'Code' was not declared in this scope
   29 |   Code(i,x);
      |   ^~~~

Device.cpp: In function 'int Answer(long long int, long long int)':
Device.cpp:22:6: warning: 'c' is used uninitialized in this function [-Wuninitialized]
   22 |  if(a<=c && d<=b) return 1;
      |     ~^~~