結果

問題 No.43 野球の試合
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-05-01 08:29:02
言語 Nim
(2.0.2)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 887 bytes
コンパイル時間 3,757 ms
コンパイル使用メモリ 68,688 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-11 11:13:30
合計ジャッジ時間 4,585 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 20 ms
4,380 KB
testcase_08 AC 1 ms
4,384 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(32, 17) Warning: Deprecated since v0.20, use 'initHashSet'; initSet is deprecated [Deprecated]
/home/judge/data/code/Main.nim(1, 28) Warning: imported and not used: 'math' [UnusedImport]
/home/judge/data/code/Main.nim(1, 18) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import strutils, sequtils, math, sets

var
    fumei = 0
    n = stdin.readLine.parseInt
    strs = newSeq[string](n)

for i in 0..n-1:
    strs[i] = stdin.readLine

for i in 0..n-1:
    for j in i+1..n-1:
        if strs[i][j] == '-':
            fumei += 1

var lag = 19970121 # for lágmark>(ΦωΦ)
for m in 0..(1 shl fumei)-1:
    var score = newSeq[int](n)
    for i in 0..n-1:
        for j in 0..n-1:
            if strs[i][j] == 'o':
                score[i] += 1
    var p = 0
    for i in 0..n-1:
        for j in i+1..n-1:
            if strs[i][j] == '-':
                if (((m shr p) and 1) == 1):
                    score[i] += 1
                else:
                    score[j] += 1
                p += 1
    var upper = initSet[int]()
    for i in 0..n-1:
        if score[0] < score[i]:
            upper.incl(score[i])
    lag = min(lag, upper.len+1)

lag.echo
0