Submission #269566

# Submission time Handle Problem Language Result Execution time Memory
269566 2020-08-17T07:52:59 Z 최은수(#5097) Chameleon's Love (JOI20_chameleon) C++17
40 / 100
3 ms 1152 KB
#include"chameleon.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;
static bool chk[510][510];
static bool ck[510][510];
static vector<int>adj[510];
void Solve(int N)
{
    int n=N;
    for(int i=0;i++<n*2;)
        for(int j=i;j++<n*2;)
            chk[i][j]=chk[j][i]=Query(vector<int>({i,j}))==1;
    for(int i=0;i++<n*2;)
        for(int j=0;j++<n*2;)
            if(chk[i][j])
                adj[i].eb(j);
    for(int i=0;i++<n*2;)
    {
        if((int)adj[i].size()==3)
        {
            int a=adj[i][0],b=adj[i][1],c=adj[i][2];
            if(Query(vector<int>({i,a,b}))==1)
                ck[i][c]=ck[c][i]=1;
            else if(Query(vector<int>({i,a,c}))==1)
                ck[i][b]=ck[b][i]=1;
            else
                ck[i][a]=ck[a][i]=1;
        }
    }
    for(int i=0;i++<n*2;)
        for(int j=i;j++<n*2;)
            if(chk[i][j]&&!ck[i][j])
                Answer(i,j);
    return;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Runtime error 3 ms 1152 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 1 ms 384 KB Output is correct
8 Correct 0 ms 384 KB Output is correct
9 Correct 1 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 1 ms 384 KB Output is correct
8 Correct 0 ms 384 KB Output is correct
9 Correct 1 ms 384 KB Output is correct
10 Correct 2 ms 512 KB Output is correct
11 Correct 2 ms 384 KB Output is correct
12 Correct 2 ms 512 KB Output is correct
13 Correct 2 ms 512 KB Output is correct
14 Correct 3 ms 512 KB Output is correct
15 Correct 2 ms 384 KB Output is correct
16 Correct 2 ms 512 KB Output is correct
17 Correct 2 ms 512 KB Output is correct
18 Correct 2 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Runtime error 3 ms 1152 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Runtime error 3 ms 1152 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -