Submission #54389683
Source Code Expand
P = 998244353
N = int(input())
def f(N,i):
if i == 1:
return N%P
K = len(str(N))
if i%2 == 0:
t = f(N,i//2)
return (t*pow(10,i//2*K,P)+t)%P
else:
return (f(N,i-1)*10**K+N)%P
print(f(N,N))
Submission Info
| Submission Time | |
|---|---|
| Task | D - 88888888 |
| User | Rssll_Krkgrd |
| Language | Python (PyPy 3.10-v7.3.12) |
| Score | 350 |
| Code Size | 211 Byte |
| Status | AC |
| Exec Time | 57 ms |
| Memory | 76792 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 350 / 350 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example_00.txt | AC | 57 ms | 76344 KiB |
| example_01.txt | AC | 57 ms | 76548 KiB |
| example_02.txt | AC | 57 ms | 76368 KiB |
| hand_00.txt | AC | 57 ms | 76668 KiB |
| hand_01.txt | AC | 57 ms | 76328 KiB |
| hand_02.txt | AC | 57 ms | 76520 KiB |
| hand_03.txt | AC | 57 ms | 76640 KiB |
| hand_04.txt | AC | 57 ms | 76496 KiB |
| hand_05.txt | AC | 55 ms | 76580 KiB |
| hand_06.txt | AC | 55 ms | 76472 KiB |
| hand_07.txt | AC | 54 ms | 76340 KiB |
| hand_08.txt | AC | 55 ms | 76468 KiB |
| hand_09.txt | AC | 55 ms | 76304 KiB |
| random_00.txt | AC | 54 ms | 76448 KiB |
| random_01.txt | AC | 54 ms | 76588 KiB |
| random_02.txt | AC | 55 ms | 76512 KiB |
| random_03.txt | AC | 55 ms | 76792 KiB |
| random_04.txt | AC | 56 ms | 76488 KiB |
| random_05.txt | AC | 56 ms | 76536 KiB |
| random_06.txt | AC | 54 ms | 76628 KiB |
| random_07.txt | AC | 55 ms | 76252 KiB |
| random_08.txt | AC | 55 ms | 76656 KiB |
| random_09.txt | AC | 54 ms | 76512 KiB |
| random_10.txt | AC | 55 ms | 76364 KiB |
| random_11.txt | AC | 55 ms | 76660 KiB |
| random_12.txt | AC | 55 ms | 76520 KiB |
| random_13.txt | AC | 56 ms | 76708 KiB |
| random_14.txt | AC | 55 ms | 76516 KiB |