結果
問題 | No.2714 Amaou |
ユーザー |
![]() |
提出日時 | 2025-03-19 09:54:23 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 766 bytes |
コンパイル時間 | 545 ms |
コンパイル使用メモリ | 25,728 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-19 09:54:25 |
合計ジャッジ時間 | 1,780 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d",&n); | ^~~~~~~~~~~~~~ main.c:13:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%s",comment); | ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>#include <string.h>void main(void){const char goodComment[4][100] = {"akai","marui","okii","umai"};int n = 0;scanf("%d",&n);char comment[100] = "a";int amaouCount = 0;for(int i = 0 ; i < n ; i++){int commentCount[4] = {0,0,0,0};for(int j = 0 ; j < 4 ; j++){scanf("%s",comment);if(strcmp(comment,goodComment[0]) == 0){commentCount[0]++;}else if(strcmp(comment,goodComment[1]) == 0){commentCount[1]++;}else if(strcmp(comment,goodComment[2]) == 0){commentCount[2]++;}else if(strcmp(comment,goodComment[3]) == 0){commentCount[3]++;}}for(int i = 0 ; i < 4;i++){if(commentCount[i] != 1){break;}if(i == 3){amaouCount++;}}}printf("%d",amaouCount);}