답안 #1015991

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1015991 2024-07-07T08:19:07 Z SulA 마술쇼 (APIO24_show) C++17
5 / 100
2 ms 832 KB
#include "Alice.h"
using namespace std;

vector<pair<int, int>> Alice() {
    long long x = setN(5000);
    vector<pair<int,int>> tree;
    for (int i = 1; i <= 5000; i++) {
        if (i != x) {
            tree.push_back({i, x});
        }
    }
    return tree;
}
#include "Bob.h"
using namespace std;

long long Bob(vector<pair<int,int>> tree) {
    int cnt[5001] = {};
    for (auto [u,v] : tree) {
        cnt[u]++, cnt[v]++;
    }
    int ans = 0;
    for (int i = 1; i <= 5000; i++) {
        if (cnt[i] > cnt[ans]) {
            ans = i;
        }
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 832 KB Correct.
2 Correct 1 ms 832 KB Correct.
3 Correct 1 ms 820 KB Correct.
4 Correct 1 ms 832 KB Correct.
5 Correct 1 ms 824 KB Correct.
6 Correct 1 ms 832 KB Correct.
7 Correct 2 ms 820 KB Correct.
8 Correct 2 ms 820 KB Correct.
9 Correct 2 ms 820 KB Correct.
10 Correct 2 ms 820 KB Correct.
11 Correct 1 ms 820 KB Correct.
12 Correct 1 ms 816 KB Correct.
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 832 KB Correct.
2 Correct 1 ms 832 KB Correct.
3 Correct 1 ms 820 KB Correct.
4 Correct 1 ms 832 KB Correct.
5 Correct 1 ms 824 KB Correct.
6 Correct 1 ms 832 KB Correct.
7 Correct 2 ms 820 KB Correct.
8 Correct 2 ms 820 KB Correct.
9 Correct 2 ms 820 KB Correct.
10 Correct 2 ms 820 KB Correct.
11 Correct 1 ms 820 KB Correct.
12 Correct 1 ms 816 KB Correct.
13 Incorrect 1 ms 344 KB Output isn't correct
14 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 832 KB Correct.
2 Correct 1 ms 832 KB Correct.
3 Correct 1 ms 820 KB Correct.
4 Correct 1 ms 832 KB Correct.
5 Correct 1 ms 824 KB Correct.
6 Correct 1 ms 832 KB Correct.
7 Correct 2 ms 820 KB Correct.
8 Correct 2 ms 820 KB Correct.
9 Correct 2 ms 820 KB Correct.
10 Correct 2 ms 820 KB Correct.
11 Correct 1 ms 820 KB Correct.
12 Correct 1 ms 816 KB Correct.
13 Incorrect 1 ms 344 KB Output isn't correct
14 Halted 0 ms 0 KB -