Submission #332922

#TimeUsernameProblemLanguageResultExecution timeMemory
332922YJUAmusement Park (JOI17_amusement_park)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "Joi.h" #pragma GCC optimize("unroll-loops,no-stack-protector") using namespace std; typedef int ll; typedef long double ld; typedef pair<ll,ll> pll; const ll MOD=1e9+7; const ll MOD2=998244353; const ll N=4e5+5; const ll K=350; const ld pi=acos(-1); const ll INF=(1LL<<60); #define SQ(i) ((i)*(i)) #define REP(i,n) for(ll i=0;i<n;i++) #define REP1(i,n) for(ll i=1;i<=n;i++) #define pb push_back #define mp make_pair #define X first #define Y second #define setp setprecision #define lwb lower_bound #define SZ(_a) (ll)_a.size() ll d[N],col[N],ti,tag[N]; vector<ll> lis,v[N]; ll f(ll id){return (id==d[id]?id:d[id]=f(d[id]));} void DFS(ll nd,ll pa){ tag[nd]=ti++;lis.pb(nd); for(auto i:v[nd]){ if(i==pa)continue; DFS(i,nd); } lis.pb(nd); } void Joi(ll n,ll m,vector<ll> A,vector<ll> B,ll x,ll T){ REP(i,n)d[i]=i; REP(i,m)if(f(A[i])==f(B[i]))continue;else v[A[i]].pb(B[i]),v[B[i]].pb(A[i]),d[f(A[i])]=f(B[i]); REP(i,n)sort(v[i].begin(),v[i].end()); DFS(0,-1); REP(i,n)MessageBoard(i,col[i]=(x>>(tag[i]%60))&1); }
#include<bits/stdc++.h> #include"Ioi.h" #pragma GCC optimize("unroll-loops,no-stack-protector") using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll,ll> pll; const ll MOD=1e9+7; const ll MOD2=998244353; const ll N=4e5+5; const ll K=350; const ld pi=acos(-1); const ll INF=(1LL<<60); #define SQ(i) ((i)*(i)) #define REP(i,n) for(ll i=0;i<n;i++) #define REP1(i,n) for(ll i=1;i<=n;i++) #define pb push_back #define mp make_pair #define X first #define Y second #define setp setprecision #define lwb lower_bound #define SZ(_a) (ll)_a.size() ll d[N],col[N],ti,ans[N],tag[N]; vector<ll> lis,res,v[N]; ll f(ll id){return (id==d[id]?id:d[id]=f(d[id]));} void DFS(ll nd,ll pa){ tag[nd]=ti++;lis.pb(nd); for(auto i:v[nd]){ if(i==pa)continue; DFS(i,nd); } lis.pb(nd); } long long Ioi(ll n,ll m,vector<ll> A,vector<ll> B,ll P,ll V,ll T){ REP(i,n)d[i]=i; REP(i,m)if(f(A[i])==f(B[i]))continue;else v[A[i]].pb(B[i]),v[B[i]].pb(A[i]),d[f(A[i])]=f(B[i]); REP(i,n)sort(v[i].begin(),v[i].end()); DFS(0,-1); ans[P]=V;res.pb(P); lis.resize(unique(lis.begin(),lis.end())-lis.begin()); if(tag[P]+1>=60){ for(int i=tag[P]-1;i>=0;i--){ ans[lis[i]]=move(i); res.pb(lis[i]); } }else{ for(int i=tag[P]+1;i<SZ(lis);i++){ ans[lis[i]]=move(i); res.pb(lis[i]); } } ll x=0; for(auto i:res){ if(ans[i])x|=(1LL<<(tag[i]%60)); } return x; }

Compilation message (stderr)

Joi.cpp:13:18: warning: overflow in conversion from 'long long int' to 'll' {aka 'int'} changes value from '1152921504606846976' to '0' [-Woverflow]
   13 | const ll INF=(1LL<<60);
      |              ~~~~^~~~~
/tmp/ccwcxcPa.o: In function `main':
grader_joi.cpp:(.text.startup+0x1b2): undefined reference to `Joi(int, int, int*, int*, long long, int)'
collect2: error: ld returned 1 exit status

/tmp/cc77X4mC.o: In function `main':
grader_ioi.cpp:(.text.startup+0x3ee): undefined reference to `Ioi(int, int, int*, int*, int, int, int)'
collect2: error: ld returned 1 exit status