Submission #29348

# Submission time Handle Problem Language Result Execution time Memory
29348 2017-07-19T03:25:41 Z suhgyuho_william Party (POI11_imp) C++14
9 / 100
1629 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;
			}
		}
	}
	for(int i=1; i<=N; i++) if(check[i]) printf("%d ",i);

	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);
                       ^
# Verdict Execution time Memory 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
# Verdict Execution time Memory Grader output
1 Correct 3 ms 37224 KB Output is correct
2 Incorrect 13 ms 37224 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 16 ms 37224 KB Output is correct
2 Incorrect 133 ms 37224 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 46 ms 37224 KB Output is correct
2 Incorrect 376 ms 37224 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 113 ms 37224 KB Output is correct
2 Incorrect 559 ms 37224 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 339 ms 37224 KB Output is correct
2 Incorrect 723 ms 37224 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 616 ms 37224 KB Output is correct
2 Incorrect 846 ms 37224 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 773 ms 37224 KB Output is correct
2 Incorrect 1043 ms 37224 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 866 ms 37224 KB Output is correct
2 Incorrect 1279 ms 37224 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1113 ms 37224 KB Output is correct
2 Incorrect 1503 ms 37224 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1439 ms 37224 KB Output is correct
2 Incorrect 1629 ms 37224 KB Wypisano za du¿o osób
3 Halted 0 ms 0 KB -