# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
534604 | almothana05 | Carnival (CEOI14_carnival) | C++14 | 9 ms | 712 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// #include<iostream>
// #include<vector>
// #include<algorithm>
// #include<cassert>
// #include<queue>
// #include<set>
// #include<map>
#include<bits/stdc++.h>
#define mod 1000000007
#define inf 1000000000000000000
using namespace std;
vector<int>pl;
vector<int>kost(100000 , 0);
int main() {
// freopen("paint.in", "r", stdin);
// freopen("paint.out", "w", stdout);
// ios_base::sync_with_stdio(false);
// cin.tie(NULL);
int menge , numm , nummer;
cin >> menge;
kost[1] = 1;
pl.push_back(0);
pl.push_back(1);
for(int i = 2 ; i <= menge ; i++){
cout << pl.size() << ' ';
for(int j = 1 ; j < pl.size() ; j++){
cout << pl[j] << ' ';
}
cout << i << endl;
cin >> numm;
if(numm == pl.size()){
pl.push_back(i);
kost[i] = pl.size() - 1;
continue;
}
int st = 1 , en = pl.size() - 1 , mit;
while(st <= en){
int mit = (st + en)/2;
// cout << mit << ' ' << st << "\n";
cout << mit - st + 2 << ' ';
for(int j = st ; j <= mit ; j++){
cout << pl[j] << ' ';
}
cout << i << endl;
cin >> numm;
if(numm == mit - st + 2){
st = mit + 1;
}
else{
en = mit - 1;
}
}
kost[i] = st;
}
cout << 0 << ' ';
for(int i = 1; i <= menge ; i++){
cout << kost[i] << ' ';
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |