# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
930829 |
2024-02-20T13:22:46 Z |
vjudge1 |
Party (POI11_imp) |
C++17 |
|
420 ms |
41000 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;
const int MAXN = 3e3 + 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);
}
// cout << endl;
for(int i = 1; i <= n; i++){
int con[n + 1] = {};
for(int v : vtx[i]){
con[v] = 1;
}
for(int j = 1; j <= n; j++){
if(A[j] || con[j] || j == i) continue;
A[i] = A[j] = 1;
break;
}
}
for(int i = 1; i <= n; i++){
if(A[i] && N > n / 3){
N--;
continue;
}
cout << i << ' ';
}
cout << endl;
return 0;
}
// by me
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Nie wszystkie wypisane osoby siê znaja |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
604 KB |
Nie wszystkie wypisane osoby siê znaja |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
1116 KB |
Nie wszystkie wypisane osoby siê znaja |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
1628 KB |
Nie wszystkie wypisane osoby siê znaja |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
32 ms |
3676 KB |
Nie wszystkie wypisane osoby siê znaja |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
90 ms |
11604 KB |
Nie wszystkie wypisane osoby siê znaja |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
176 ms |
15444 KB |
Nie wszystkie wypisane osoby siê znaja |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
217 ms |
17492 KB |
Nie wszystkie wypisane osoby siê znaja |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
264 ms |
19024 KB |
Nie wszystkie wypisane osoby siê znaja |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
342 ms |
35996 KB |
Nie wszystkie wypisane osoby siê znaja |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
420 ms |
41000 KB |
Nie wszystkie wypisane osoby siê znaja |
2 |
Halted |
0 ms |
0 KB |
- |