結果
問題 |
No.2148 ひとりUNO
|
ユーザー |
![]() |
提出日時 | 2022-12-05 00:29:29 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 926 bytes |
コンパイル時間 | 435 ms |
コンパイル使用メモリ | 30,592 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 00:34:36 |
合計ジャッジ時間 | 1,874 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 WA * 26 |
ソースコード
#include <stdio.h> int main () { int t = 0; int n = 0; char c[2] = ""; int d = 0; int res = 0; int flag[200000] = {}; char cmap[3] = { 'B', 'G', 'R' }; res = scanf("%d", &t); while (t > 0) { int cnt[8] = {}; int b = 0; res = scanf("%d", &n); for (int i = 0; i < n; i++) { flag[i] = 0; } for (int i = 0; i < n; i++) { res = scanf("%s", c); res = scanf("%d", &d); d--; for (int j = 0; j < 3; j++) { if (c[0] == cmap[j]) { flag[d] |= (1<<j); b |= (1<<j); } } } for (int i = 0; i < n; i++) { cnt[flag[i]]++; } if ((b == 7 && ((cnt[7] > 0 && (cnt[3] > 0 || cnt[5] > 0 || cnt[6] > 0)) || (cnt[3] > 0 && (cnt[5] > 0 || cnt[6] > 0)) || (cnt[5] > 0 && cnt[6] > 0))) || (b != 7 && cnt[b] > 0)) { printf("YES\n"); } else { printf("NO\n"); } t--; } return 0; }