Submission #269589

# Submission time Handle Problem Language Result Execution time Memory
269589 2020-08-17T07:59:20 Z 최은수(#5097) Chameleon's Love (JOI20_chameleon) C++17
0 / 100
43 ms 1272 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[1010][1010];
static void dnc(int x,int s,int e)
{
    {
        vector<int>qv;
        qv.eb(x);
        for(int i=s;i<=e;i++)
            qv.eb(i);
        if(Query(qv)==e-s+2)
            return;
    }
    if(s==e)
    {
        chk[x][s]=chk[s][x]=1;
        return;
    }
    int m=s+(e-s)/2;
    dnc(x,s,m);
    dnc(x,m+1,e);
    return;
}
static bool ck[1010][1010];
static vector<int>adj[1010];
void Solve(int N)
{
    int n=N;
    for(int i=0;i++<n;)
        dnc(i,n+1,n*2);
    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 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Incorrect 43 ms 1144 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Wrong Answer [6]
3 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 Incorrect 37 ms 1272 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Incorrect 43 ms 1144 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -