Submission #549544

#TimeUsernameProblemLanguageResultExecution timeMemory
549544Killer2501Library (JOI18_library)C++14
Compilation error
0 ms0 KiB
#include"library.h" using namespace std; const int N = 4e3+5; const int M = 750; const int mod = 1e9+7; const ll base = 75; const ll inf = 1e16+7; int n, t, ans, tong; int k, m, a[N], b[N]; vector<pii> adj[N]; void Solve(int n) { vector<int> vi, res; vi.resize(n, 0); for(int i = 0; i < n; i ++) { vi[i] = 1; if(Query(vi) == 1) { a[i] = 1; res.pb(i+1); break; } vi[i] = 0; } for(int j = 2; j <= n; j ++) { int l = 1, r = n-j+1, mid; vi[res[j-2]-1] = 0; while(l <= r) { mid = (l+r)>>1; for(int i = 0, cnt = 0; i < n && cnt < mid; i ++) if(!a[i])vi[i] = 1, ++cnt; k = Query(vi); vi[res[j-2]-1] = 1; if(k <= Query(vi))l = mid+1; else r = mid-1; vi[res[j-2]-1] = 0; for(int i = 0, cnt = 0; i < n && cnt < mid; i ++) if(!a[i])vi[i] = 0, ++cnt; } vi[res[j-2]-1] = 1; int i = 0, cnt = 0; while(cnt < l) { if(!a[i])++cnt; ++i; } --i; a[i] = 1; res.pb(i+1); } Answer(res); //for(int x: res)cout << x <<" "; }

Compilation message (stderr)

library.cpp:6:7: error: 'll' does not name a type
    6 | const ll base = 75;
      |       ^~
library.cpp:7:7: error: 'll' does not name a type
    7 | const ll inf = 1e16+7;
      |       ^~
library.cpp:10:8: error: 'pii' was not declared in this scope
   10 | vector<pii> adj[N];
      |        ^~~
library.cpp:10:11: error: template argument 1 is invalid
   10 | vector<pii> adj[N];
      |           ^
library.cpp:10:11: error: template argument 2 is invalid
library.cpp: In function 'void Solve(int)':
library.cpp:22:17: error: 'class std::vector<int>' has no member named 'pb'
   22 |             res.pb(i+1);
      |                 ^~
library.cpp:53:13: error: 'class std::vector<int>' has no member named 'pb'
   53 |         res.pb(i+1);
      |             ^~