結果
問題 | No.2426 Select Plus or Minus |
ユーザー |
|
提出日時 | 2023-08-18 21:35:42 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 40 ms / 2,000 ms |
コード長 | 594 bytes |
コンパイル時間 | 266 ms |
コンパイル使用メモリ | 82,464 KB |
実行使用メモリ | 52,224 KB |
最終ジャッジ日時 | 2024-11-28 06:01:24 |
合計ジャッジ時間 | 3,335 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 41 |
ソースコード
n = int(input())check = 0for i in range(100):m = nans = 0l = []check = iwhile m != 1:if m >= 10**18:check = 1breakans += 1if m % 2 == 0:m //= 2l.append('/')else:if check:m = 3*m-1l.append('-')check -= 1continuem = 3*m+1l.append('+')if m == 1:check = 0if check >= 1:continueelse:print(ans)print(''.join(l))break