Submission #1353489
Source Code Expand
s = "#" + raw_input() n = len(s) DP = [[-n for _ in range(n)] for _ in range(n)] DP[0][0] = 0 for i, c in enumerate(s): m = (i+1) / 2 for k in range(m+1): if c == "g": DP[i][k] = max(DP[i-1][k], DP[i-1][k-1] + 1) if c == "p": DP[i][k] = max(DP[i-1][k] - 1, DP[i-1][k-1]) print max(DP[-1])
Submission Info
Submission Time | |
---|---|
Task | D - AtCoDeer and Rock-Paper |
User | zepp |
Language | Python (2.7.6) |
Score | 0 |
Code Size | 353 Byte |
Status | WA |
Exec Time | 2159 ms |
Memory | 758512 KB |
Judge Result
Set Name | Sample | All | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt |
All | 0_000.txt, 0_001.txt, 1_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | WA | 10 ms | 2568 KB |
0_001.txt | AC | 10 ms | 2568 KB |
1_002.txt | TLE | 2154 ms | 757108 KB |
1_003.txt | TLE | 2150 ms | 690752 KB |
1_004.txt | TLE | 2154 ms | 754292 KB |
1_005.txt | TLE | 2150 ms | 685148 KB |
1_006.txt | TLE | 2154 ms | 756084 KB |
1_007.txt | TLE | 2154 ms | 676100 KB |
1_008.txt | TLE | 2154 ms | 752116 KB |
1_009.txt | TLE | 2157 ms | 755832 KB |
1_010.txt | TLE | 2156 ms | 752884 KB |
1_011.txt | TLE | 2151 ms | 706480 KB |
1_012.txt | TLE | 2153 ms | 751092 KB |
1_013.txt | TLE | 2152 ms | 714884 KB |
1_014.txt | TLE | 2153 ms | 744436 KB |
1_015.txt | TLE | 2154 ms | 755380 KB |
1_016.txt | TLE | 2154 ms | 748916 KB |
1_017.txt | TLE | 2158 ms | 755376 KB |
1_018.txt | TLE | 2155 ms | 751604 KB |
1_019.txt | WA | 1727 ms | 225668 KB |
1_020.txt | TLE | 2159 ms | 755956 KB |
1_021.txt | TLE | 2154 ms | 758512 KB |
1_022.txt | TLE | 2155 ms | 750708 KB |
1_023.txt | TLE | 2153 ms | 757180 KB |
1_024.txt | TLE | 2153 ms | 747508 KB |