답안 #1053336

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1053336 2024-08-11T10:36:22 Z Ludissey Make them Meet (EGOI24_makethemmeet) C++17
14.803 / 100
38 ms 3288 KB
#include <bits/stdc++.h>
#define int long long
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
using namespace std;
int N,M,Q;
signed main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    cin >> N >> M;
    vector<pair<int,int>> ed(M);
    for (int i = 0; i < M; i++)
    {
        cin >> ed[i].first >> ed[i].second;
        if(ed[i].first>ed[i].second) swap(ed[i].first,ed[i].second);
    }
    sort(all(ed));
    cout << (2*M)+2 << '\n';
    for (int i = 0; i < N; i++) cout << 0 << ' ';
    cout << '\n';        
    for (int i = 0; i < N; i++) cout << 0 << ' ';
    cout << '\n';       
    for (int i = 0; i < M; i++) {
        for (int j = 0; j < N; j++)
        {
            if(j==ed[i].first||j==ed[i].second) cout << 0 << ' ';
            else cout << j+1 << ' ';
        }
        cout << '\n';
        for (int j = 0; j < N; j++)
        {
            if(j==ed[i].first||j==ed[i].second) cout << 0 << ' ';
            else cout << j+1 << ' ';
        }
        if(i<M-1) cout << '\n';
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Partially correct 1 ms 348 KB Partially correct
7 Partially correct 3 ms 600 KB Partially correct
8 Partially correct 5 ms 604 KB Partially correct
9 Partially correct 38 ms 3288 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB If people start at 0 and 1, then they can avoid each other
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Incorrect 0 ms 348 KB If people start at 0 and 1, then they can avoid each other
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Partially correct 1 ms 348 KB Partially correct
12 Partially correct 3 ms 600 KB Partially correct
13 Partially correct 5 ms 604 KB Partially correct
14 Partially correct 38 ms 3288 KB Partially correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Incorrect 0 ms 348 KB If people start at 0 and 1, then they can avoid each other
18 Halted 0 ms 0 KB -