結果
問題 | No.43 野球の試合 |
ユーザー |
![]() |
提出日時 | 2017-07-29 13:03:20 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 37 ms / 5,000 ms |
コード長 | 873 bytes |
コンパイル時間 | 3,194 ms |
コンパイル使用メモリ | 65,200 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 01:53:06 |
合計ジャッジ時間 | 3,919 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 7 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
import sequtils,strutilsvarN = stdin.readline.parseInthyou = newSeq[string](N)cnt : intans = 1000proc zyuni(X : openarray[string]):int=var x = X[0].count("o")var s : set[int8]for i,y in X:if i == 0:continueif y.count("o") > x:s.incl(y.count("o").int8)return s.card + 1for n in 0..<N:hyou[n] = stdin.readlinecnt += hyou[n].count("-")cnt = cnt div 2for i in 0..<(1 shl cnt):var j = ivar hyou2 = hyoufor y,h in hyou2:for x,w in h:if w == '-':if j mod 2 == 1:hyou2[y][x] = 'o'hyou2[x][y] = 'x'else:hyou2[y][x] = 'x'hyou2[x][y] = 'o'j = j shr 1ans = min(ans,zyuni(hyou2))echo ans