답안 #29350

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
29350 2017-07-19T03:27:24 Z suhgyuho_william Party (POI11_imp) C++14
100 / 100
1666 ms 37224 KB
#include <bits/stdc++.h>
#include <unistd.h>

#define pii pair<int,int>
#define pll pair<lld,lld>
#define pb push_back
#define next nextt
#define left leftt
#define right rightt
#define lld long long
#define Inf 1000000000
#define Mod 1000000007
#define Linf 1000000000000000000LL
#define get gett

int N,M;
int a[3002][3002];
bool check[3002];

int main(){
	scanf("%d %d",&N,&M);
	for(int i=1; i<=M; i++){
		int x,y;
		scanf("%d %d",&x,&y);
		a[x][y] = a[y][x] = 1;
	}
	memset(check,1,sizeof(check));
	for(int i=1; i<=N; i++){
		if(!check[i]) continue;
		for(int j=1; j<=N; j++){
			if(!check[j]) continue;
			if(a[i][j] == 0 && i != j){
				check[i] = check[j] = false;
				break;
			}
		}
	}
	int cnt = 0;
	for(int i=1; i<=N; i++) if(check[i]){
		printf("%d ",i);
		cnt++;
		if(cnt == N/3) return 0;
	}

	return 0;
}

Compilation message

imp.cpp: In function 'int main()':
imp.cpp:21:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&N,&M);
                      ^
imp.cpp:24:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d",&x,&y);
                       ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 37224 KB Output is correct
2 Correct 0 ms 37224 KB Output is correct
3 Correct 0 ms 37224 KB Output is correct
4 Correct 0 ms 37224 KB Output is correct
5 Correct 0 ms 37224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 37224 KB Output is correct
2 Correct 23 ms 37224 KB Output is correct
3 Correct 23 ms 37224 KB Output is correct
4 Correct 26 ms 37224 KB Output is correct
5 Correct 33 ms 37224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 37224 KB Output is correct
2 Correct 163 ms 37224 KB Output is correct
3 Correct 139 ms 37224 KB Output is correct
4 Correct 136 ms 37224 KB Output is correct
5 Correct 139 ms 37224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 37224 KB Output is correct
2 Correct 256 ms 37224 KB Output is correct
3 Correct 319 ms 37224 KB Output is correct
4 Correct 393 ms 37224 KB Output is correct
5 Correct 419 ms 37224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 109 ms 37224 KB Output is correct
2 Correct 533 ms 37224 KB Output is correct
3 Correct 536 ms 37224 KB Output is correct
4 Correct 603 ms 37224 KB Output is correct
5 Correct 426 ms 37224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 313 ms 37224 KB Output is correct
2 Correct 726 ms 37224 KB Output is correct
3 Correct 659 ms 37224 KB Output is correct
4 Correct 596 ms 37224 KB Output is correct
5 Correct 659 ms 37224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 569 ms 37224 KB Output is correct
2 Correct 973 ms 37224 KB Output is correct
3 Correct 903 ms 37224 KB Output is correct
4 Correct 883 ms 37224 KB Output is correct
5 Correct 936 ms 37224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 736 ms 37224 KB Output is correct
2 Correct 976 ms 37224 KB Output is correct
3 Correct 996 ms 37224 KB Output is correct
4 Correct 939 ms 37224 KB Output is correct
5 Correct 1026 ms 37224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 943 ms 37224 KB Output is correct
2 Correct 1349 ms 37224 KB Output is correct
3 Correct 1343 ms 37224 KB Output is correct
4 Correct 1313 ms 37224 KB Output is correct
5 Correct 1333 ms 37224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1166 ms 37224 KB Output is correct
2 Correct 1459 ms 37224 KB Output is correct
3 Correct 1463 ms 37224 KB Output is correct
4 Correct 1626 ms 37224 KB Output is correct
5 Correct 1616 ms 37224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1489 ms 37224 KB Output is correct
2 Correct 1649 ms 37224 KB Output is correct
3 Correct 1666 ms 37224 KB Output is correct
4 Correct 1543 ms 37224 KB Output is correct
5 Correct 1386 ms 37224 KB Output is correct