Submission #643752

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6437522022-09-22 22:44:17beaconmcPalindrome-Free Numbers (BOI13_numbers)Pypy 3
90.83 / 100
92 ms22024 KiB
def dp(flag,prev,prev2,d):
if d==cur:
return 1
if dps[flag][prev][prev2][d] != -1:
return dps[flag][prev][prev2][d]
ans = 0
if flag:
for i in range(sus[d+1]+1):
if prev==10 and i==0: i = 10
if i==prev and i!=10: continue
if i==prev2 and i!=10: continue
if i==sus[d+1]:
ans += dp(1,i,prev,d+1)
else:
ans += dp(0,i,prev,d+1)
else:
for i in range(10):
if prev==10 and i==0: i = 10
if prev == i and i!=10: continue
if i==prev2 and i!=10: continue
ans += dp(0,i,prev,d+1)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...