답안 #29342

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
29342 2017-07-19T03:03:22 Z 김현수(#1165) Party (POI11_imp) C++14
100 / 100
1569 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);
                      ^
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 37296 KB Output is correct
2 Correct 39 ms 37296 KB Output is correct
3 Correct 29 ms 37296 KB Output is correct
4 Correct 33 ms 37296 KB Output is correct
5 Correct 26 ms 37296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 37296 KB Output is correct
2 Correct 133 ms 37296 KB Output is correct
3 Correct 176 ms 37296 KB Output is correct
4 Correct 163 ms 37296 KB Output is correct
5 Correct 156 ms 37296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 49 ms 37296 KB Output is correct
2 Correct 353 ms 37296 KB Output is correct
3 Correct 306 ms 37296 KB Output is correct
4 Correct 369 ms 37296 KB Output is correct
5 Correct 399 ms 37296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 96 ms 37296 KB Output is correct
2 Correct 489 ms 37296 KB Output is correct
3 Correct 496 ms 37296 KB Output is correct
4 Correct 533 ms 37296 KB Output is correct
5 Correct 553 ms 37296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 299 ms 37296 KB Output is correct
2 Correct 626 ms 37296 KB Output is correct
3 Correct 709 ms 37296 KB Output is correct
4 Correct 626 ms 37296 KB Output is correct
5 Correct 626 ms 37296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 566 ms 37296 KB Output is correct
2 Correct 883 ms 37296 KB Output is correct
3 Correct 893 ms 37296 KB Output is correct
4 Correct 953 ms 37296 KB Output is correct
5 Correct 936 ms 37296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 789 ms 37296 KB Output is correct
2 Correct 1133 ms 37296 KB Output is correct
3 Correct 1043 ms 37296 KB Output is correct
4 Correct 1133 ms 37296 KB Output is correct
5 Correct 1106 ms 37296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1026 ms 37296 KB Output is correct
2 Correct 1346 ms 37296 KB Output is correct
3 Correct 1299 ms 37296 KB Output is correct
4 Correct 1236 ms 37296 KB Output is correct
5 Correct 1296 ms 37296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1136 ms 37296 KB Output is correct
2 Correct 1496 ms 37296 KB Output is correct
3 Correct 1569 ms 37296 KB Output is correct
4 Correct 1423 ms 37296 KB Output is correct
5 Correct 1433 ms 37296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1329 ms 37296 KB Output is correct
2 Correct 1519 ms 37296 KB Output is correct
3 Correct 1509 ms 37296 KB Output is correct
4 Correct 1493 ms 37296 KB Output is correct
5 Correct 1473 ms 37296 KB Output is correct