Submission #957093

# Submission time Handle Problem Language Result Execution time Memory
957093 2024-04-03T00:14:21 Z MuntherCarrot Party (POI11_imp) C++14
100 / 100
888 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 con[n + 1][n + 1] = {};
    int del[n + 1] = {};
    while(m--){
        int u, v;
        cin >> u >> v;
        con[u][v] = con[v][u] = 1;
    }
    for(int i = 1; i <= n; i++){
        if(del[i]) continue;
        for(int j = i + 1; j <= n; j++){
            if(del[j] || con[i][j]) continue;
            del[i] = del[j] = 1;
            break;
        }
    }
    int cnt = 0;
    for(int i = 1; i <= n; i++){
        if(del[i] || cnt >= n / 3) continue;
        cnt++;
        cout << i << ' ';
    }
    return 0;
}
// by me
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 508 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 Correct 10 ms 2148 KB Output is correct
3 Correct 10 ms 1924 KB Output is correct
4 Correct 10 ms 2136 KB Output is correct
5 Correct 10 ms 2052 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 1372 KB Output is correct
2 Correct 43 ms 7164 KB Output is correct
3 Correct 41 ms 7540 KB Output is correct
4 Correct 40 ms 7252 KB Output is correct
5 Correct 40 ms 7248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 2784 KB Output is correct
2 Correct 118 ms 16408 KB Output is correct
3 Correct 124 ms 16724 KB Output is correct
4 Correct 175 ms 16464 KB Output is correct
5 Correct 118 ms 16468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 5660 KB Output is correct
2 Correct 201 ms 24016 KB Output is correct
3 Correct 201 ms 23776 KB Output is correct
4 Correct 199 ms 23752 KB Output is correct
5 Correct 203 ms 23892 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 101 ms 15772 KB Output is correct
2 Correct 287 ms 29520 KB Output is correct
3 Correct 306 ms 29388 KB Output is correct
4 Correct 289 ms 29524 KB Output is correct
5 Correct 305 ms 29528 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 237 ms 28048 KB Output is correct
2 Correct 366 ms 39296 KB Output is correct
3 Correct 391 ms 39076 KB Output is correct
4 Correct 409 ms 39044 KB Output is correct
5 Correct 487 ms 39300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 370 ms 36948 KB Output is correct
2 Correct 571 ms 46608 KB Output is correct
3 Correct 542 ms 46168 KB Output is correct
4 Correct 542 ms 46548 KB Output is correct
5 Correct 519 ms 46236 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 488 ms 43860 KB Output is correct
2 Correct 653 ms 54612 KB Output is correct
3 Correct 655 ms 54100 KB Output is correct
4 Correct 651 ms 54380 KB Output is correct
5 Correct 647 ms 54872 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 576 ms 51412 KB Output is correct
2 Correct 772 ms 63176 KB Output is correct
3 Correct 775 ms 62420 KB Output is correct
4 Correct 771 ms 62548 KB Output is correct
5 Correct 810 ms 62884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 708 ms 63560 KB Output is correct
2 Correct 884 ms 65536 KB Output is correct
3 Correct 790 ms 65536 KB Output is correct
4 Correct 816 ms 65536 KB Output is correct
5 Correct 888 ms 65536 KB Output is correct