# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
987024 |
2024-05-21T17:34:50 Z |
vjudge1 |
Party (POI11_imp) |
C++17 |
|
853 ms |
65536 KB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = long double; // or double, if TL is tight
using str = string; // yay python!
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<db,db>;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = vector<db>;
using vs = vector<str>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvpi = vector<vpi>;
// pairs
#define mp make_pair
#define f first
#define s second
// vectors
#define sz(x) int((x).size())
#define bg(x) begin(x)
#define all(x) bg(x), end(x)
#define rall(x) x.rbegin(), x.rend()
#define sor(x) sort(all(x))
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pb push_back
#define eb emplace_back
#define pf push_front
#define er erase
#define ub upper_bound
#define lb lower_bound
// loops
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)
const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5;
const ll INF = 1e18; // not too close to LLONG_MAX
const db PI = acos((db)-1);
const int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1}; // for every grid problem!!=
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ook order_of_key
#define fbo find_by_order
void solve(){
int n, m;
cin >> n >> m;
vvi l(n + 1, vi(n + 1));
vb deleted(n + 1);
F0R(i, m){
int u, v;
cin >> u >> v;
l[u][v] = 1;
l[v][u] = 1;
}
FOR(i, 1, n + 1){
FOR(j, i + 1, n + 1){
if(deleted[i] || deleted[j])continue;
if(!l[i][j]){
deleted[i] = 1;
deleted[j] = 1;
}
}
}
int cnt = 0;
for(int i = 1; i <= n && cnt < n / 3; i++){
if(!deleted[i]){
cout << i << " ";
cnt++;
}
}
}
int main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int t; t = 1;while(t--){
solve();
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
456 KB |
Output is correct |
3 |
Correct |
1 ms |
348 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 |
2076 KB |
Output is correct |
3 |
Correct |
10 ms |
2136 KB |
Output is correct |
4 |
Correct |
10 ms |
2136 KB |
Output is correct |
5 |
Correct |
10 ms |
2084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
1348 KB |
Output is correct |
2 |
Correct |
45 ms |
7248 KB |
Output is correct |
3 |
Correct |
40 ms |
7252 KB |
Output is correct |
4 |
Correct |
40 ms |
7252 KB |
Output is correct |
5 |
Correct |
41 ms |
7256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
2648 KB |
Output is correct |
2 |
Correct |
107 ms |
16592 KB |
Output is correct |
3 |
Correct |
128 ms |
16476 KB |
Output is correct |
4 |
Correct |
119 ms |
16604 KB |
Output is correct |
5 |
Correct |
122 ms |
16464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
5724 KB |
Output is correct |
2 |
Correct |
220 ms |
23932 KB |
Output is correct |
3 |
Correct |
181 ms |
23636 KB |
Output is correct |
4 |
Correct |
187 ms |
23828 KB |
Output is correct |
5 |
Correct |
202 ms |
23996 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
92 ms |
15712 KB |
Output is correct |
2 |
Correct |
316 ms |
29732 KB |
Output is correct |
3 |
Correct |
293 ms |
29472 KB |
Output is correct |
4 |
Correct |
312 ms |
29488 KB |
Output is correct |
5 |
Correct |
352 ms |
29780 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
248 ms |
28232 KB |
Output is correct |
2 |
Correct |
476 ms |
39432 KB |
Output is correct |
3 |
Correct |
485 ms |
39044 KB |
Output is correct |
4 |
Correct |
513 ms |
39132 KB |
Output is correct |
5 |
Correct |
514 ms |
39284 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
423 ms |
37228 KB |
Output is correct |
2 |
Correct |
616 ms |
46632 KB |
Output is correct |
3 |
Correct |
618 ms |
46236 KB |
Output is correct |
4 |
Correct |
651 ms |
46556 KB |
Output is correct |
5 |
Correct |
621 ms |
46540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
541 ms |
43984 KB |
Output is correct |
2 |
Correct |
701 ms |
54560 KB |
Output is correct |
3 |
Correct |
763 ms |
54352 KB |
Output is correct |
4 |
Correct |
747 ms |
54360 KB |
Output is correct |
5 |
Correct |
706 ms |
54424 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
657 ms |
51580 KB |
Output is correct |
2 |
Correct |
853 ms |
63192 KB |
Output is correct |
3 |
Correct |
751 ms |
62568 KB |
Output is correct |
4 |
Correct |
800 ms |
62908 KB |
Output is correct |
5 |
Correct |
756 ms |
63060 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
758 ms |
63716 KB |
Output is correct |
2 |
Correct |
804 ms |
65536 KB |
Output is correct |
3 |
Correct |
783 ms |
65536 KB |
Output is correct |
4 |
Correct |
784 ms |
65536 KB |
Output is correct |
5 |
Correct |
844 ms |
65536 KB |
Output is correct |