結果
| 問題 |
No.1243 約数加算
|
| コンテスト | |
| ユーザー |
yuusanlondon
|
| 提出日時 | 2020-10-02 21:44:45 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 64 ms / 2,000 ms |
| コード長 | 372 bytes |
| コンパイル時間 | 1,912 ms |
| コンパイル使用メモリ | 82,000 KB |
| 実行使用メモリ | 66,652 KB |
| 最終ジャッジ日時 | 2024-07-16 04:37:06 |
| 合計ジャッジ時間 | 1,923 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
import os,io
input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
t=int(input())
for _ in range(t):
a,b=map(int,input().split())
ans=[]
for i in range(70):
if a+(1<<i)<=b and a&(1<<i):
ans.append(str(1<<i))
a+=1<<i
for i in range(69,-1,-1):
if a+(1<<i)<=b:
ans.append(str(1<<i))
a+=1<<i
print(len(ans))
print(' '.join(ans))
yuusanlondon