結果
| 問題 |
No.3157 Nabeatsu
|
| コンテスト | |
| ユーザー |
回転
|
| 提出日時 | 2025-05-23 21:20:27 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 709 bytes |
| コンパイル時間 | 335 ms |
| コンパイル使用メモリ | 82,672 KB |
| 実行使用メモリ | 847,632 KB |
| 最終ジャッジ日時 | 2025-05-23 21:20:33 |
| 合計ジャッジ時間 | 5,483 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 MLE * 1 -- * 14 |
ソースコード
import sys
sys.setrecursionlimit(10**7)
S = input()
N = len(S)
ans = []
def f(n,mod,giri):
if(n == N):
if(mod != 0):
print(*ans,sep="")
exit()
else:
return
if(giri):
for i in range(int(S[n]),-1,-1):
if(i == 3):continue
if(i == int(S[n])):
ans.append(i)
f(n+1,(mod+i)%3,True)
ans.pop()
else:
ans.append(i)
f(n+1,(mod+i)%3,False)
ans.pop()
else:
for i in range(9,-1,-1):
if(i == 3):continue
ans.append(i)
f(n+1,(mod+i)%3,False)
ans.pop()
f(0,0,True)
回転