제출 #225957

#제출 시각아이디문제언어결과실행 시간메모리
225957balbitPark (JOI17_park)C++14
10 / 100
952 ms1140 KiB
#include <bits/stdc++.h> #ifndef BALBIT #include "park.h" #endif // BALBIT using namespace std; #define ll long long #define pii pair<int,int> #define f first #define s second #define SZ(x) (int)(x.size()) #define ALL(x) x.begin(),x.end() #define pb push_back #ifdef BALBIT #define bug(...) cerr<<__LINE__<<": "<<#__VA_ARGS__<<": ", _do(__VA_ARGS__) template<typename T> void _do(T && x){cerr<<x<<endl;} template<typename T, typename ...S> void _do(T && x, S&&...y){cerr<<x<<", "; _do(y...);} #define IOS() #else #define IOS() ios::sync_with_stdio(0),cin.tie(0) #define endl '\n' #define bug(...) #endif // BALBIT const int maxn = 3e5+5; static int B[1400]; static bool done[1400]; struct Gp{ int l, r; vector<int> nd; }; int ask(int a, int b, int x[]) { return Ask(min(a,b), max(a,b), x); } void answer(int a, int b){ Answer(min(a,b), max(a,b)); } vector<int> go(vector<int> v) { if (SZ(v) <= 1) return v; int x = v[rand() % SZ(v)]; fill(B, B+1400, 1); B[x] = 0; vector<int> le, ri; for (int y : v) { if (y!=x){ if (ask(0,y,B)) le.pb(y); else ri.pb(y); } } vector<int> L = go(le), R = go(ri); L.pb(x); L.insert(L.end(), ALL(R)); return L; } void Detect(int T, int n) { srand(10298432); vector<int> order; for (int i = 1; i<n-1; ++i) order.pb(i); vector<int> res = go(order); for (int i=0;i<SZ(res); ++i) { if (i==0) answer(0, res[i]); else answer(res[i-1], res[i]); } answer(res.back(), n-1); } #ifdef BALBIT signed main(){ bug(1,2,3); } #endif

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

park.cpp:29:13: warning: 'done' defined but not used [-Wunused-variable]
 static bool done[1400];
             ^~~~
#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...