結果
| 問題 | No.3547 Rurumaru Function Problem |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-04-21 23:01:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 43 ms / 2,000 ms |
| コード長 | 559 bytes |
| 記録 | |
| コンパイル時間 | 226 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 52,352 KB |
| 最終ジャッジ日時 | 2026-05-22 21:46:23 |
| 合計ジャッジ時間 | 4,576 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_1 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
N, M = [int(s) for s in input().split()]
ans = 0
for i in range(31):
match (i % 2, (N >> i) & 1, (M >> i) & 1):
case (0, 0, 0):
ans |= 0 << i
case (0, 0, 1):
print(-1)
exit()
case (0, 1, 0):
ans |= 0 << i
case (0, 1, 1):
ans |= 1 << i
case (1, 0, 0):
ans |= 0 << i
case (1, 0, 1):
ans |= 1 << i
case (1, 1, 0):
print(-1)
exit()
case (1, 1, 1):
ans |= 0 << i
print(ans)