Submission #68964

# Submission time Handle Problem Language Result Execution time Memory
68964 2018-08-19T11:27:35 Z 검수컵(#1978, imsifile) Chocolate Cookie Machine (FXCUP3_chocolate) C++
28 / 100
138 ms 8652 KB
#include<stdio.h>
#include<vector>
using namespace std;

int N, M, K, E, tab[1010][1010], chk[1010];
vector<int> dap;

int main(){
	scanf("%d%d%d", &N, &M, &K);
	for(int i=0; i<M; i++){
		int a; scanf("%d", &a);
		for(int j=1; j<=N; j++) tab[j][a]=tab[a][j]=1;
	}
	for(int i=0; i<K; i++){
		int a, b; scanf("%d%d", &a, &b);
		tab[a][b]=tab[b][a]=1;
	}
	for(scanf("%d", &E); E--;){
		int a; char st[6];
		scanf("\nL + %d = %s", &a, &st);
		if(st[0]=='O'){
			for(int i=1; i<=N; i++){
				if(tab[i][a]) chk[i]=1;
			}
		}
		else{
			for(int i=1; i<=N; i++){
				if(!tab[i][a]) chk[i]=1;
			}
		}
	}
	for(int i=1; i<=N; i++){
		if(!chk[i]) dap.push_back(i);
	}
	printf("%d\n", dap.size());
	for(int i=0; i<dap.size(); i++) printf("%d ", dap[i]);
	return 0;
}

Compilation message

chocolate.cpp: In function 'int main()':
chocolate.cpp:20:33: warning: format '%s' expects argument of type 'char*', but argument 3 has type 'char (*)[6]' [-Wformat=]
   scanf("\nL + %d = %s", &a, &st);
                              ~~~^
chocolate.cpp:35:27: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::vector<int>::size_type {aka long unsigned int}' [-Wformat=]
  printf("%d\n", dap.size());
                 ~~~~~~~~~~^
chocolate.cpp:36:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0; i<dap.size(); i++) printf("%d ", dap[i]);
               ~^~~~~~~~~~~
chocolate.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d%d", &N, &M, &K);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~
chocolate.cpp:11:15: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   int a; scanf("%d", &a);
          ~~~~~^~~~~~~~~~
chocolate.cpp:15:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   int a, b; scanf("%d%d", &a, &b);
             ~~~~~^~~~~~~~~~~~~~~~
chocolate.cpp:18:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(scanf("%d", &E); E--;){
      ~~~~~^~~~~~~~~~
chocolate.cpp:20:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("\nL + %d = %s", &a, &st);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 3 ms 248 KB Output is correct
2 Correct 2 ms 612 KB Output is correct
3 Correct 11 ms 3864 KB Output is correct
4 Correct 138 ms 4532 KB Output is correct
5 Correct 18 ms 4532 KB Output is correct
6 Correct 11 ms 4532 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 11 ms 8652 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 248 KB Output is correct
2 Correct 2 ms 612 KB Output is correct
3 Correct 11 ms 3864 KB Output is correct
4 Correct 138 ms 4532 KB Output is correct
5 Correct 18 ms 4532 KB Output is correct
6 Correct 11 ms 4532 KB Output is correct
7 Runtime error 11 ms 8652 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Halted 0 ms 0 KB -