結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー aimyaimy
提出日時 2017-06-14 20:36:25
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 521 bytes
コンパイル時間 5,820 ms
コンパイル使用メモリ 168,472 KB
実行使用メモリ 5,352 KB
最終ジャッジ日時 2023-10-25 03:42:54
合計ジャッジ時間 6,651 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,340 KB
testcase_01 WA -
testcase_02 AC 2 ms
5,336 KB
testcase_03 AC 2 ms
5,332 KB
testcase_04 AC 2 ms
5,336 KB
testcase_05 WA -
testcase_06 AC 2 ms
5,332 KB
testcase_07 AC 2 ms
5,332 KB
testcase_08 AC 3 ms
5,336 KB
testcase_09 AC 2 ms
5,336 KB
testcase_10 AC 3 ms
5,336 KB
testcase_11 AC 2 ms
5,332 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
5,340 KB
testcase_15 AC 3 ms
5,340 KB
testcase_16 AC 3 ms
5,336 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
5,340 KB
testcase_24 AC 2 ms
5,340 KB
testcase_25 WA -
testcase_26 AC 2 ms
5,332 KB
testcase_27 AC 2 ms
5,332 KB
testcase_28 AC 2 ms
5,336 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 2 ms
5,340 KB
testcase_32 WA -
testcase_33 AC 3 ms
5,336 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.List

main = do
 n <- readLn
 [a,b,c] <- sort . map read . words <$> getLine
 print (fzbz n a b c)

fzbz n a b c = da + db + dc - dab - dbc - dac + dabc
 where
  divisorOf x y = mod y x == 0
  da = div n a
  db = if divisorOf a b then 0 else div n b 
  dc = if divisorOf a c || divisorOf b c then 0 else div n c 
  dab = if db == 0 then 0 else div n (a*b)
  dbc = if db == 0 || dc == 0 then 0 else div n (b*c)
  dac = if dc == 0 then 0 else div n (a*c)
  dabc = if db == 0 || dc == 0 then 0 else div n (a*b*c)
0