Submission #29344

# Submission time Handle Problem Language Result Execution time Memory
29344 2017-07-19T03:05:27 Z khsoo01 Party (POI11_imp) C++11
100 / 100
1633 ms 37296 KB
#include<bits/stdc++.h>
using namespace std;
int n, m, adj[3005][3005];
bool d[3005];

int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++) {
		int A, B;
		scanf("%d%d",&A,&B);
		adj[A][B] = adj[B][A] = 1;
	}
	for(int i=1;i<=n;i++) {
		for(int j=i+1;j<=n;j++) {
			if(adj[i][j]) continue;
			if(!d[i] && !d[j]) d[i] = d[j] = true;
		}
	}
	int c = 0;
	for(int i=1;i<=n && c < n/3;i++) {
		if(!d[i]) {printf("%d ",i); c++;}
	}
	puts("");
}

Compilation message

imp.cpp: In function 'int main()':
imp.cpp:8:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&n,&m);
                     ^
imp.cpp:11:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d",&A,&B);
                      ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 37296 KB Output is correct
2 Correct 0 ms 37296 KB Output is correct
3 Correct 0 ms 37296 KB Output is correct
4 Correct 0 ms 37296 KB Output is correct
5 Correct 0 ms 37296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 37296 KB Output is correct
2 Correct 23 ms 37296 KB Output is correct
3 Correct 23 ms 37296 KB Output is correct
4 Correct 33 ms 37296 KB Output is correct
5 Correct 26 ms 37296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 37296 KB Output is correct
2 Correct 146 ms 37296 KB Output is correct
3 Correct 189 ms 37296 KB Output is correct
4 Correct 166 ms 37296 KB Output is correct
5 Correct 139 ms 37296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 39 ms 37296 KB Output is correct
2 Correct 339 ms 37296 KB Output is correct
3 Correct 369 ms 37296 KB Output is correct
4 Correct 333 ms 37296 KB Output is correct
5 Correct 369 ms 37296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 116 ms 37296 KB Output is correct
2 Correct 463 ms 37296 KB Output is correct
3 Correct 393 ms 37296 KB Output is correct
4 Correct 499 ms 37296 KB Output is correct
5 Correct 563 ms 37296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 366 ms 37296 KB Output is correct
2 Correct 623 ms 37296 KB Output is correct
3 Correct 706 ms 37296 KB Output is correct
4 Correct 706 ms 37296 KB Output is correct
5 Correct 593 ms 37296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 473 ms 37296 KB Output is correct
2 Correct 809 ms 37296 KB Output is correct
3 Correct 816 ms 37296 KB Output is correct
4 Correct 879 ms 37296 KB Output is correct
5 Correct 863 ms 37296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 749 ms 37296 KB Output is correct
2 Correct 1146 ms 37296 KB Output is correct
3 Correct 1049 ms 37296 KB Output is correct
4 Correct 1012 ms 37296 KB Output is correct
5 Correct 916 ms 37296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 973 ms 37296 KB Output is correct
2 Correct 1186 ms 37296 KB Output is correct
3 Correct 1109 ms 37296 KB Output is correct
4 Correct 1086 ms 37296 KB Output is correct
5 Correct 1233 ms 37296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1022 ms 37296 KB Output is correct
2 Correct 1413 ms 37296 KB Output is correct
3 Correct 1243 ms 37296 KB Output is correct
4 Correct 1309 ms 37296 KB Output is correct
5 Correct 1463 ms 37296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1386 ms 37296 KB Output is correct
2 Correct 1559 ms 37296 KB Output is correct
3 Correct 1383 ms 37296 KB Output is correct
4 Correct 1633 ms 37296 KB Output is correct
5 Correct 1626 ms 37296 KB Output is correct