///designed by NeoRoyal
///www.neoroyal.site
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define ppb pop_back()
#define ppf pop_front()
#define vpl vector<pair<ll,ll>>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
#define in insert
#define mp make_pair
#define vll vector<ll>
#define vint vector<int>
#define vs vector<string>
#define vbl vector<bool>
#define sll set<ll>
#define ss set<string>
#define mll map<ll, ll>
#define msl multiset<ll>
#define pque priority_queue
#define all(v) v.begin(),v.end()
#define rall(v) (v).rbegin(),(v).rend()
#define np next_permutation
#define sz(q) sizeof(q)/sizeof(q[0])
#define INF 0x3F3F3F3F
#define MAX 1e10
#define LOG 17
#define lb lower_bound
#define ub upper_bound
#define mem(q, p) memset(q, p, sizeof(q))
#define maxel *max_element
#define minel *min_element
#define yes cout << "YES\n"
#define no cout << "NO\n"
const int MOD = 1e9 + 7;
const int maxn = 5e5 + 5;
const int logn = 19;
const int sz = 150005;
const int width = 3;
///gcd & lcm
ll gcd(ll q, ll p){ return p == 0 ? q : gcd(p, q%p); }
ll lcm(ll q, ll p){ return q*p / gcd(q, p); }
using namespace std;
ll i, j;
void neoroyal(){
ll mx=0, n; cin>>n;
vll v, ans(n+1);
map<vll, ll> mp;
for(i=1; i<=n; i++){
v.pb(i); ll x;
if(mp[v] == 0){
cout << v.size() << ' ';
for(auto &i:v) cout << i << ' ';
cout << endl;
cin>>x;
mp[v] = x;
} else {
x = mp[v];
}
if(x <= mx){
v.ppb;
ll cur, l, r;
l = 0, r = v.size()-1;
while(l <= r){
ll mid = (l+r)>>2;
cout << mid+1 << ' ';
for(j=0; j<=mid; j++){
cout << v[j] << ' ';
}
cout << endl;
cin >> cur;
cout << mid+2 << ' ';
for(j=0; j<=mid; j++){
cout << v[j] << ' ';
}
cout << i << endl;
ll curr; cin >> curr;
cur >= curr ? r=mid : l = mid+1;
}
ans[i] = ans[v[l]];
}
else{
mx = x; ans[i] = mx;
}
}
cout << "0 ";
for(i=1; i<=n; i++){
cout << ans[i] << ' ' ;
}
cout << endl;
}
int main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
///cout.setf(std::ios::fixed); cout.precision(4);
system("color 0A");
///
neoroyal();
/// ll tests; cin>>tests; while(tests--) neoroyal();
/// cout<<ans<<endl;
system("pause");
}
/**
░█████╗░░░░░░░░░░░░░░░
██╔══██╗░░██╗░░░░██╗░░
██║░░╚═╝██████╗██████╗
██║░░██╗╚═██╔═╝╚═██╔═╝
╚█████╔╝░░╚═╝░░░░╚═╝░░
░╚════╝░░░░░░░░░░░░░░░
**/
Compilation message
carnival.cpp: In function 'int main()':
carnival.cpp:104:11: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
104 | system("color 0A");
| ~~~~~~^~~~~~~~~~~~
carnival.cpp:111:11: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
111 | system("pause");
| ~~~~~~^~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
56 ms |
468 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
53 ms |
436 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
44 ms |
424 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
65 ms |
452 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
49 ms |
424 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |