結果
問題 |
No.1010 折って重ねて
|
ユーザー |
|
提出日時 | 2020-03-20 22:05:34 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 477 bytes |
コンパイル時間 | 434 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-15 05:59:18 |
合計ジャッジ時間 | 3,077 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 1 WA * 42 |
ソースコード
from math import log2,floor,ceil x,y,h = map(int,input().split()) x *= 1000 y *= 1000 l = ceil(log2(x/h)) r = ceil(log2(y/h)) lup = floor(log2(x/h)+2) rup = floor(log2(y/h)+2) lis1 = [i for i in range(l,lup)] lis2 = [i for i in range(r,rup)] 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)