답안 #165812

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
165812 2019-11-29T07:53:38 Z ArKCa Karte (COCI15_karte) C++17
50 / 50
2 ms 376 KB
#include<bits/stdc++.h>
#define ll long long 
#define mod 1000000007
#define pb push_back
#define pob pop_back
#define N 10
using namespace std;

char c;
int a,a1,a2,a3,a4;
int b1[20],b2[20],b3[20],b4[20];

int main(){
	// freopen("a.gir","r",stdin);
	// freopen("a.cik","w",stdout);
	while(1){
		scanf("%c",&c);
		if(c=='\n')break;
		scanf("%d",&a);
		if(c=='P'){
			a1++;
			if(b1[a]==1){
				printf("GRESKA\n");
				return 0;
			}
			b1[a]=1;
		}
		else if(c=='K'){
			a2++;
			if(b2[a]==1){
				printf("GRESKA\n");
				return 0;
			}
			b2[a]=1;
		}
		else if(c=='H'){
			a3++;
			if(b3[a]==1){
				printf("GRESKA\n");
				return 0;
			}
			b3[a]=1;
		}
		else if(c=='T'){
			a4++;
			if(b4[a]==1){
				printf("GRESKA\n");
				return 0;
			}
			b4[a]=1;
		}
	}
	printf("%d %d %d %d\n",13-a1,13-a2,13-a3,13-a4);
}

Compilation message

karte.cpp: In function 'int main()':
karte.cpp:17:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%c",&c);
   ~~~~~^~~~~~~~~
karte.cpp:19:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&a);
   ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct