結果
| 問題 |
No.43 野球の試合
|
| コンテスト | |
| ユーザー |
guricerin
|
| 提出日時 | 2020-02-06 12:49:23 |
| 言語 | F# (F# 4.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 4,250 bytes |
| コンパイル時間 | 14,768 ms |
| コンパイル使用メモリ | 189,940 KB |
| 実行使用メモリ | 30,208 KB |
| 最終ジャッジ日時 | 2024-09-25 06:43:53 |
| 合計ジャッジ時間 | 16,301 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 4 WA * 3 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (369 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
open System
open System.Collections.Generic
#nowarn "37"
[<AutoOpen>]
module Cin =
let read f = stdin.ReadLine() |> f
let reada f = stdin.ReadLine().Split() |> Array.map f
let readChars() = read string |> Seq.toArray
let readInts() = readChars() |> Array.map (fun x -> Convert.ToInt32(x.ToString()))
[<AutoOpen>]
module Cout =
let writer = new IO.StreamWriter(new IO.BufferedStream(Console.OpenStandardOutput()))
let print (s: string) = writer.Write s
let println (s: string) = writer.WriteLine s
let inline puts (s: ^a) = string s |> println
// / ` 、 感謝するぜ お前と出会えた
// / ノノ ヽ
// , ニニ彡'⌒ /`ヽ これまでの 全てに
// ' ニミ ニニ彡 〈rう├--ミ
// { { ニミ } j j jノx'ィイく }し{\ `丶、___/ニニニ
// j_ニニミV ハレノ x<⌒ヽ V ヘ \ \ニニニニニニニ
// {xミミー'ヾ(、ル( 厶tァァく⌒ヾ} )ハ::::::. \ニニニニニニ
// 彡ィ'">tァ} \(`ニ彡 ノ` /ト=く ::::::i \ニニニニニニ
// ( V^`こ7 _, \``ヾヽ` ノ|`ヽ ヽ l:::::| \ニニニニニ
// ∧ { ' ` ノ^ヽ { ノ !:::::| ___ノ^ヽニニニニニニ
// /.::::\ゝヽ. _ノヽ``ヽ, -――- 、 /:::::/ /  ̄`ヽニニニニニ
// /.::::::::::::::::>'"ノルハヽ`/ -―- 、⌒V::::::/.// j___ノ、 ヽニニニニニ
// /ニニ、`ヽ`ヾヘ{ {、ムイ 、_( > \/ (__ ノニニニ \ニニニニ
// ,仁ニニニ\ヽヽヽ ∨ /ニニ>彡>--')__ ノ `ヽニ \ニニニ二
// ニニニニニニヽ / {ニニ> ´ `¨¨´ ニ} \>''"´
// ニニニニニニニニ/ ∨ / }八
// ニニニニニニニ./ }ニ{ ノニヽ ノ
// ニニニニニニニ/ }ニハ /⌒ヽヽヽ ___彡
// ニニニニニニニ! ノニニヽ、 / ` ー=彡'ニニニニニ
// ニニニニニニニ} ⌒`丶、 /⌒ヽ ノ ノ_____
// / ̄ ̄ ̄`ヽ/ヽ、 _彡ヘ{ { > 、 / /  ̄ ̄ ̄
// ) 、 / ヾ、 ヽ ヽ ( `{ /
// // ⌒ヽ / 〃 トミ ___ >--‐=、 ヽ _ノ
// { / // / \__ノ
// -----------------------------------------------------------------------------------------------------
let main() =
let n = read int
let table = Array2D.init n n (fun _ _ -> '.')
for i in 0 .. n - 1 do
let s = read string
for j in 0 .. Seq.length s - 1 do
table.[i, j] <- s.[j]
for i in 0 .. n - 1 do
if table.[0, i] = '-' then
table.[0, i] <- 'o'
table.[i, 0] <- 'x'
let wins = Array.zeroCreate n
for i in 0 .. n - 1 do
let s = table.[i, *] |> fun c -> String(c)
let w = s.Length - s.Replace("o", "").Length
wins.[i] <- w
let wins =
wins
|> Array.indexed
|> Array.sortBy (fun (i, x) -> -x)
// for i, v in wins do
// sprintf "i:%d, v:%d" i v |> puts
for i in 0 .. n - 1 do
let a, b = wins.[i]
if a = 0 then puts (i + 1)
// -----------------------------------------------------------------------------------------------------
main()
writer.Dispose()
guricerin