結果
| 問題 | No.3658 Darumaka Number 2 |
| コンテスト | |
| ユーザー |
回転
|
| 提出日時 | 2026-08-30 14:00:58 |
| 言語 | PyPy3 (7.3.23) |
| 結果 |
AC
|
| 実行時間 | 161 ms / 2,000 ms |
| + 237µs | |
| コード長 | 486 bytes |
| 記録 | |
| コンパイル時間 | 241 ms |
| コンパイル使用メモリ | 95,852 KB |
| 実行使用メモリ | 171,520 KB |
| 最終ジャッジ日時 | 2026-08-30 14:01:12 |
| 合計ジャッジ時間 | 7,141 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 45 |
ソースコード
import pypyjit
pypyjit.set_param("max_unroll_recursion=-1")
import sys
sys.setrecursionlimit(10**5+100)
S = input()
N = len(S)
ans = []
def f(n,giri):
if(n == N):
print("".join(ans))
exit()
if(not giri or int(S[n]) >= 5):
ans.append("5")
f(n+1,giri and S[n] == "5")
ans.pop()
if(not giri or int(S[n]) >= 4):
ans.append("4")
f(n+1,giri and S[n] == "4")
ans.pop()
f(0,True)
for i in range(1,N+1):f(i,False)
回転