# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1005512 |
2024-06-22T14:04:11 Z |
basa |
Party (POI11_imp) |
C++14 |
|
311 ms |
9304 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int maxn = 3005;
bool adj[maxn][maxn];
signed main()
{
cin.tie(0) -> sync_with_stdio(0);
int n, m;
cin >> n >> m;
for(int i = 0; i < m; i++){
int u, v;
cin >> u >> v;
adj[u][v] = 1;
adj[v][u] = 1;
}
bool skip[n + 5] = {};
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
if(skip[i] || skip[j] || i == j) continue;
if(!adj[i][j]){
skip[i] = 1;
skip[j] = 1;
}
}
}
int t = 0;
vector<int>ans;
for(int i = 1; i <= n && t < n / 3; i++){
if(skip[i]) continue;
t++;
ans.push_back(i);
}
for(int i : ans) cout << i << ' ';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
2652 KB |
Output is correct |
4 |
Correct |
1 ms |
2652 KB |
Output is correct |
5 |
Correct |
1 ms |
2652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2652 KB |
Output is correct |
2 |
Correct |
8 ms |
2652 KB |
Output is correct |
3 |
Correct |
8 ms |
2652 KB |
Output is correct |
4 |
Correct |
9 ms |
2652 KB |
Output is correct |
5 |
Correct |
8 ms |
2652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
2652 KB |
Output is correct |
2 |
Correct |
60 ms |
4700 KB |
Output is correct |
3 |
Correct |
31 ms |
4696 KB |
Output is correct |
4 |
Correct |
54 ms |
4696 KB |
Output is correct |
5 |
Correct |
33 ms |
4700 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
2700 KB |
Output is correct |
2 |
Correct |
77 ms |
6784 KB |
Output is correct |
3 |
Correct |
80 ms |
6792 KB |
Output is correct |
4 |
Correct |
76 ms |
6748 KB |
Output is correct |
5 |
Correct |
76 ms |
6748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
4700 KB |
Output is correct |
2 |
Correct |
123 ms |
6744 KB |
Output is correct |
3 |
Correct |
120 ms |
6780 KB |
Output is correct |
4 |
Correct |
110 ms |
6800 KB |
Output is correct |
5 |
Correct |
107 ms |
6744 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
73 ms |
6748 KB |
Output is correct |
2 |
Correct |
136 ms |
6776 KB |
Output is correct |
3 |
Correct |
156 ms |
6800 KB |
Output is correct |
4 |
Correct |
135 ms |
6748 KB |
Output is correct |
5 |
Correct |
139 ms |
7000 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
126 ms |
6792 KB |
Output is correct |
2 |
Correct |
201 ms |
8792 KB |
Output is correct |
3 |
Correct |
182 ms |
8796 KB |
Output is correct |
4 |
Correct |
177 ms |
8792 KB |
Output is correct |
5 |
Correct |
183 ms |
9044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
156 ms |
8836 KB |
Output is correct |
2 |
Correct |
215 ms |
8828 KB |
Output is correct |
3 |
Correct |
232 ms |
8792 KB |
Output is correct |
4 |
Correct |
212 ms |
8824 KB |
Output is correct |
5 |
Correct |
214 ms |
8844 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
199 ms |
8792 KB |
Output is correct |
2 |
Correct |
256 ms |
9048 KB |
Output is correct |
3 |
Correct |
234 ms |
8796 KB |
Output is correct |
4 |
Correct |
244 ms |
8832 KB |
Output is correct |
5 |
Correct |
274 ms |
9048 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
230 ms |
8792 KB |
Output is correct |
2 |
Correct |
279 ms |
8984 KB |
Output is correct |
3 |
Correct |
250 ms |
8796 KB |
Output is correct |
4 |
Correct |
266 ms |
8792 KB |
Output is correct |
5 |
Correct |
254 ms |
8980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
295 ms |
9052 KB |
Output is correct |
2 |
Correct |
285 ms |
9304 KB |
Output is correct |
3 |
Correct |
273 ms |
9288 KB |
Output is correct |
4 |
Correct |
311 ms |
9048 KB |
Output is correct |
5 |
Correct |
292 ms |
9052 KB |
Output is correct |