結果
| 問題 | No.1871 divisXor |
| コンテスト | |
| ユーザー |
nasutarou1341
|
| 提出日時 | 2022-03-11 22:22:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 430 bytes |
| 記録 | |
| コンパイル時間 | 231 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 57,984 KB |
| 最終ジャッジ日時 | 2026-04-05 06:39:07 |
| 合計ジャッジ時間 | 5,486 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | WA * 29 |
ソースコード
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(*a)
nasutarou1341