結果
問題 | No.133 カードゲーム |
ユーザー |
|
提出日時 | 2019-12-13 00:14:50 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 724 bytes |
コンパイル時間 | 4,575 ms |
コンパイル使用メモリ | 66,332 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 00:30:02 |
合計ジャッジ時間 | 5,537 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
import strutils, sequtils, algorithmlet N = stdin.readline.parseIntvarA = stdin.readLine.split.map(parseInt).sorted()B = stdin.readLine.split.map(parseInt).sorted()aPerm = newSeq[seq[int]]()bPerm = newSeq[seq[int]]()cnt = 0general_aWin = 0while true:aPerm.add(A)if A.nextPermutation() == false: breakwhile true:bPerm.add(B)if B.nextPermutation() == false: breakfor a in aPerm:for b in bPerm:inc cntvaraWin = 0bWin = 0for i in 0..<N:if a[i] > b[i]:inc aWinelse:inc bWinif aWin > bWin:inc general_aWinecho general_aWin/cnt