結果
問題 |
No.1298 OR XOR
|
ユーザー |
|
提出日時 | 2023-05-12 00:40:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 38 ms / 2,000 ms |
コード長 | 511 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 82,784 KB |
実行使用メモリ | 53,548 KB |
最終ジャッジ日時 | 2024-11-27 20:08:47 |
合計ジャッジ時間 | 1,583 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
N = int(input()) b = bin(N)[2:] cnt = b.count("1") if cnt<=1: print(-1, -1, -1) else: A = [] B = [] flag = 0 for i in range(len(b)): if b[i]=="1": if flag==0: A.append("1") B.append("0") flag = 1 else: B.append("1") A.append("0") else: A.append("0") B.append("0") A = int("".join(A), 2) B = int("".join(B), 2) C = N print(A, B, C)