結果
| 問題 |
No.1298 OR XOR
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-28 00:36:33 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 2,000 ms |
| コード長 | 1,016 bytes |
| コンパイル時間 | 198 ms |
| コンパイル使用メモリ | 82,248 KB |
| 実行使用メモリ | 54,404 KB |
| 最終ジャッジ日時 | 2024-11-21 06:53:33 |
| 合計ジャッジ時間 | 1,622 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
#!/usr/bin/env python3
import sys
def main():
import math
N = int(input())
S = bin(N)[2:]
d = len(S)
if math.log2(N).is_integer():
print(-1, -1, -1)
return
A = []
B = []
C = []
for ss in S:
if ss == "0":
A.append("0")
B.append("0")
C.append("0")
else:
if len(C) == 0:
A.append("1")
B.append("0")
C.append("1")
else:
A.append("1")
B.append("1")
C.append("0")
print(int("".join(A), 2), int("".join(B), 2), int("".join(C), 2))
# for a in range(1, N + 1):
# for b in range(1, N + 1):
# for c in range(1, N + 1):
# if a | b == b | c == c | a == N and a ^ b ^ c == 0:
# print(bin(a))
# print(bin(b))
# print(bin(c))
# print(a, b, c)
if __name__ == '__main__':
main()