結果
問題 | No.24 数当てゲーム |
ユーザー |
![]() |
提出日時 | 2017-05-03 00:12:55 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 528 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 23,424 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 04:48:59 |
合計ジャッジ時間 | 670 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:15:47: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | for(j=0;j<4;j++) scanf("%d", &a[j]); | ~~~~~^~~~~~~~~~~~~ main.cpp:16:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf("%s", ans); | ~~~~~^~~~~~~~~~~
ソースコード
#include<cstdio>int main(void){int n, a[4], f[10], i, j, k;char ans[10];while(scanf("%d", &n)==1){for(i=0;i<10;i++) f[i]=0;for(i=0;i<n;i++){for(j=0;j<4;j++) scanf("%d", &a[j]);scanf("%s", ans);if(ans[0]=='N'){for(j=0;j<4;j++) f[a[j]]=1;}else{for(k=0;k<=9;k++){for(j=0;j<4;j++){if(k==a[j]) break;}if(j>=4) f[k]=1;}}}for(i=0;i<=9;i++){if(!f[i]){printf("%d\n", i);break;}}}return 0;}