提出 #59591504
ソースコード 拡げる
n = int(input())
s = input()
ans = 0
for i in range(1, n + 1):
ans += i * int(s[i - 1]) * (pow(10, n - i + 1) - 1) // 9
print(ans)
提出情報
| 提出日時 | |
|---|---|
| 問題 | E - Sum of All Substrings |
| ユーザ | br1 |
| 言語 | Python (PyPy 3.10-v7.3.12) |
| 得点 | 0 |
| コード長 | 145 Byte |
| 結果 | RE |
| 実行時間 | 2213 ms |
| メモリ | 127304 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 475 | ||||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 01_test_00.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_00.txt | AC | 56 ms | 76372 KiB |
| 00_sample_01.txt | AC | 55 ms | 76624 KiB |
| 01_test_00.txt | AC | 55 ms | 76152 KiB |
| 01_test_01.txt | AC | 55 ms | 76436 KiB |
| 01_test_02.txt | AC | 57 ms | 76344 KiB |
| 01_test_03.txt | RE | 348 ms | 86216 KiB |
| 01_test_04.txt | TLE | 2212 ms | 102144 KiB |
| 01_test_05.txt | TLE | 2213 ms | 127288 KiB |
| 01_test_06.txt | TLE | 2212 ms | 101364 KiB |
| 01_test_07.txt | TLE | 2213 ms | 127092 KiB |
| 01_test_08.txt | TLE | 2212 ms | 105992 KiB |
| 01_test_09.txt | TLE | 2213 ms | 127248 KiB |
| 01_test_10.txt | TLE | 2212 ms | 102564 KiB |
| 01_test_11.txt | TLE | 2213 ms | 127288 KiB |
| 01_test_12.txt | TLE | 2213 ms | 127304 KiB |
| 01_test_13.txt | TLE | 2213 ms | 126904 KiB |
| 01_test_14.txt | AC | 54 ms | 76292 KiB |