Submission #930838

# Submission time Handle Problem Language Result Execution time Memory
930838 2024-02-20T13:30:45 Z vjudge1 Party (POI11_imp) C++17
9 / 100
490 ms 65536 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define all(x) x.begin(), x.end()
#define INF 0x3f3f3f3f
#define INFLL (ll)0x3f3f3f3f3f3f3f3f
const int MOD = 1e9 + 7, SZ = 1e5 + 10;

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n, m;
    cin >> n >> m;
    int N = n;
    vector<vector<int>> vtx(n + 1);
    int A[n + 1] = {};
    while(m--){
        int u, v;
        cin >> u >> v;
        vtx[u].push_back(v);
        vtx[v].push_back(u);
    }
    for(int i = 1; i <= n; i++){
        if(A[i]) continue;
        int con[n + 1] = {};
        con[i] = 1;
        for(int v : vtx[i]){
            con[v] = 1;
        }
        for(int j = 1; j <= n; j++){
            if(A[j] || con[j]) continue;
            A[i] = A[j] = 1;
            break;
        }
    }
    for(int i = 1; i <= n; i++){
        if(A[i] && N > n / 3){
            N--;
            continue;
        }
        cout << i << ' ';
    }
    return 0;
}
// by me
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 472 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 604 KB Output is correct
2 Incorrect 13 ms 2140 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 7 ms 1112 KB Output is correct
2 Incorrect 40 ms 7848 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 13 ms 1624 KB Output is correct
2 Incorrect 116 ms 18764 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 30 ms 3676 KB Output is correct
2 Incorrect 150 ms 27184 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 91 ms 11600 KB Output is correct
2 Incorrect 186 ms 31696 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 177 ms 15612 KB Output is correct
2 Incorrect 245 ms 38740 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 212 ms 17584 KB Output is correct
2 Incorrect 319 ms 55380 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 258 ms 19280 KB Output is correct
2 Incorrect 378 ms 62160 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 313 ms 35864 KB Output is correct
2 Incorrect 432 ms 65536 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 400 ms 40824 KB Output is correct
2 Incorrect 490 ms 65536 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -