Submission #260324

# Submission time Handle Problem Language Result Execution time Memory
260324 2020-08-10T05:27:03 Z 최은수(#5043) Library (JOI18_library) C++17
0 / 100
589 ms 632 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;
    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 272 ms 504 KB # of queries: 18248
2 Correct 286 ms 376 KB # of queries: 18008
3 Correct 333 ms 376 KB # of queries: 19794
4 Correct 311 ms 384 KB # of queries: 19753
5 Correct 321 ms 380 KB # of queries: 19834
6 Correct 261 ms 376 KB # of queries: 19761
7 Correct 314 ms 504 KB # of queries: 19827
8 Correct 319 ms 380 KB # of queries: 18466
9 Correct 348 ms 376 KB # of queries: 19539
10 Correct 124 ms 376 KB # of queries: 8193
11 Incorrect 0 ms 256 KB Wrong Answer [5]
12 Correct 0 ms 256 KB # of queries: 2
13 Correct 0 ms 256 KB # of queries: 3
14 Correct 1 ms 256 KB # of queries: 7
15 Correct 1 ms 256 KB # of queries: 106
16 Correct 4 ms 256 KB # of queries: 346
# Verdict Execution time Memory Grader output
1 Correct 272 ms 504 KB # of queries: 18248
2 Correct 286 ms 376 KB # of queries: 18008
3 Correct 333 ms 376 KB # of queries: 19794
4 Correct 311 ms 384 KB # of queries: 19753
5 Correct 321 ms 380 KB # of queries: 19834
6 Correct 261 ms 376 KB # of queries: 19761
7 Correct 314 ms 504 KB # of queries: 19827
8 Correct 319 ms 380 KB # of queries: 18466
9 Correct 348 ms 376 KB # of queries: 19539
10 Correct 124 ms 376 KB # of queries: 8193
11 Incorrect 0 ms 256 KB Wrong Answer [5]
12 Correct 0 ms 256 KB # of queries: 2
13 Correct 0 ms 256 KB # of queries: 3
14 Correct 1 ms 256 KB # of queries: 7
15 Correct 1 ms 256 KB # of queries: 106
16 Correct 4 ms 256 KB # of queries: 346
17 Runtime error 13 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 22 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 20 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 50 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 9 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 9 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 49 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 77 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 13 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 189 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 546 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 572 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 589 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)