답안 #269583

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
269583 2020-08-17T07:58:14 Z 최은수(#5097) 카멜레온의 사랑 (JOI20_chameleon) C++17
0 / 100
2 ms 512 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 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[510][510];
static vector<int>adj[510];
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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Runtime error 2 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Incorrect 0 ms 384 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Runtime error 1 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Runtime error 2 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -