結果
問題 | No.582 キャンディー・ボックス3 |
ユーザー | 6soukiti29 |
提出日時 | 2017-10-27 23:03:14 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 468 bytes |
コンパイル時間 | 3,197 ms |
コンパイル使用メモリ | 65,352 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 03:19:40 |
合計ジャッジ時間 | 3,996 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
import sequtils,strutils var N = stdin.readline.parseInt C = stdin.readline.split.map(parseInt) cnt1 = 0 cnt2 = 0 flag : bool for n in 0..<N: if C[n] == 0: continue cnt1 = 0 cnt2 = 0 C[n] -= 1 for c in C: if c == 1: cnt1 += 1 if c >= 2: cnt2 += 1 if cnt2 == 0 and cnt1 mod 2 == 0: flag = true C[n] += 1 if flag: echo "A" else: echo "B"