結果
| 問題 | No.2426 Select Plus or Minus |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-25 22:21:58 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 16 ms / 2,000 ms |
| + 753µs | |
| コード長 | 358 bytes |
| 記録 | |
| コンパイル時間 | 412 ms |
| コンパイル使用メモリ | 14,592 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2026-11-04 23:59:08 |
| 合計ジャッジ時間 | 3,052 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
n = int(input())
operation_char = ""
repeat_times = 0
while n != 1:
if n % 2:
if n % 4 == 1:
n = 3*n + 1
operation_char += "+"
else:
n = 3*n - 1
operation_char += "-"
else:
n //= 2
operation_char += "/"
repeat_times += 1
print(repeat_times)
print(operation_char)