답안 #987430

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
987430 2024-05-22T18:22:42 Z hugo_pm Island Hopping (JOI24_island) C++17
2 / 100
4 ms 880 KB
#include "island.h"
#include <bits/stdc++.h>
using namespace std;

void solve(int N, int L) {
    vector<set<int>> adj(N+1);
    vector<int> myMin(N+1);
    for (int node = 1; node <= N; ++node) {
        myMin[node] = query(node, 1);
        adj[node].insert(myMin[node]);
        adj[myMin[node]].insert(node);
    }
    for (int node = 1; node <= N; ++node) {
        set<int> bad = adj[myMin[node]];
        for (int k = 2; k <= N-1; ++k) {
            int voisin = query(node, k);
            if (bad.count(voisin))
                break;
            adj[node].insert(voisin);
            adj[voisin].insert(node);
            for (int x : adj[voisin])
                bad.insert(x);
        }
    }
    for (int node = 1; node <= N; ++node) {
        for (int voisin : adj[node]) if (node < voisin) {
            answer(node, voisin);
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Incorrect 4 ms 600 KB Wrong Answer [5]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 596 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 4 ms 880 KB Wrong Answer [5]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 600 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Incorrect 4 ms 600 KB Wrong Answer [5]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Incorrect 4 ms 600 KB Wrong Answer [5]
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 596 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -