結果
問題 | No.2881 Mod 2^N |
ユーザー |
![]() |
提出日時 | 2024-11-12 22:18:29 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 42 ms / 2,000 ms |
コード長 | 316 bytes |
コンパイル時間 | 282 ms |
コンパイル使用メモリ | 82,372 KB |
実行使用メモリ | 53,832 KB |
最終ジャッジ日時 | 2024-11-12 22:18:33 |
合計ジャッジ時間 | 3,358 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
import sys input = sys.stdin.readline N,X,Y=map(int,input().split()) if X==Y: print(0) ans=[] print(*ans) exit() if Y%2==0: print(-1) exit() ans=[] ans.append(N) S=bin(Y)[2:] c=0;f=0 for s in S: c+=1 if s=='1': if f==0: f=1 else: ans.append(c) c=0 print(len(ans)) print(*ans)