結果
問題 |
No.2426 Select Plus or Minus
|
ユーザー |
![]() |
提出日時 | 2023-08-18 21:36:56 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 396 bytes |
コンパイル時間 | 156 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-28 06:03:31 |
合計ジャッジ時間 | 4,117 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 35 WA * 6 |
ソースコード
import sys input = lambda :sys.stdin.readline()[:-1] def main(): N = int(input()) i = 0 ans = [] while i <= 10000 and N < 10 ** 18 and N != 1: if N % 2== 0: N //= 2 ans.append("/") else: N = 3 * N + 1 ans.append("+") i += 1 print(i) print(*ans, sep="") if __name__ == '__main__': main()