Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
| 2011
|
Kotlin Heroes: Episode 11 |
FINISHED |
False |
9000 |
48698723 |
Sept. 30, 2024, 2:35 p.m. |
Problems
You are given a string (s) of the form + +...+ . Every block of digits consists of at least (2) and at most (13) digits; every digit is from (1) to (9). You have to split this string into expressions of the form + . Every expression must be a contiguous part of the given string, and every character of the given string must belong to exactly one expression. For example, if you have a string 123+456+789+555 , then: you are allowed to split it into 123+4 , 56+7 and 89+555 ; you are not allowed to split it into 123+456 and +789+555 , since the second part begins with a + sign; you are not allowed to split it into 123+4 , 56+7 , 8 and 9+555 , since the third part does not contain a + sign; you are not allowed to split it into 123+456+78 and 9+555 , since the first part contains two + signs. Among all allowed ways to split the string, find one which maximizes the sum of results of all expressions you get, and print this sum. The first line contains one integer (t) ((1 \le t \le 100)) — the number of test cases. Each test case consists of one line containing the string (s) ((5 \le |s| \le 1000)) of the form + +...+ . The string contains at least one ' + ' sign. Every block of digits consists of at least (2) and at most (13) digits; every digit is from (1) to (9). For each test case, print one integer — the maximum possible sum of results of all expressions you get after splitting the string. In the first test case of the example, you should split the string into expressions 123+4 , 56+7 and 89+555 . The sum of results of these expressions is (834). In the second test case of the example, the given string is already a valid expression and cannot be split any further. |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
283778439 |
nguyenhoangminh318 |
C |
Sept. 30, 2024, 2:54 p.m. |
OK |
Kotlin 1.7 |
TESTS |
14 |
296 |
512000 |
|
|
|
283781974 |
FatihCihan |
C |
Sept. 30, 2024, 3:13 p.m. |
OK |
Kotlin 1.7 |
TESTS |
14 |
296 |
819200 |
|
|
|
283777990 |
Irmuun.Ch |
C |
Sept. 30, 2024, 2:51 p.m. |
OK |
Kotlin 1.7 |
TESTS |
14 |
311 |
614400 |
|
|
|
283783329 |
Fysty |
C |
Sept. 30, 2024, 3:22 p.m. |
OK |
Kotlin 1.7 |
TESTS |
14 |
312 |
204800 |
|
|
|
283779468 |
MahiruShiina |
C |
Sept. 30, 2024, 2:59 p.m. |
OK |
Kotlin 1.7 |
TESTS |
14 |
312 |
716800 |
|
|
|
283797793 |
Wansur |
C |
Sept. 30, 2024, 4:51 p.m. |
OK |
Kotlin 1.7 |
TESTS |
14 |
312 |
1433600 |
|
|
|
283777949 |
_Anton |
C |
Sept. 30, 2024, 2:51 p.m. |
OK |
Kotlin 1.7 |
TESTS |
14 |
312 |
5120000 |
|
|
|
283777288 |
cpchenpi |
C |
Sept. 30, 2024, 2:47 p.m. |
OK |
Kotlin 1.7 |
TESTS |
14 |
312 |
19046400 |
|
|
|
283792596 |
zsfzhjf |
C |
Sept. 30, 2024, 4:18 p.m. |
OK |
Kotlin 1.7 |
TESTS |
14 |
327 |
0 |
|
|
|
283785097 |
Zinc-acetate |
C |
Sept. 30, 2024, 3:32 p.m. |
OK |
Kotlin 1.7 |
TESTS |
14 |
327 |
1433600 |
|
|
|
283779666 |
_RedWine_ |
C |
Sept. 30, 2024, 3 p.m. |
OK |
Kotlin 1.9 |
TESTS |
14 |
156 |
0 |
|
|
|
283779633 |
satyam343 |
C |
Sept. 30, 2024, 3 p.m. |
OK |
Kotlin 1.9 |
TESTS |
14 |
156 |
0 |
|
|
|
283783984 |
sword060 |
C |
Sept. 30, 2024, 3:25 p.m. |
OK |
Kotlin 1.9 |
TESTS |
14 |
171 |
0 |
|
|
|
283782217 |
FatihCihan |
C |
Sept. 30, 2024, 3:15 p.m. |
OK |
Kotlin 1.9 |
TESTS |
14 |
171 |
0 |
|
|
|
283781382 |
TitTolkachev |
C |
Sept. 30, 2024, 3:10 p.m. |
OK |
Kotlin 1.9 |
TESTS |
14 |
171 |
0 |
|
|
|
283780981 |
ibrahimhanifceker |
C |
Sept. 30, 2024, 3:08 p.m. |
OK |
Kotlin 1.9 |
TESTS |
14 |
171 |
0 |
|
|
|
283780598 |
Darren0724 |
C |
Sept. 30, 2024, 3:06 p.m. |
OK |
Kotlin 1.9 |
TESTS |
14 |
171 |
0 |
|
|
|
283780521 |
hocln |
C |
Sept. 30, 2024, 3:05 p.m. |
OK |
Kotlin 1.9 |
TESTS |
14 |
171 |
0 |
|
|
|
283779302 |
T0uRistq |
C |
Sept. 30, 2024, 2:58 p.m. |
OK |
Kotlin 1.9 |
TESTS |
14 |
171 |
0 |
|
|
|
283777605 |
lto5 |
C |
Sept. 30, 2024, 2:49 p.m. |
OK |
Kotlin 1.9 |
TESTS |
14 |
171 |
0 |
|
|
remove filters
Back to search problems