結果

問題 No.1010 折って重ねて
ユーザー ouoz1Vouoz1V
提出日時 2020-04-10 11:12:42
言語 Nim
(2.0.2)
結果
AC  
実行時間 630 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 4,167 ms
コンパイル使用メモリ 70,752 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-10-12 21:54:38
合計ジャッジ時間 7,033 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 9 ms
4,356 KB
testcase_04 AC 630 ms
4,356 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 1 ms
4,352 KB
testcase_11 AC 2 ms
4,352 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,352 KB
testcase_14 AC 2 ms
4,352 KB
testcase_15 AC 40 ms
4,352 KB
testcase_16 AC 15 ms
4,356 KB
testcase_17 AC 9 ms
4,356 KB
testcase_18 AC 22 ms
4,352 KB
testcase_19 AC 4 ms
4,348 KB
testcase_20 AC 10 ms
4,352 KB
testcase_21 AC 4 ms
4,352 KB
testcase_22 AC 10 ms
4,352 KB
testcase_23 AC 8 ms
4,352 KB
testcase_24 AC 29 ms
4,352 KB
testcase_25 AC 10 ms
4,352 KB
testcase_26 AC 11 ms
4,356 KB
testcase_27 AC 5 ms
4,352 KB
testcase_28 AC 6 ms
4,352 KB
testcase_29 AC 18 ms
4,356 KB
testcase_30 AC 1 ms
4,348 KB
testcase_31 AC 2 ms
4,352 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 18 ms
4,352 KB
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 2 ms
4,352 KB
testcase_36 AC 1 ms
4,348 KB
testcase_37 AC 2 ms
4,352 KB
testcase_38 AC 3 ms
4,352 KB
testcase_39 AC 1 ms
4,348 KB
testcase_40 AC 4 ms
4,356 KB
testcase_41 AC 2 ms
4,352 KB
testcase_42 AC 2 ms
4,348 KB
testcase_43 AC 18 ms
4,352 KB
testcase_44 AC 28 ms
4,376 KB
testcase_45 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 45) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated]
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
/home/judge/data/code/Main.nim(1, 75) Warning: imported and not used: 'intsets' [UnusedImport]
/home/judge/data/code/Main.nim(1, 28) Warning: imported and not used: 'algorithm' [UnusedImport]
/home/judge/data/code/Main.nim(1, 39) Warning: imported and not used: 'math' [UnusedImport]
/home/judge/data/code/Main.nim(1, 45) Warning: imported and not used: 'future' [UnusedImport]
/home/judge/data/code/Main.nim(1, 53) Warning: imported and not used: 'sets' [UnusedImport]
/home/judge/data/code/Main.nim(1, 59) Warning: imported and not used: 'tables' [UnusedImport]
/home/judge/data/code/Main.nim(1, 67) Warning: imported and not used: 'hashes' [UnusedImport]

ソースコード

diff #

import sequtils, strutils, algorithm, math, future, sets, tables, hashes, intsets
let read = iterator : string {.closure.} = (while true: (for s in stdin.readLine.split : yield s))


var
    x,y,h = read().parsefloat
    maxv = int.low

h = h / 1000

proc dfs(x,y,h: float, cnt: int) = 
    if h >= x and h >= y:
        maxv = max(maxv, cnt)
    else:
        if x > h:
            dfs(x / 2, y, h * 2, cnt + 1)
        if y > h:dfs(x, y / 2, h * 2, cnt + 1)

dfs(x,y,h,0)

echo maxv
0