結果
| 問題 | No.707 書道 |
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2018-12-09 16:49:12 |
| 言語 | Haskell (9.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 643 bytes |
| 記録 | |
| コンパイル時間 | 4,145 ms |
| コンパイル使用メモリ | 196,096 KB |
| 実行使用メモリ | 6,784 KB |
| 最終ジャッジ日時 | 2026-04-05 14:04:19 |
| 合計ジャッジ時間 | 2,344 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 3 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Data.List
import Text.Printf
g::Double->Double->String->[(Double,Double)]
g _ _ ""=[]
g h w ('0':xs)= g h (w+1) xs
g h w (_:xs) =(h,w):(g h (w+1) xs)
f::Double->[String]->[(Double,Double)]
f _ []=[]
f h (x:xs)=(g h 1 x) ++ (f (h+1) xs)
f2::Double->Double->(Double,Double)->Double
f2 h w (y,x)=sqrt((y-h)*(y-h)+(x-w)*(x-w))
main = do
e<-getLine
es<-getContents
let ts=lines es
ds=f 1 ts
(h:w:[])=map read (words e)::[Int]
anss=[sum(map (f2 (fromIntegral y::Double) (fromIntegral(x)::Double)) ds)|y<-[0..h],x<-[0..w],y==0||y==h+1||x==0||x==w+1]
printf "%.7f" $ minimum anss
horiesiniti