Submission #642825

#TimeUsernameProblemLanguageResultExecution timeMemory
642825maryoyoyoZagrade (COI20_zagrade)C++17
0 / 100
0 ms208 KiB
#include <bits/stdc++.h> #define ll long long #define ii pair<int, int> #define ld long double using namespace std; const int dv = 1e9 + 7; const ld eps = 1e-18; const int sz = 1e5; int n, q; bool cek; string s; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> q; for(int i = 1; i <= n/2 + ((n/2)%2); i += 2) { cout << "? " << i << ' ' << i+1 << '\n'; cout << flush; cin >> cek; if(cek) { s = s + "()"; } else { s = s + "(("; } } for(int i = n/2 + ((n/2)%2); i <= n; i += 2) { cout << "? " << i << ' ' << i + 1 << '\n'; cout << flush; cin >> cek; if(cek) { s = s + "()"; } else { s = s + "))"; } } cout << "! " << s << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...