結果
問題 | No.24 数当てゲーム |
ユーザー |
![]() |
提出日時 | 2019-07-30 11:21:33 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 792 bytes |
コンパイル時間 | 177 ms |
コンパイル使用メモリ | 29,184 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-04 01:33:43 |
合計ジャッジ時間 | 671 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <stdio.h> int main(void){ int n; scanf( "%d", &n ); int i; int num[4]; int ans[10]; int yescount = 0; char temp[4]; for( i = 0; i <= 9; i++ ){ ans[i] = 0; } for( i = 0; i < n; i++ ){ scanf( "%d %d %d %d %s", &num[0], &num[1], &num[2], &num[3], temp ); if( temp[0] == 'N' ){ ans[num[0]] -= 10; ans[num[1]] -= 10; ans[num[2]] -= 10; ans[num[3]] -= 10; }else{ ans[num[0]] += 1; ans[num[1]] += 1; ans[num[2]] += 1; ans[num[3]] += 1; yescount++; } } for( i = 0; i <= 9; i++ ){ if( ans[i] >= yescount ){ printf( "%d\n", i ); return 0; } } }