제출 #72209

#제출 시각아이디문제언어결과실행 시간메모리
72209BBBSNG (#118)통행이 제한된 저택 (FXCUP3_key)C++17
23 / 100
10 ms2156 KiB
#include "key.h"
#include <bits/stdc++.h>

using namespace std;
typedef pair<int, int> pii;

bool ans[1005][1005];
int num[1005];

void EnsureKeyInfo(int N) {
    for(int i = 1; i <= N; i++) {
        TakeKey(i);
        num[i] = Explore();
    }
    for(int i = 1; i <= N; i++) {
        ans[i][i] = 1;
        for(int j = i + 1; j <= N; j++) {
            TakeKey(i); TakeKey(j);
            
            int tmp = Explore();
            if(tmp == num[i]) ans[i][j] = true;
            if(tmp == num[j]) ans[j][i] = true;
        }
    }
    for(int i = 1; i <= N; i++) {
        for(int j = 1; j <= N; j++) {
            if(ans[i][j]) Report(i, j);
        }
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...