結果

問題 No.504 ゲーム大会(ランキング)
ユーザー ducktailducktail
提出日時 2018-02-28 14:32:05
言語 Haskell
(9.8.2)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 9,140 ms
コンパイル使用メモリ 164,696 KB
実行使用メモリ 11,196 KB
最終ジャッジ日時 2023-08-23 07:03:22
合計ジャッジ時間 13,542 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,924 KB
testcase_01 AC 3 ms
6,960 KB
testcase_02 AC 3 ms
6,984 KB
testcase_03 AC 2 ms
6,996 KB
testcase_04 AC 2 ms
6,964 KB
testcase_05 AC 2 ms
7,028 KB
testcase_06 AC 3 ms
6,912 KB
testcase_07 AC 242 ms
11,056 KB
testcase_08 AC 242 ms
11,068 KB
testcase_09 AC 242 ms
11,056 KB
testcase_10 AC 242 ms
11,056 KB
testcase_11 AC 242 ms
11,128 KB
testcase_12 AC 202 ms
11,196 KB
testcase_13 AC 202 ms
11,072 KB
testcase_14 AC 242 ms
11,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #

import Control.Applicative ((<$>))
import Control.Monad (when)

main :: IO ()
main = do
  n <- readLn
  k <- readLn
  print 1
  solve k 1 (n - 1)

solve :: Int -> Int -> Int -> IO ()
solve k r x = do
  when (x /= 0) $ do
    a <- readLn
    if k < a then do
      print (r + 1)
      solve k (r + 1) (x - 1)
    else do
      print r
      solve k r (x - 1)
0