結果

問題 No.750 Frac #1
ユーザー horiesiniti
提出日時 2018-12-08 19:15:53
言語 Haskell
(9.10.1)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 347 bytes
コンパイル時間 5,475 ms
コンパイル使用メモリ 172,032 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 06:16:39
合計ジャッジ時間 6,778 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.List

f ::[Int]->(Double,Int,Int)
f (x:y:[])=((fromIntegral(x)::Double)/(fromIntegral(y)::Double),x,y)
f2 ::(Double,Int,Int)->String
f2 (_,a,b)=show a++" "++show b

main = do
       e<-getLine
       es<-getContents
       let xs=map (map read) (map words (lines es))::[[Int]]
       mapM_ putStrLn $ map f2 $ reverse $ sort $ map f xs
0