結果
| 問題 | No.2426 Select Plus or Minus |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-18 22:28:59 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 36 ms / 2,000 ms |
| + 443µs | |
| コード長 | 346 bytes |
| 記録 | |
| コンパイル時間 | 89 ms |
| コンパイル使用メモリ | 64,224 KB |
| 実行使用メモリ | 53,580 KB |
| 最終ジャッジ日時 | 2026-11-04 23:56:06 |
| 合計ジャッジ時間 | 4,365 ms |
|
ジャッジサーバーID (参考情報) |
judge7_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
N = int(input())
now = N
ans = []
while now>1:
if now%2==0:
ans.append("/")
now//=2
else:
if (3*now+1)%4==0:
ans.append("+")
now = 3*now+1
else:
ans.append("-")
now = 3*now-1
assert(now<=10**18)
assert(len(ans)<=10000)
print(len(ans))
print("".join(ans))