Submission #260325

# Submission time Handle Problem Language Result Execution time Memory
260325 2020-08-10T05:28:05 Z 최은수(#5043) Library (JOI18_library) C++17
0 / 100
604 ms 512 KB
#include"library.h"
#include<iostream>
#include<vector>
#include<algorithm>
#define ep emplace
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const int inf=1e9+7;
const ll INF=1e18;
int n;
int qu(vector<int>v)
{
    vector<int>m(n,0);
    for(int&t:v)
        m[t-1]=1;
    return Query(m);
}
int qu(int i,int j)
{
    return qu(vector<int>({i,j}));
}
vector<int>adj[205];
int chk[205];
void Solve(int N)
{
    n=N;
    vector<int>stk;
    chk[1]=1;
    stk.eb(1);
    while(!stk.empty())
    {
        int x=stk.back();
        stk.pop_back();
        for(int i=0;i++<n;)
            if(chk[i]==0)
                if(qu(x,i)==1)
                    adj[x].eb(i),adj[i].eb(x),chk[i]=1,stk.eb(i);
    }
    int x=0,p=-1;
    for(int i=0;i++<n;)
        if((int)adj[i].size()==1)
            x=i;
    vector<int>ans;
    while((int)ans.size()<n)
    {
        ans.eb(x);
        int nx=-1;
        for(int&t:adj[x])
            if(t!=p)
                nx=t;
        p=x;
        x=nx;
    }
    Answer(ans);
    return;
}
# Verdict Execution time Memory Grader output
1 Correct 296 ms 500 KB # of queries: 18247
2 Correct 270 ms 376 KB # of queries: 18007
3 Correct 311 ms 376 KB # of queries: 19793
4 Correct 301 ms 504 KB # of queries: 19752
5 Correct 268 ms 384 KB # of queries: 19833
6 Correct 306 ms 376 KB # of queries: 19760
7 Correct 315 ms 372 KB # of queries: 19826
8 Correct 282 ms 256 KB # of queries: 18465
9 Correct 330 ms 376 KB # of queries: 19538
10 Correct 140 ms 376 KB # of queries: 8192
11 Incorrect 0 ms 256 KB Wrong Answer [5]
12 Correct 0 ms 256 KB # of queries: 1
13 Correct 1 ms 256 KB # of queries: 2
14 Correct 1 ms 256 KB # of queries: 6
15 Correct 2 ms 256 KB # of queries: 105
16 Correct 5 ms 256 KB # of queries: 345
# Verdict Execution time Memory Grader output
1 Correct 296 ms 500 KB # of queries: 18247
2 Correct 270 ms 376 KB # of queries: 18007
3 Correct 311 ms 376 KB # of queries: 19793
4 Correct 301 ms 504 KB # of queries: 19752
5 Correct 268 ms 384 KB # of queries: 19833
6 Correct 306 ms 376 KB # of queries: 19760
7 Correct 315 ms 372 KB # of queries: 19826
8 Correct 282 ms 256 KB # of queries: 18465
9 Correct 330 ms 376 KB # of queries: 19538
10 Correct 140 ms 376 KB # of queries: 8192
11 Incorrect 0 ms 256 KB Wrong Answer [5]
12 Correct 0 ms 256 KB # of queries: 1
13 Correct 1 ms 256 KB # of queries: 2
14 Correct 1 ms 256 KB # of queries: 6
15 Correct 2 ms 256 KB # of queries: 105
16 Correct 5 ms 256 KB # of queries: 345
17 Runtime error 11 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 27 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 24 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 38 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 13 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 11 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 36 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 7 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 84 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 12 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 198 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 525 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 558 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 604 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)