# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
236351 |
2020-06-01T13:14:24 Z |
MvC |
Library (JOI18_library) |
C++11 |
|
480 ms |
508 KB |
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include "library.h"
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define mkp make_pair
#define in insert
#define er erase
#define fd find
#define fr first
#define sc second
#define all(x) x.begin(),x.end()
typedef long long ll;
typedef long double ld;
const ll INF=0x3f3f3f3f3f3f3f3f;
const ll llinf=(1LL<<62);
const int inf=(1<<30);
const int nmax=1e5+50;
const ll mod=1e9+7;
using namespace std;
int i,j,pr,nx,x,y;
vector<int>vc,rs,a,nw,v1,v2,cur;
int ask(vector<int>v)
{
return Query(v);
}
void Solve(int n)
{
for(i=0;i<n;i++)vc.pb(1);
for(i=0;i<n;i++)
{
vc[i]=0;
if(ask(vc)==1)
{
nx=i;
break;
}
vc[i]=1;
}
rs.pb(nx);
for(i=0;i<n;i++)if(i!=nx)a.pb(i);
for(i=1;i<n;i++)
{
pr=nx;
cur=a;
while(1)
{
if((int)cur.size()==1)
{
nx=cur[0];
break;
}
v1.clear(),v2.clear();
for(j=0;j<(int)cur.size();j++)
{
if(j<(int)cur.size()/2)v1.pb(cur[j]);
else v2.pb(cur[j]);
}
for(j=0;j<n;j++)vc[j]=0;
for(j=0;j<(int)v1.size();j++)vc[v1[j]]=1;
x=ask(vc);
vc[pr]=1;
y=ask(vc);
if(x==y)cur=v1;
else cur=v2;
}
nw=a;
a.clear();
for(j=0;j<(int)nw.size();j++)if(nw[j]!=nx)a.pb(nw[j]);
rs.pb(nx);
}
for(i=0;i<n;i++)rs[i]++;
Answer(rs);
}
/*int main()
{
//freopen("sol.in","r",stdin);
//freopen("sol.out","w",stdout);
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
53 ms |
256 KB |
# of queries: 2375 |
2 |
Correct |
44 ms |
384 KB |
# of queries: 2409 |
3 |
Correct |
52 ms |
256 KB |
# of queries: 2648 |
4 |
Correct |
50 ms |
384 KB |
# of queries: 2595 |
5 |
Correct |
41 ms |
384 KB |
# of queries: 2508 |
6 |
Correct |
45 ms |
256 KB |
# of queries: 2551 |
7 |
Correct |
49 ms |
256 KB |
# of queries: 2544 |
8 |
Correct |
44 ms |
384 KB |
# of queries: 2420 |
9 |
Correct |
41 ms |
256 KB |
# of queries: 2546 |
10 |
Correct |
26 ms |
256 KB |
# of queries: 1474 |
11 |
Incorrect |
5 ms |
256 KB |
Wrong Answer [2] |
12 |
Correct |
4 ms |
256 KB |
# of queries: 1 |
13 |
Correct |
5 ms |
256 KB |
# of queries: 4 |
14 |
Correct |
5 ms |
256 KB |
# of queries: 7 |
15 |
Correct |
6 ms |
308 KB |
# of queries: 77 |
16 |
Correct |
10 ms |
384 KB |
# of queries: 183 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
53 ms |
256 KB |
# of queries: 2375 |
2 |
Correct |
44 ms |
384 KB |
# of queries: 2409 |
3 |
Correct |
52 ms |
256 KB |
# of queries: 2648 |
4 |
Correct |
50 ms |
384 KB |
# of queries: 2595 |
5 |
Correct |
41 ms |
384 KB |
# of queries: 2508 |
6 |
Correct |
45 ms |
256 KB |
# of queries: 2551 |
7 |
Correct |
49 ms |
256 KB |
# of queries: 2544 |
8 |
Correct |
44 ms |
384 KB |
# of queries: 2420 |
9 |
Correct |
41 ms |
256 KB |
# of queries: 2546 |
10 |
Correct |
26 ms |
256 KB |
# of queries: 1474 |
11 |
Incorrect |
5 ms |
256 KB |
Wrong Answer [2] |
12 |
Correct |
4 ms |
256 KB |
# of queries: 1 |
13 |
Correct |
5 ms |
256 KB |
# of queries: 4 |
14 |
Correct |
5 ms |
256 KB |
# of queries: 7 |
15 |
Correct |
6 ms |
308 KB |
# of queries: 77 |
16 |
Correct |
10 ms |
384 KB |
# of queries: 183 |
17 |
Correct |
480 ms |
400 KB |
# of queries: 17982 |
18 |
Correct |
466 ms |
384 KB |
# of queries: 17293 |
19 |
Correct |
469 ms |
412 KB |
# of queries: 17467 |
20 |
Correct |
423 ms |
392 KB |
# of queries: 16325 |
21 |
Correct |
413 ms |
508 KB |
# of queries: 15324 |
22 |
Correct |
474 ms |
504 KB |
# of queries: 17669 |
23 |
Correct |
447 ms |
400 KB |
# of queries: 17224 |
24 |
Correct |
162 ms |
504 KB |
# of queries: 7915 |
25 |
Correct |
465 ms |
384 KB |
# of queries: 17136 |
26 |
Correct |
411 ms |
384 KB |
# of queries: 15963 |
27 |
Correct |
184 ms |
384 KB |
# of queries: 8040 |
28 |
Correct |
474 ms |
396 KB |
# of queries: 15957 |
29 |
Correct |
418 ms |
396 KB |
# of queries: 15939 |
30 |
Correct |
417 ms |
504 KB |
# of queries: 15957 |