結果

問題 No.1047 Zero (Novice)
ユーザー trineutrontrineutron
提出日時 2020-03-27 20:22:39
言語 Haskell
(9.8.2)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 222 bytes
コンパイル時間 6,352 ms
コンパイル使用メモリ 157,732 KB
実行使用メモリ 11,384 KB
最終ジャッジ日時 2023-08-27 06:32:57
合計ジャッジ時間 1,999 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,100 KB
testcase_01 AC 7 ms
11,264 KB
testcase_02 AC 2 ms
6,972 KB
testcase_03 AC 6 ms
11,248 KB
testcase_04 AC 6 ms
11,188 KB
testcase_05 AC 7 ms
11,284 KB
testcase_06 AC 3 ms
7,048 KB
testcase_07 AC 6 ms
11,192 KB
testcase_08 AC 2 ms
7,180 KB
testcase_09 AC 3 ms
6,912 KB
testcase_10 AC 7 ms
11,108 KB
testcase_11 AC 6 ms
11,176 KB
testcase_12 AC 6 ms
11,196 KB
testcase_13 AC 7 ms
11,188 KB
testcase_14 AC 7 ms
11,216 KB
testcase_15 AC 7 ms
11,232 KB
testcase_16 AC 7 ms
11,384 KB
testcase_17 AC 6 ms
11,248 KB
testcase_18 AC 2 ms
7,112 KB
testcase_19 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

main = do
    [a, b] <- map (read :: String -> Int) . words <$> getLine
    let l = iterate (\n -> a * n + b) 0
    let ans = length $ takeWhile (/= 0) (take 50000 $ tail l)
    print $ if ans == 50000 then -1 else ans + 1
0