QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#428621 | #7804. Intersegment Activation | JooDdae | RE | 0ms | 0kb | C++20 | 811b | 2024-06-01 20:42:18 | 2024-06-01 20:42:19 |
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, k;
vector<int> v;
void find(int u) {
if(u == 0) {
v.push_back(0);
return;
}
find(u-1);
v.push_back(u);
find(u-1);
}
int query(int i, int j) {
cout << i << " " << j << endl;
int re; cin >> re;
return re;
}
int main() {
find(9);
cin.tie(0)->sync_with_stdio(0);
cin >> n >> k;
for(int i=n;i>=1;i--) {
auto x = query(i, i);
if(x < k) {
query(i, i);
continue;
}
if(x == k) {
int u = 0;
while(1) {
auto y = query(i, i+v[u++]);
if(y > k) break;
}
}
if(++k == n) return 0;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Runtime Error
input:
3 0 0 0
output:
3 3 3 3 3 4