답안 #269605

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
269605 2020-08-17T08:04:41 Z 최은수(#5097) 카멜레온의 사랑 (JOI20_chameleon) C++17
20 / 100
28 ms 2432 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 int dnc(int x,int s,int e)
{
    if(e<s)
        return e;
    if(s==e)
    {
        chk[x][s]=chk[s][x]=1;
        return s;
    }
    int m=s+(e-s)/2;
    bool f;
    {
        vector<int>qv;
        qv.eb(x);
        for(int i=s;i<=m;i++)
            qv.eb(i);
        f=Query(qv)<(int)qv.size();
    }
    if(f)
        return dnc(x,s,m);
    return dnc(x,m+1,e);
}
static bool ck[1010][1010];
static vector<int>adj[1010];
void Solve(int N)
{
    int n=N;
    for(int i=0;i++<n;)
    {
        int s=dnc(i,n+1,n*2+1);
        s=dnc(i,s+1,n*2+1);
        s=dnc(i,s+1,n*2+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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Incorrect 28 ms 1536 KB Wrong Answer [6]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 1 ms 384 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 1 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 Correct 26 ms 2432 KB Output is correct
4 Correct 26 ms 2296 KB Output is correct
5 Correct 25 ms 2328 KB Output is correct
6 Correct 25 ms 2424 KB Output is correct
7 Correct 26 ms 2432 KB Output is correct
8 Correct 25 ms 2432 KB Output is correct
9 Correct 26 ms 2424 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Incorrect 28 ms 1536 KB Wrong Answer [6]
4 Halted 0 ms 0 KB -