結果
| 問題 | No.316 もっと刺激的なFizzBuzzをください |
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2017-01-12 23:54:28 |
| 言語 | Haskell (9.14.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 2 ms / 1,000 ms |
| + 225µs | |
| コード長 | 416 bytes |
| 記録 | |
| コンパイル時間 | 5,997 ms |
| コンパイル使用メモリ | 198,784 KB |
| 実行使用メモリ | 9,868 KB |
| 最終ジャッジ日時 | 2026-10-12 12:37:16 |
| 合計ジャッジ時間 | 6,356 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
コンパイルメッセージ
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 Control.Monad
import Control.Applicative
solve :: Integral a => a -> a -> a -> a -> a
solve n a b c = t1 - t2 + t3
where
t1 = (n `div` a) + (n `div` b) + (n `div` c)
t2 = (n `div` (lcm a b)) + (n `div` (lcm b c)) + (n `div` (lcm c a))
t3 = (n `div` (lcm (lcm a b) c))
main = do
n <- readLn
[a, b, c] <- map read . words <$> getLine
putStrLn $ show $ solve n a b c
くれちー