結果

問題 No.280 歯車の問題(1)
ユーザー Haar
提出日時 2016-04-23 14:56:45
言語 Haskell
(9.10.1)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 243 bytes
コンパイル時間 2,385 ms
コンパイル使用メモリ 172,416 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-04 15:19:56
合計ジャッジ時間 4,477 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )

Main.hs:8:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in two further locations.
    Suggested fix: Please use spaces instead.
  |
8 |         getLine
  | ^^^^^^^^
[2 of 2] Linking a.out

ソースコード

diff #

import Data.Ratio

f :: [Integer] -> [Ratio Integer]
f (x:y:[]) = [y % x]
f (x:y:xs) = y % x : f (y:xs)

main = do
	getLine
	z <- return . product . f . map read . words =<< getLine
	putStrLn $ show (numerator z) ++ "/" ++ show (denominator z)
0