結果

問題 No.136 Yet Another GCD Problem
ユーザー tottoripaper
提出日時 2015-02-21 22:56:13
言語 Haskell
(9.10.1)
結果
AC  
実行時間 10 ms / 5,000 ms
コード長 195 bytes
コンパイル時間 7,737 ms
コンパイル使用メモリ 174,592 KB
実行使用メモリ 8,320 KB
最終ジャッジ日時 2024-06-23 21:45:55
合計ジャッジ時間 3,814 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 Control.Monad

main = do
  [n, k] <- liftM (map read . words) getLine
  let f x
       | n `mod` x == 0 = x
       | otherwise = 1
      res = maximum . map f $ [1..(n-1)]
   in print res
0