結果

問題 No.1010 折って重ねて
ユーザー yamamura-k
提出日時 2020-03-20 22:03:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 490 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-15 05:53:42
合計ジャッジ時間 2,439 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import log2,floor,ceiling
x,y,h = map(int,input().split())
x *= 1000
y *= 1000
l = ceiling(log2(x/h))
r = ceiling(log2(y/h))
lup = floor(log2(x/h)+2)
rup = floor(log2(y/h)+2)
lis1 = [i for i in range(l,lup+1)]
lis2 = [i for i in range(r,rup+1)]
ans = 0
for p in lis1:
    for q in lis2:
        a = 2*p-q
        b = 2*q-p
        if a%3!=0 or b%3 != 0:continue
        else:
            a //=3;b//=3
            if a >= 0 and b >= 0:
                ans = max(ans,a+b)
print(ans)
0