Submission #926592

# Submission time Handle Problem Language Result Execution time Memory
926592 2024-02-13T11:39:48 Z vjudge1 Party (POI11_imp) C++17
0 / 100
431 ms 37060 KB
#include <bits/stdc++.h>
#include <fstream>
#define endl '\n'
#define mod 998244353
#define INF 1000000000
#define INF2 2000000000000000000
//#define ll long long
///#define cin fin
///#define cout fout
using namespace std;
double const EPS = 1e-14;
///ofstream fout("herding.out");
///ifstream fin("herding.in");

int main()
{
    ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);
    int n, m; cin >> n >> m;
    bool ok[n+1][n+1] = {};
    bool check[n+1] = {};
    for(int i = 0; i < m; i++) {
        int a, b; cin >> a >> b;
        ok[a][b] = 1; ok[b][a] = 1;
    } 
    int sum = 0;
    for(int i = 1; i <= n; i++) {
        if(check[i] == 1) continue;
        for(int j = 1; j <= n; j++) {
            if(i == j) continue;
            if(ok[i][j] == 0) {
                check[i] = 1;
                check[j] = 1;
                sum++;
                break;
            }
        }
        if(sum == n/3) break;
    } int cnt = 0;
    for(int i = 1; i <= n; i++) {
        if(check[i] == 0) {
            cout << i << ' ';
            cnt++;
        }
        if(cnt == n/3) break;
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 860 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 1628 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 3128 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 89 ms 9044 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 150 ms 16208 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 205 ms 21484 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 241 ms 25508 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 325 ms 29988 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 431 ms 37060 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -