Submission #168232

# Submission time Handle Problem Language Result Execution time Memory
168232 2019-12-12T04:23:11 Z Thuleanx Party (POI11_imp) C++14
0 / 100
692 ms 29552 KB
#include <bits/stdc++.h>
using namespace std;

const int N = 3000;

int n, m;
bitset<N> adj[N];
bool in[N];

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	cin>>n>>m;
	memset(in, 1, sizeof(in));
	for (int i = 0; i < m; i++) {
		int a, b; cin>>a>>b;
		adj[--a].set(--b);
		adj[b].set(a);
	}
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			if (i != j && adj[i][j] == 0 && in[i] && in[j])
				in[i] = in[j] = 0;
	stringstream ss;
	for (int i = 0, cnt = 0; i < n; i++) {
		if (in[i]) {
			ss << i << " ";
			if (++cnt == n/3)
				break;
		}
	}
	cout << ss.str() << endl;

	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 504 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 888 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 1528 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 55 ms 2772 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 163 ms 7488 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 299 ms 13204 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 388 ms 17144 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 461 ms 20452 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 542 ms 24056 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 692 ms 29552 KB Nie wszystkie wypisane osoby siê znaja
2 Halted 0 ms 0 KB -