답안 #66353

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
66353 2018-08-10T10:09:08 Z KLPP Baza (COCI17_baza) C++14
50 / 50
144 ms 32972 KB
#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
#include<stdio.h>

using namespace std;
int n,m;
int arr[10000][10000];
int main(){
	scanf("%d %d",&n,&m);
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++)scanf("%d",&arr[i][j]);
	}
	int q;
	scanf("%d",&q);
	while(q--){
		bool b[n];
		for(int i=0;i<n;i++)b[i]=true;
		for(int j=0;j<m;j++){
			int x;
			scanf("%d",&x);
			if(x!=-1){
				for(int i=0;i<n;i++){
					if(arr[i][j]!=x)b[i]=false;
				}
			}
		}
		int ans=0;
		for(int i=0;i<n;i++)ans+=b[i];
		printf("%d\n",ans);
	}

	return 0;
}

Compilation message

baza.cpp: In function 'int main()':
baza.cpp:11:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&n,&m);
  ~~~~~^~~~~~~~~~~~~~~
baza.cpp:13:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   for(int j=0;j<m;j++)scanf("%d",&arr[i][j]);
                       ~~~~~^~~~~~~~~~~~~~~~~
baza.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&q);
  ~~~~~^~~~~~~~~
baza.cpp:22:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&x);
    ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 3704 KB Output is correct
2 Correct 47 ms 4988 KB Output is correct
3 Correct 101 ms 11960 KB Output is correct
4 Correct 22 ms 11960 KB Output is correct
5 Correct 62 ms 12232 KB Output is correct
6 Correct 101 ms 17704 KB Output is correct
7 Correct 144 ms 24440 KB Output is correct
8 Correct 86 ms 24836 KB Output is correct
9 Correct 55 ms 27080 KB Output is correct
10 Correct 137 ms 32972 KB Output is correct