Submission #539491

#TimeUsernameProblemLanguageResultExecution timeMemory
539491hhhhauraZagrade (COI20_zagrade)C++14
Compilation error
0 ms0 KiB
#define wiwihorz #include <bits/stdc++.h> #define rep(i, a, b) for(int i = a; i <= b; i ++) #define rrep(i, a, b) for(int i = b; i >= a; i--) #define ceil(a, b) ((a + b - 1) / (b)) #define all(x) x.begin(), x.end() #define int long long int #define lld long double #define pii pair<int, int> #define random mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()) #define INF 1000000000000000000 #define MOD 1000000007 #define eps (1e-9) using namespace std; #ifdef wiwihorz #define print(a...)cerr<<"Line "<<__LINE__<<":",kout("["+string(#a)+"] = ", a) void vprint(auto L,auto R){while(L<R)cerr<<*L<<" \n"[next(L)==R], ++L;} void kout(){cerr<< endl;} template<class T1,class ... T2>void kout(T1 a,T2 ... e){cerr<<a<<" ",kout(e...);} #else #define print(...) 0 #define vprint(...) 0 #endif signed main() { int n, q; cin >> n >> q; vector<int> a(n + 1, 0); auto query = [](int L, int R) { q--; if(q < 0) while(1); cout << "? " << L << " " << R << "\n"; cout.flush(); int x; cin >> x; return x; }; auto report = [&]() { cout << "! "; rep(i, 1, n) cout << (a[i] ? ")" : "("); cout << "\n"; cout.flush(); }; rep(i, 2, n) { int yes = 0; for(int j = 1; i - j >= 1; j += 2) { int x = query(i - j, i); if(x) yes = 1; } a[i] = yes; } report(); return 0; }

Compilation message (stderr)

zagrade.cpp:17:13: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   17 | void vprint(auto L,auto R){while(L<R)cerr<<*L<<" \n"[next(L)==R], ++L;}
      |             ^~~~
zagrade.cpp:17:20: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   17 | void vprint(auto L,auto R){while(L<R)cerr<<*L<<" \n"[next(L)==R], ++L;}
      |                    ^~~~
zagrade.cpp: In lambda function:
zagrade.cpp:30:3: error: 'q' is not captured
   30 |   q--;
      |   ^
zagrade.cpp:29:16: note: the lambda has no capture-default
   29 |  auto query = [](int L, int R) {
      |                ^
zagrade.cpp:26:9: note: 'long long int q' declared here
   26 |  int n, q;
      |         ^
zagrade.cpp:31:6: error: 'q' is not captured
   31 |   if(q < 0) while(1);
      |      ^
zagrade.cpp:29:16: note: the lambda has no capture-default
   29 |  auto query = [](int L, int R) {
      |                ^
zagrade.cpp:26:9: note: 'long long int q' declared here
   26 |  int n, q;
      |         ^