結果
| 問題 | No.1871 divisXor |
| コンテスト | |
| ユーザー |
nasutarou1341
|
| 提出日時 | 2022-03-11 22:23:30 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 444 bytes |
| 記録 | |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 84,864 KB |
| 実行使用メモリ | 57,728 KB |
| 最終ジャッジ日時 | 2026-04-05 06:39:39 |
| 合計ジャッジ時間 | 2,911 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 WA * 1 |
ソースコード
import math
def isPrime(n):
last = math.floor(n ** 0.5)
for i in range(2, last + 1):
if n % i == 0:
return False
return True
N = int(input())
if N == 0:
print(-1)
exit()
a = []
while N > 7:
b = N - 1
while not isPrime(b):
b += 1
a.append(b)
N ^= (b + 1)
if N >= 4:
a.append(3)
N ^= 4
if N == 1:
a.append(1)
elif N == 2:
a.append(2)
a.append(1)
elif N == 3:
a.append(2)
print(len(a))
print(*a)
nasutarou1341