結果

問題 No.1465 Archaea
ユーザー convexineqconvexineq
提出日時 2021-04-03 06:45:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 333 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 71,592 KB
最終ジャッジ日時 2023-08-25 20:50:44
合計ジャッジ時間 3,758 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,236 KB
testcase_01 AC 70 ms
71,492 KB
testcase_02 AC 74 ms
71,508 KB
testcase_03 AC 70 ms
71,304 KB
testcase_04 WA -
testcase_05 AC 69 ms
71,480 KB
testcase_06 AC 69 ms
71,272 KB
testcase_07 AC 70 ms
71,096 KB
testcase_08 WA -
testcase_09 AC 68 ms
71,300 KB
testcase_10 AC 72 ms
71,196 KB
testcase_11 AC 69 ms
71,196 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 69 ms
71,424 KB
testcase_15 AC 70 ms
71,284 KB
testcase_16 AC 72 ms
71,388 KB
testcase_17 AC 71 ms
71,476 KB
testcase_18 AC 70 ms
71,072 KB
testcase_19 AC 70 ms
70,968 KB
testcase_20 AC 72 ms
71,348 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 69 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(i,n,k):
    # 1,2,4,....,2**i 合計 k 回で n が作れる?
    if k > n: return 0
    return n//(1<<i) + bin(n%(1<<i)).count("1") <= k

n,k = map(int,input().split())
for i in range(20):
    nn = n-2**i
    if i > k or nn%3 or nn < 0: continue
    if check(i,nn//3,k-i):
        print("YES")
        exit()
print("NO")
0