結果

問題 No.1286 Stone Skipping
ユーザー mlihua09mlihua09
提出日時 2020-11-13 22:13:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 618 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 76,648 KB
最終ジャッジ日時 2023-09-30 16:08:07
合計ジャッジ時間 3,851 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,576 KB
testcase_01 AC 82 ms
75,836 KB
testcase_02 AC 80 ms
76,492 KB
testcase_03 AC 75 ms
71,088 KB
testcase_04 AC 81 ms
76,648 KB
testcase_05 AC 81 ms
76,484 KB
testcase_06 AC 79 ms
76,596 KB
testcase_07 AC 73 ms
71,304 KB
testcase_08 AC 81 ms
76,496 KB
testcase_09 AC 81 ms
76,556 KB
testcase_10 AC 77 ms
76,044 KB
testcase_11 AC 76 ms
75,840 KB
testcase_12 AC 79 ms
75,864 KB
testcase_13 AC 78 ms
75,868 KB
testcase_14 AC 81 ms
76,096 KB
testcase_15 AC 78 ms
76,600 KB
testcase_16 AC 80 ms
75,696 KB
testcase_17 AC 80 ms
76,488 KB
testcase_18 AC 77 ms
75,808 KB
testcase_19 AC 77 ms
75,776 KB
testcase_20 AC 78 ms
75,920 KB
testcase_21 AC 77 ms
76,056 KB
testcase_22 AC 82 ms
76,556 KB
testcase_23 AC 81 ms
76,624 KB
testcase_24 AC 81 ms
76,520 KB
testcase_25 AC 77 ms
75,964 KB
testcase_26 AC 76 ms
75,844 KB
testcase_27 AC 78 ms
75,832 KB
testcase_28 AC 79 ms
76,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())

for i in range(60, 0, -1):
    
    x = 1
    
    y = D
    
    while x + 1 < y:
        
        z = (x + y) // 2
        
        Z = z
        
        a = 0
        
        for _ in range(i):
            
            a += z
            
            z //= 2
        
        
        if a >= D:
            
            y = Z
            
        else:
            
            x = Z
        

        
    a = 0
    z = x + 1
    for _ in range(i):
        
        a += z
        
        z //= 2
        
    if a == D:
        
        print(x + 1)
        
        exit()
        
print(1)
0