답안 #1000275

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1000275 2024-06-17T07:48:16 Z Unforgettablepl 카멜레온의 사랑 (JOI20_chameleon) C++17
0 / 100
16 ms 600 KB
#include <bits/stdc++.h>
using namespace std;
 
int Query(const std::vector<int> &p);
void Answer(int a, int b);

void Solve(int N) {
    int n = N;
    vector<vector<int>> adj(2*n+1);
    set<pair<int,int>> edges;
    for(int i=1;i<=n;i++){
        for(int j=n+1;j<=2*n;j++){
            if(Query({i,j})==1){
                edges.insert({i,j});
                adj[i].emplace_back(j);
                adj[j].emplace_back(i);
            }
        }
    }
    for(int i=1;i<=2*n;i++){
        if(adj[i].size()==1)continue;
        assert(adj[i].size()==3);
        if(Query({i,adj[i][0],adj[i][1]})==1)edges.erase({min(i,adj[i][2]),max(i,adj[i][2])});
        else if(Query({i,adj[i][0],adj[i][2]})==1)edges.erase({min(i,adj[i][1]),max(i,adj[i][1])});
        else edges.erase({min(i,adj[i][0]),max(i,adj[i][0])});
    }
    for(auto[a,b]:edges)Answer(a,b);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Incorrect 15 ms 344 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Runtime error 0 ms 600 KB Execution killed with signal 6
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Runtime error 0 ms 600 KB Execution killed with signal 6
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Incorrect 16 ms 596 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Incorrect 15 ms 344 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -