답안 #202641

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
202641 2020-02-17T13:09:37 Z uyk0329 Marko (COCI15_marko) C++14
15 / 50
10 ms 888 KB
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char arr[1000007], imsi[1000007];
int brr[1000007], crr[30] = {2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9};
int main () {
	
	int t, len, ans = 0, k;
	
	scanf("%d",&t);
	
	for (int i = 0; i < t; i++) {
		scanf(" %s",arr);
		len = strlen(arr);
		for (int j = 0; j < len; j++) {
			imsi[j] = crr[arr[j] - 97] + 48;
		}
		brr[i] = atoi(imsi);
		for (int j = 0; j < len; j++) imsi[j] = 0;
	}

	scanf("%d",&k);
	
	for (int i = 0; i < t; i++) {
		if (brr[i] == k) ans++;
	}
	
	printf("%d",ans);

	return 0;
}

Compilation message

marko.cpp: In function 'int main()':
marko.cpp:10:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&t);
  ~~~~~^~~~~~~~~
marko.cpp:13:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf(" %s",arr);
   ~~~~~^~~~~~~~~~~
marko.cpp:22:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&k);
  ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Incorrect 9 ms 888 KB Output isn't correct
5 Incorrect 5 ms 376 KB Output isn't correct
6 Incorrect 5 ms 376 KB Output isn't correct
7 Incorrect 7 ms 632 KB Output isn't correct
8 Incorrect 10 ms 888 KB Output isn't correct
9 Incorrect 5 ms 376 KB Output isn't correct
10 Incorrect 8 ms 632 KB Output isn't correct