Submission #120401

# Submission time Handle Problem Language Result Execution time Memory
120401 2019-06-24T11:21:56 Z popovicirobert Party (POI11_imp) C++14
100 / 100
735 ms 33528 KB
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define lsb(x) (x & (-x)) 

using namespace std;

const int MAXN = 3000;

bitset < 3005 > edge[MAXN + 1];
bool vis[MAXN + 1];

int main() {
	//ifstream cin("A.in");
	//ofstream cout("A.out");
	int i, j, n, m;
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	
	cin >> n >> m;

	for(i = 1; i <= m; i++) {
		int x, y;
		cin >> x >> y;
		edge[x][y] = edge[y][x] = 1;
	}

	for(i = 1; i <= n; i++) {
		if(vis[i]) continue;

		for(j = 1; j <= n; j++) {
			if(i != j && edge[i][j] == 0 && vis[j] == 0) {
				vis[i] = vis[j] = 1;
				break;
			}
		}
	}

	int cnt = 0;
	for(i = 1; i <= n; i++) {
		if(vis[i] == 0) {
			cnt++;
			if(cnt <= n / 3) {
				cout << i << " ";
			}
		}
	}

	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 512 KB Output is correct
2 Correct 16 ms 1280 KB Output is correct
3 Correct 16 ms 1280 KB Output is correct
4 Correct 16 ms 1280 KB Output is correct
5 Correct 16 ms 1280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 948 KB Output is correct
2 Correct 62 ms 3756 KB Output is correct
3 Correct 59 ms 3740 KB Output is correct
4 Correct 56 ms 3688 KB Output is correct
5 Correct 57 ms 3628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 1536 KB Output is correct
2 Correct 144 ms 8248 KB Output is correct
3 Correct 147 ms 8184 KB Output is correct
4 Correct 140 ms 8184 KB Output is correct
5 Correct 142 ms 8312 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 2816 KB Output is correct
2 Correct 204 ms 12040 KB Output is correct
3 Correct 204 ms 11640 KB Output is correct
4 Correct 216 ms 11912 KB Output is correct
5 Correct 216 ms 11912 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 130 ms 7432 KB Output is correct
2 Correct 274 ms 14756 KB Output is correct
3 Correct 264 ms 14600 KB Output is correct
4 Correct 255 ms 14856 KB Output is correct
5 Correct 276 ms 14584 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 248 ms 13196 KB Output is correct
2 Correct 521 ms 19608 KB Output is correct
3 Correct 404 ms 19436 KB Output is correct
4 Correct 381 ms 19320 KB Output is correct
5 Correct 387 ms 19340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 324 ms 17488 KB Output is correct
2 Correct 436 ms 23304 KB Output is correct
3 Correct 420 ms 22776 KB Output is correct
4 Correct 439 ms 23032 KB Output is correct
5 Correct 480 ms 22904 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 401 ms 20344 KB Output is correct
2 Correct 536 ms 27288 KB Output is correct
3 Correct 545 ms 26744 KB Output is correct
4 Correct 557 ms 26904 KB Output is correct
5 Correct 534 ms 26872 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 430 ms 23936 KB Output is correct
2 Correct 567 ms 31368 KB Output is correct
3 Correct 638 ms 30728 KB Output is correct
4 Correct 576 ms 30872 KB Output is correct
5 Correct 552 ms 30856 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 615 ms 29560 KB Output is correct
2 Correct 612 ms 33528 KB Output is correct
3 Correct 627 ms 32888 KB Output is correct
4 Correct 702 ms 33280 KB Output is correct
5 Correct 735 ms 33272 KB Output is correct