제출 #1138765

#제출 시각아이디문제언어결과실행 시간메모리
1138765Noproblem29Amusement Park (JOI17_amusement_park)C++20
47 / 100
12 ms1400 KiB
#include "Joi.h" #include<bits/stdc++.h> using namespace std; #define ll long long const int _N=1e4+100; const int _M=5001; const int _B=447; const int mod=998244353; const ll INF=1e18; void Joi(int N, int M, int A[], int B[], long long X, int T) { for(int i = 0; i < N; i++){ long long cur=(i%60); ll bt=(X>>cur)&1ll; MessageBoard(i,bt); } }
#include "Ioi.h" #include<bits/stdc++.h> using namespace std; #define ll long long const int _N=1e4+100; const int _M=5001; const int _B=447; const int mod=998244353; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const ll INF=1e18; int cnt[60]; vector<int>g[_N]; bool mark[_N]; bool needtostop(){ for(int j=0;j<60;j++){ if(cnt[j]==-1){ return 0; } } return 1; } void dfs(int x){ mark[x]=1; if(needtostop())return; shuffle(g[x].begin(),g[x].end(),rng); for(auto i:g[x]){ if(!mark[i]){ cnt[i%60]=Move(i); dfs(i); if(needtostop())return; cnt[x%60]=Move(x); } } } long long Ioi(int n, int m, int a[], int b[], int pos, int V, int T) { cnt[pos%60]=V; for(int i=0;i<m;i++){ g[a[i]].push_back(b[i]); g[b[i]].push_back(a[i]); } for(int i=0;i<60;i++){ cnt[i]=-1; } dfs(pos); ll ans=0; for(ll i=0;i<60;i++){ if(cnt[i]){ ans+=(1ll<<i); } } return ans; }
#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...