제출 #731345

#제출 시각아이디문제언어결과실행 시간메모리
731345Rafi22Amusement Park (JOI17_amusement_park)C++14
0 / 100
656 ms202968 KiB
#include <bits/stdc++.h> #include "Joi.h" using namespace std; #define endl '\n' #define st first #define nd second #define pb push_back #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() #define ll long long static ll mod=1000000007; static int inf=1000000007; static ll infl=1000000000000000007; static const int N=10007; static bool odw[N]; static vector<int>G[N],G1[N]; static vector<int>X[N]; static int id[N]; static vector<int>V; static void dfs(int v) { if(sz(V)<60) { id[v]=sz(V); V.pb(v); } odw[v]=1; for(auto u:G[v]) { if(!odw[u]) { G1[u].pb(v); G1[v].pb(u); dfs(u); } } } static bool is[N]; static void dfs1(int v,int o) { for(auto u:G1[v]) { if(u==o) continue; if(sz(X[u])==0) { int l=-1; for(auto i:X[v]) is[i]=1; for(auto i:X[v]) { int c=0; for(auto j:G1[i]) c+=is[j];if(c==1&&i!=o) l=i; } id[u]=id[l]; for(auto i:X[v]) { is[i]=0; if(i!=l) X[u].pb(i); } X[u].pb(u); } dfs1(u,v); } } void Joi(int n, int m, int A[], int B[], ll x, int tt) { for(int i=0;i<m;i++) { G[A[i]].pb(B[i]); G[B[i]].pb(A[i]); } dfs(0); for(auto x:V) X[x]=V; dfs1(0,-1); for(int i=0;i<n;i++) MessageBoard(i,((1LL<<id[i])&x)>0); }
#include <bits/stdc++.h> #include "Ioi.h" using namespace std; #define endl '\n' #define st first #define nd second #define pb push_back #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() #define ll long long static ll mod=1000000007; static int inf=1000000007; static ll infl=1000000000000000007; const static int N=10007; static bool odw[N]; static vector<int>G[N],G1[N]; static vector<int>X[N]; static int id[N]; static vector<int>V; static void dfs(int v) { if(sz(V)<60) { id[v]=sz(V); V.pb(v); } odw[v]=1; for(auto u:G[v]) { if(!odw[u]) { G1[u].pb(v); G1[v].pb(u); dfs(u); } } } static bool is[N]; static void dfs1(int v,int o) { for(auto u:G1[v]) { if(u==o) continue; if(sz(X[u])==0) { int l=-1; for(auto i:X[v]) is[i]=1; for(auto i:X[v]) { int c=0; for(auto j:G1[i]) c+=is[j];if(c==1&&i!=o) l=i; } id[u]=id[l]; for(auto i:X[v]) { is[i]=0; if(i!=l) X[u].pb(i); } X[u].pb(u); } dfs1(u,v); } } static ll ans=0; static void dfs2(int v,int o) { for(auto u:G1[v]) { if(u==o||!is[u]) continue; ll x=Move(u); ans+=x*(1LL<<id[u]); dfs2(u,v); } if(o!=-1) Move(o); } ll Ioi(int n, int m, int A[], int B[], int p, int v, int t) { for(int i=0;i<m;i++) { G[A[i]].pb(B[i]); G[B[i]].pb(A[i]); } dfs(0); for(auto x:V) X[x]=V; dfs1(0,-1); ans+=(ll)v*(1LL<<id[p]); for(auto i:X[p]) is[i]=1; dfs2(p,-1); return ans; }

컴파일 시 표준 에러 (stderr) 메시지

Joi.cpp: In function 'void dfs1(int, int)':
Joi.cpp:59:17: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   59 |                 for(auto j:G1[i]) c+=is[j];if(c==1&&i!=o) l=i;
      |                 ^~~
Joi.cpp:59:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   59 |                 for(auto j:G1[i]) c+=is[j];if(c==1&&i!=o) l=i;
      |                                            ^~
Joi.cpp: At global scope:
Joi.cpp:15:11: warning: 'infl' defined but not used [-Wunused-variable]
   15 | static ll infl=1000000000000000007;
      |           ^~~~
Joi.cpp:14:12: warning: 'inf' defined but not used [-Wunused-variable]
   14 | static int inf=1000000007;
      |            ^~~
Joi.cpp:13:11: warning: 'mod' defined but not used [-Wunused-variable]
   13 | static ll mod=1000000007;
      |           ^~~

Ioi.cpp: In function 'void dfs1(int, int)':
Ioi.cpp:60:17: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   60 |                 for(auto j:G1[i]) c+=is[j];if(c==1&&i!=o) l=i;
      |                 ^~~
Ioi.cpp:60:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   60 |                 for(auto j:G1[i]) c+=is[j];if(c==1&&i!=o) l=i;
      |                                            ^~
Ioi.cpp: At global scope:
Ioi.cpp:15:11: warning: 'infl' defined but not used [-Wunused-variable]
   15 | static ll infl=1000000000000000007;
      |           ^~~~
Ioi.cpp:14:12: warning: 'inf' defined but not used [-Wunused-variable]
   14 | static int inf=1000000007;
      |            ^~~
Ioi.cpp:13:11: warning: 'mod' defined but not used [-Wunused-variable]
   13 | static ll mod=1000000007;
      |           ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...