problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p03186
u210113718
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = map(int, input().split)\n\nP = min(A+B+1, C)\nprint(P+B)', 'A, B, C = map(int, input().split())\n\nP = min(A+B+1, C)\nprint(P+B)']
['Runtime Error', 'Accepted']
['s512604389', 's298144367']
[2940.0, 2940.0]
[17.0, 17.0]
[63, 65]
p03186
u218216885
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = [int(i) for i in input().split()]\nif b > c:\n count = c + (b-(b-c))\n c = 0\nelse:\n count = (c-(c-b))*2\n c -= b\nb -= count//2\nif c >= a and a > 0:\n count += c-(c-a)\n print(count+ 1 if c else 0)\nelif a > c and c > 0:\n print(count+(a-(a-c)))\nelse:\n print(count+b)', 'a, b, c = [int(i) for i in input().split()]\nif b >= c:\n count = c + (b-(b-c))\n c = 0\nelse:\n count = (c-(c-b))*2\n c -= b\nb -= count//2\nif c >= a and a > 0:\n count += c-(c-a)\n c -= c-(c-a)\n print(count + (1 if c else 0))\nelif a > c and c > 0:\n print(count+(a-(a-c)))\nelse:\n print(count+b)']
['Wrong Answer', 'Accepted']
['s673578529', 's746785934']
[3064.0, 3064.0]
[17.0, 17.0]
[292, 313]
p03186
u227082700
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split())\nif a+b>c:print(b+c)\nelse:print(a+b+b+1)', 'a,b,c=map(int,input().split())\nif a+b<c:print(a+b+b+1)\nelse:print(b+c)']
['Wrong Answer', 'Accepted']
['s156882319', 's543243559']
[2940.0, 2940.0]
[17.0, 18.0]
[70, 70]
p03186
u231685196
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C = map(int,input().split())\n\nif B >= C:\n print(B+C)\nelse:\n if A+B <= C:\n print(2*B+A+1)\n else:\n print(B+C)', 'A,B,C = map(int,input().split())\n\nif B >= C:\n print(B+C)\nelse:\n if A+B+1 <= C:\n print(2*B+A+1)\n else:\n print(B+C)']
['Wrong Answer', 'Accepted']
['s030137139', 's165435087']
[2940.0, 2940.0]
[17.0, 17.0]
[134, 136]
p03186
u239099459
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['inputint = list(map(int,input().split()))\n\na = inputint[0] + inputint[1] +1\nb = inputint[2]\nresult = 0\nif a >= b:\n result = inputint[1] + b +1\nelif a < b:\n result = inputint[1]*2 + inputint[0] + 1\n\nprint(result)', 'inputint = list(map(int,input().split()))\n\na = inputint[0] + inputint[1] + 1\nb = inputint[2]\nresult = 0\nif a >= b:\n result = inputint[1] + b\nelif a < b:\n result = inputint[1]*2 + inputint[0] + 1\n\nprint(result)']
['Wrong Answer', 'Accepted']
['s350625126', 's360625189']
[3060.0, 3060.0]
[18.0, 18.0]
[217, 215]
p03186
u262869085
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C =[int(i)for i in input().split()]\nif C+1 < A+B:\n print(B+C)\nelse:\n print(A+2*B+1)\n', 'A,B,C =[int(i)for i in input().split()]\nif C+1 <= A+B:\n print(B+C)\nelse:\n print(A+2*B+1)', 'A,B,C =map(int,input().split())\nif A+B >= C:\n print(B+C)\nelse:\n print(A+B*2+1)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s284052380', 's629102732', 's588930464']
[2940.0, 2940.0, 2940.0]
[18.0, 17.0, 18.0]
[94, 94, 84]
p03186
u266485840
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input.split())\nprint(b+min(a+b+1,c))', 'a,b,c = map(int,input().split())\nprint(b + min(a+b+1,c))']
['Runtime Error', 'Accepted']
['s420297341', 's671065567']
[2940.0, 2940.0]
[18.0, 19.0]
[50, 56]
p03186
u280978334
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a=[int(x) for x in input().split()]\nif(a[0]+a[1]>a[2]):\n print(a[1]+a[2])\nelif:\n print(a[1]+a[2]-abs(a[0]+a[1]-a[2]))', 'a=[int(x) for x in input().split()]\nif(a[0]+a[1]>a[2]):\n print(a[1]+a[2])\nelse:\n print(2*a[1]+a[0]+1)', 'a=[int(x) for x in input().split()]\nif(a[0]+a[1]>=a[2]):\n print(a[1]+a[2])\nelse:\n print(2*a[1]+a[0]+1)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s032753145', 's914105141', 's917728128']
[2940.0, 2940.0, 2940.0]
[18.0, 18.0, 18.0]
[119, 103, 104]
p03186
u293403071
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c = map(int, input().split())\nif a+b >= c-1:\n print(b+c)\nelse:\n print(a+2b+1)\n', 'a,b,c = map(int, input().split())\nif a+b >= c-1:\n print(b+c)\nelse:\n print(a+2*b+1)\n']
['Runtime Error', 'Accepted']
['s519123882', 's502455632']
[2940.0, 2940.0]
[17.0, 17.0]
[84, 85]
p03186
u296150111
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split())\nif b+a-1>=c:\n\tprint(b+c)\nelse:\n\tprint(b+a+b+1)', 'a,b,c=map(int,input().split())\nif b+a+1>=c:\n\tprint(b+c)\nelse:\n\tprint(b+a+b+1)']
['Wrong Answer', 'Accepted']
['s907941629', 's330686060']
[2940.0, 2940.0]
[17.0, 19.0]
[77, 77]
p03186
u304050136
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = map(int, input.split())\nif (b >= c):\n print(b+c)\nelse:\n tot = 0\n tot += 2*b\n c -= b\n tot += c if a >= c-1 else a+1\n print(tot)', 'a, b, c = map(int, input().split())\nif (b >= c):\n print(b+c)\nelse:\n tot = 0\n tot += 2*b\n c -= b\n tot += c if a >= c-1 else a+1\n print(tot)\n']
['Runtime Error', 'Accepted']
['s597937294', 's262086174']
[2940.0, 2940.0]
[18.0, 18.0]
[142, 145]
p03186
u306142032
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = map(int, input().split())\nif a+b > c:\n print(b+c)\nelse:\n print(a+2*b+1)\n ', 'a, b, c = map(int, input().split())\nif a+b > c-2:\n print(b+c)\nelse:\n print(a+2*b+1)']
['Wrong Answer', 'Accepted']
['s675930653', 's091448996']
[2940.0, 2940.0]
[17.0, 24.0]
[86, 85]
p03186
u310678820
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c = map(int, input().split())\nif a+b>=c:\n print(a+c)\nelse:\n print(2*a+b)', 'a,b,c = map(int, input().split())\nif a+b+1>=c:\n print(b+c)\nelse:\n print(2*b+a+1)']
['Wrong Answer', 'Accepted']
['s757710466', 's015554819']
[2940.0, 2940.0]
[17.0, 18.0]
[78, 82]
p03186
u315485238
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = list(map(int, input().split()))\n\nprint(B + min(A+B, C) + max(1, C-min(A+B, C)))\n', 'A, B, C = list(map(int, input().split()))\n \nprint(B + min(C, A+B+1))']
['Wrong Answer', 'Accepted']
['s770654066', 's622637556']
[2940.0, 2940.0]
[17.0, 17.0]
[90, 68]
p03186
u328510800
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = map(int, input().split())\n\nresult = 0\navailable_pair = min(b,c)\nresult += (2 * available_pair)\nb -= available_pair\nc -= available_pair\n\nif c > 0:\n result += min(c, a)\n if c > 0:\n result += 1\nelse:\n result += b\nprint(result)', 'a, b, c = map(int, input().split())\n\nresult = 0\navailable_pair = min(b,c)\nresult += (2 * available_pair)\nb -= available_pair\nc -= available_pair\n\nif c > 0:\n result += min(c, a)\n c -= min(c, a)\n if c > 0:\n result += 1\nelse:\n result += b\nprint(result)']
['Wrong Answer', 'Accepted']
['s119114728', 's363641866']
[3060.0, 3064.0]
[18.0, 17.0]
[239, 256]
p03186
u339550873
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nA, B, C = [int(x) for x in input().split()]\n\nif B >= C:\n as = C + B\nelif (C-B) >= A:\n as = B + A + C\nelse:\n as = C + B\n\nprint(as)', '#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nA, B, C = [int(x) for x in input().split()]\n\nif B >= C:\n answer = C + B\nelif (C-B) >= A:\n answer = B + A + C\nelse:\n answer = C + B\n\nprint(answer)', '#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nA, B, C = [int(x) for x in input().split()]\n\nif B >= C-1:\n answer = C + B\nelif (B+A) >= C-1:\n answer = B + C\nelse:\n answer = 2*B + A+1\n\nprint(answer)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s366965060', 's777363919', 's886518349']
[2940.0, 3060.0, 2940.0]
[18.0, 17.0, 17.0]
[187, 203, 207]
p03186
u350997995
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C=map(int,input().split())\nABC=0\nwhile(1):\n if C>0:\n ABC+=1\n C-=1\n if C>0 and A==0 and B==0:\n break\n if B>0:\n ABC+=1\n B-=1\n elif A>0:\n A-=1\nprint(ABC)', 'a,b,c = map(int,input().split())\nz = a+b\nprint(min(c,z+1)+b)']
['Time Limit Exceeded', 'Accepted']
['s697427169', 's682652197']
[3060.0, 2940.0]
[2104.0, 17.0]
[208, 60]
p03186
u367130284
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split());print(b+min(c,b+1))', 'a,b,c=map(int,input().split());print(b+min(c,a+b+1))']
['Wrong Answer', 'Accepted']
['s275299896', 's880406105']
[2940.0, 2940.0]
[17.0, 17.0]
[50, 52]
p03186
u371467115
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split())\nif a+b+1<c:\n print(b+a+b+1)\nelif a+b+1==c:\n print(b+c)\nelse a+b>c:\n if b+1>=c:\n print(c+1+c)\n elif b+1<c:\n print(b+c+1)', 'a,b,c=map(int,input().split())\nif a+b+1<c:\n print(b+a+b+1)\nelif a+b+1==c:\n print(b+c)\nelif a+b+1>c:\n if b+1>=c:\n print(b+c)\n elif b+1<c:\n print(b+c)']
['Runtime Error', 'Accepted']
['s485819502', 's347864297']
[2940.0, 3060.0]
[18.0, 17.0]
[176, 174]
p03186
u374121675
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['def cookie(a,b,c):\n if a + b > c-1:\n return b + c\n else:\n return 2 * b + a', 'l = input().split()\na = int(l[0])\nb = int(l[1])\nc = int(l[2])\nif a + b >= c - 1:\n print(b + c)\nelse:\n print(a + 2 * b + 1)']
['Wrong Answer', 'Accepted']
['s950643729', 's726028922']
[2940.0, 2940.0]
[18.0, 18.0]
[82, 124]
p03186
u391475811
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C=map(int,input())\n\nif A+B < C-1:\n print(A+B+B+1)\nelse:\n print(C+B)', 'A,B,C=map(int,input().split())\n\nif A+B < C-1:\n print(A+B+B+1)\nelse:\n print(C+B)\n']
['Runtime Error', 'Accepted']
['s435071035', 's078133671']
[2940.0, 2940.0]
[17.0, 18.0]
[73, 82]
p03186
u391731808
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C = map(int,input().split())\nif (A+B)>C:\n print(B+C)\nelse:\n print((A+B)+B+1)', 'A,B,C = map(int,input().split())\nprint(B+min(C,A+B+1))\n']
['Wrong Answer', 'Accepted']
['s753637180', 's315751770']
[2940.0, 2940.0]
[18.0, 18.0]
[86, 55]
p03186
u397563544
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a = int(input())\n\nb, c = map(int, input().split())\n\ns = input()\n\nprint("{} {}".format(a+b+c, s))', 'a,b,c=map(int,input().split())\nif a+b > c-1:\n print(b+c)\nelse:\n print(a+2*b+1)']
['Runtime Error', 'Accepted']
['s282935260', 's565911064']
[2940.0, 2940.0]
[18.0, 18.0]
[165, 80]
p03186
u408620326
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = [int(x) for x in input().strip().split()]\nans = min(B, C) * 2\nB -= ans // 2\nC -= ans // 2\nans += B\nans += min(A, C)\nif C:\n ans += 1\nprint(ans)', 'A, B, C = [int(x) for x in input().strip().split()]\nans = min(B, C) * 2\nB -= ans // 2\nC -= ans // 2\nans += B\nans += min(A, C)\nC -= A\nif C > 0:\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s051640944', 's641929174']
[3060.0, 3060.0]
[17.0, 17.0]
[153, 164]
p03186
u416223629
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C=map(int,input().split())\n\nif A+B>C:\n print(B+C)\nelse:\n print(A+2*B+1)', 'A,B,C=map(int,input().split())\n\nif A+B>C:\n print(B+C)\nelif A+B==C:\n print(B+C)\nelif A+B==C-1:\n print(B+C)\nelse:\n print(2*B+A+1)']
['Wrong Answer', 'Accepted']
['s299732857', 's235288427']
[2940.0, 3064.0]
[18.0, 17.0]
[81, 139]
p03186
u430223993
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c = map(int, input().split())\nif c>=a+b:\n print(a+2*b+1)\nelse:\n print(b+c)', 'a,b,c = map(int, input().split())\nif c>a+b:\n print(a+2*b+1)\nelse:\n print(b+c)']
['Wrong Answer', 'Accepted']
['s233509541', 's049986576']
[2940.0, 2940.0]
[17.0, 17.0]
[84, 83]
p03186
u449822557
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = list(map(int, input().split()))\nif a + b >= c - 1:\n print(b+c)\nelse:\n print(a+2b+1)', 'a, b, c = list(map(int, input().split()))\nif a + b >= c - 1:\n print(b+c)\nelse:\n print(a+2*b+1)']
['Runtime Error', 'Accepted']
['s955685312', 's031609067']
[2940.0, 2940.0]
[17.0, 17.0]
[99, 100]
p03186
u459233539
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c = map(int,input().split())\nif b + a - c > 0:\n\tprint(b+c)\nelse:\n\tprint(a+2*b+1)\n ', 'a,b,c = map(int,iput().split())\nif b + a - c > 0:\n\tprint(b+c)\nelse:\n\tprint(a+2*b+1)', 'a,b,c = int(iput())\nif b + a - c > 0:\n\tprint(b+c)\nelse:\n\tprint(a+2*b+1)', 'a,b,c = int(iput().split())\nif b + a - c > 0:\n\tprint(b+c)\nelse:\n\tprint(a+2*b+1)', 'a,b,c = map(int,input().split())\nif b + a - c + 1 >= 0:\n\tprint(b+c)\nelse:\n\tprint(a+2*b+1)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s070350120', 's532167228', 's563679575', 's932343796', 's471068929']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 18.0, 18.0, 20.0, 18.0]
[89, 83, 71, 79, 89]
p03186
u499966353
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['x,y,z = map(int, input().split())\n\ndef caneat(a,b,c):\n if a+b >= c+1:\n return b + c\n else:\n return b + (a + b + 1)\n\nprint(caneat(x,y,z))', 'x,y,z = map(int, input().split())\n\ndef caneat(a,b,c):\n if a+b >= c-1:\n return b + c\n else:\n return b + (a + b + 1)\n\nprint(caneat(x,y,z))']
['Wrong Answer', 'Accepted']
['s271167914', 's046488897']
[2940.0, 2940.0]
[17.0, 17.0]
[156, 156]
p03186
u507116804
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split())\n\nif a+b-1>=c:\n print(int(b+c))\nelse:\n print(int(a+2*b+1))\n ', 'a,b,c=map(int,input().split())\n\nif a+b+1<=c:\n print(int(a+2*b+1))\nelse:\n print(int(b+c))\n ']
['Wrong Answer', 'Accepted']
['s424079236', 's169133308']
[2940.0, 2940.0]
[17.0, 17.0]
[93, 93]
p03186
u513065630
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['i=input()\nis=i.split(" ")\na=int(is[0])\nb=int(is[1])\nc=int(is[2])\nif(a+b>c-1){\n print(c+b)\nelse{\n print(b+(a+b+1))\n', 'A, B, C = [int(_) for _ in input().split()]\nif(A+B<C-1){\n print(B+C)\nelse{\n print(A+2*B+1)', 'i=input()\ni_s=i.split(" ")\na=int(i_s[0])\nb=int(i_s[1])\nc=int(i_s[2])\nif(a+b>c-1):\n print(c+b)\nelse:\n print(b+(a+b+1))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s264647125', 's681662694', 's721193004']
[2940.0, 2940.0, 2940.0]
[18.0, 17.0, 18.0]
[116, 92, 119]
p03186
u529722835
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = (int(n) for n in input().split())\n\ncount = 0\nif C - B < 0:\n count = C + B\nelif C - B =>0:\n if C - B - A =<0:\n count = C + B\n elif C - B - A >0:\n count = A + 2*B + 1\n \nprint(count)\n', 'A, B, C = map(int, input().split())\n\ncount = 0\nif C - B < 0:\n count = C + B\nelif C - B >=0:\n if C - B - A <=0:\n count = C + B\n elif C - B - A >0:\n count = A + 2*B +1\n \nprint(count)\n']
['Runtime Error', 'Accepted']
['s822439866', 's410910275']
[2940.0, 3068.0]
[17.0, 17.0]
[202, 208]
p03186
u539517139
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split())\nif a+b>=c-1:\n print(b+c)\nelse:\n print(2b+a+1)', 'a,b,c=map(int,input().split())\nprint(b+c if a+b>=c-1 else 2*b+a+1)']
['Runtime Error', 'Accepted']
['s644633094', 's867481314']
[2940.0, 2940.0]
[18.0, 18.0]
[78, 66]
p03186
u540572789
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a = input()\nb = input()\nc = input()\nr = 0\n \nif a + b >= c:\n r = b + c\nelse:\n r = a + b\n\nprint(r)', 'a, b, c = input()\nr = 0\n\nif a + b >= c:\n r = b + c\nelse:\n r = a + b\n\nprint(r)', 'a, b, c = map(int,input().split())\nr = 0\nif c <= a + b + 1:\n r = b + c\nelse:\n r = a + 2 * b + 1\nprint(r)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s034053952', 's274755775', 's056751206']
[2940.0, 2940.0, 2940.0]
[18.0, 18.0, 18.0]
[102, 79, 106]
p03186
u553348533
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C = map(int,input().split())\nans = 0\nif B >= C:\n ans = B + C\n print(ans)\n\nelse:\n ans = B * 2\n if A >= C - B:\n ans += C\n else:\n ans += A + 1\n\n print(ans)', 'A,B,C = map(int,input().split())\nans = 0\nif B >= C:\n ans = B + C\n print(ans)\n\nelse:\n ans = B * 2\n if A >= C - B:\n ans += C - B\n else:\n ans += A + 1\n\n print(ans)']
['Wrong Answer', 'Accepted']
['s421782927', 's164732418']
[2940.0, 2940.0]
[17.0, 17.0]
[188, 192]
p03186
u560464565
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport sys\n \ninput = sys.stdin.readline\na, b, c = map(int, input().split())\nif (a + b) > c:\n print(b + c)\n exit(0)\nelse:\n print(b + c + 1)\n exit(0)\n', '#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport sys\n \ninput = sys.stdin.readline\na, b, c = map(int, input().split())\nif (a + b) >= c:\n print(b + c)\n exit(0)\nelse:\n print(a + 2 * b + 1)\n exit(0)\n']
['Wrong Answer', 'Accepted']
['s554953218', 's366018648']
[2940.0, 2940.0]
[19.0, 17.0]
[207, 212]
p03186
u561083515
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C = map(int, input().split())\n\n\n\nif A < C:\n ans = A\n C -= A\nelse:\n print(C + B)\n exit()\n\nif B + 1 >= C:\n print(ans + C)\nelse:\n print(ans + B + 1 + B)', 'A,B,C = map(int, input().split())\n\nif A + 1 >= C:\n print(B + C)\n exit()\nelse:\n ans = A\n C -= A\n\nif B + 1 >= C:\n print(ans + B + C)\nelse:\n print(ans + B + (B + 1))']
['Wrong Answer', 'Accepted']
['s865587905', 's727572277']
[3060.0, 2940.0]
[17.0, 17.0]
[371, 180]
p03186
u562890645
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C = map(int,input().split())\nif A+B>C:\n print(B+C)\nelse:\n print(A+B+B+1)', 'A,B,C = map(int,input().split())\nif A+B >= C:\n print(B+C)\nelse:\n print(A+B+B+1)']
['Wrong Answer', 'Accepted']
['s925464417', 's628269262']
[2940.0, 2940.0]
[18.0, 18.0]
[82, 85]
p03186
u578406587
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = (int(i) for i in input().split())\nif a + b + 1 > c:\n return b + c\n\nelse:\n return 2 * b + a + 1', 'a, b, c = (int(i) for i in input().split())\nif a + b + 1 > c:\n print(b + c)\n\nelse:\n print(2 * b + a + 1)\n']
['Runtime Error', 'Accepted']
['s487473760', 's393289445']
[2940.0, 2940.0]
[18.0, 18.0]
[110, 111]
p03186
u580697892
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['#coding: utf-8\nA, B, C = map(int, input().split())\ntotal = 0\nwhile C > 0:\n total += 1\n C -= 1\n if C == 0:\n break\n elif B > 0:\n total += 1\n B -= 1\n else:\n break\nprint(A + total)', '#coding: utf-8\nA, B, C = map(int, input().split())\nif (A + B) < C:\n print(A + 2 * B + 1)\nelse:\n print(B + C)']
['Wrong Answer', 'Accepted']
['s145417230', 's695809123']
[3060.0, 2940.0]
[2104.0, 18.0]
[217, 114]
p03186
u595893956
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c = map(int,input().split())\nprint(min(c,a+b+1)+a+b)', 'a,b,c = map(int,input().split())\nprint(min(c,a+b+1)+b)\n']
['Wrong Answer', 'Accepted']
['s695239093', 's159433693']
[2940.0, 2940.0]
[18.0, 17.0]
[56, 55]
p03186
u597455618
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = map(int, input().split())\n\nif c < a+b:\n print(b+c)\nelse:\n print(a+2*b+1)', 'a, b, c = map(int, input().split())\n\nif c <= a+b:\n print(b+c)\nelse:\n print(a+2*b+1)']
['Wrong Answer', 'Accepted']
['s842897703', 's156138455']
[2940.0, 2940.0]
[17.0, 18.0]
[84, 85]
p03186
u603234915
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = map(int, input().split())\n\nprint(min((A+B, C) + min(B, C)))\n', 'A, B, C = map(int, input().split())\n\nprint(min(A+B+1, C) + B)\n']
['Runtime Error', 'Accepted']
['s170373757', 's214246684']
[2940.0, 2940.0]
[19.0, 18.0]
[70, 62]
p03186
u613043812
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['ipt = input().split()\n\na = ipt[0]\nb = ipt[1]\nc = ipt[2]\n\nif c <= a + b + 1:\n print(c + b)\nelse:\n print(a + b + 1 + b)', 'ipt = input().split()\n\na = int(ipt[0])\nb = int(ipt[1])\nc = int(ipt[2])\n\nif c <= a + b + 1:\n print(c + b)\nelse:\n print(a + b + 1 + b)']
['Runtime Error', 'Accepted']
['s558503288', 's306687082']
[2940.0, 2940.0]
[17.0, 18.0]
[119, 134]
p03186
u623601489
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['l,n=map(int,input().split())\nx_lst=[int(input())for i in range(n)]\nans=0\na=0\nwhile len(x_lst):\n if x_lst[0]>l-x_lst[-1]:\n a=x_lst.pop(0)\n ans+=a\n x_lst=list(map(lambda x:x-a,x_lst))\n else:\n a=x_lst.pop(-1)\n ans+=l-a\n x_lst=list(map(lambda x:[x+l-a,x-a][x>=a],x_lst))\nprint(ans)\n', 'def abg(a,b,c):\n if c>a+b:\n return a+2*b+1\n else:\n return b+c\na,b,c=map(int,input().split())\nprint(abg(a,b,c))\n']
['Runtime Error', 'Accepted']
['s684362360', 's629838648']
[3064.0, 3064.0]
[19.0, 18.0]
[326, 131]
p03186
u623819879
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['import numpy as np\na,b,c=list(map(int, input().split()))\n#print(a,b,c)\nmin(c,a+b+1)+b', 'import numpy as np\na,b,c=list(map(int, input().split()))\n#print(a,b,c)\nprint(min(c,a+b+1)+b)']
['Wrong Answer', 'Accepted']
['s172314578', 's768390869']
[21404.0, 13552.0]
[304.0, 147.0]
[85, 92]
p03186
u628583308
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['#coding:utf-8\n\nA, B, C = list(map(int, input().split()))\n\nprint(min(A+B, B+C))\n', '#coding:utf-8\n\nA, B, C = list(map(int, input().split()))\n\nif C <= A+B:\n print(B+C)\nelse:\n print(B + (A+B) + 1)\n']
['Wrong Answer', 'Accepted']
['s329505432', 's887081680']
[2940.0, 2940.0]
[17.0, 17.0]
[79, 117]
p03186
u634461820
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['\nimport bisect\nimport sys\ndef IL(): return list(map(int,input().split()))\ndef SL(): return input().split()\ndef I(): return int(sys.stdin.readline())\ndef S(): return input()\n\ns = [i for i in S()] \nt = [i for i in S()] \n\ncnt = []\nans = 0\nfor i in s:\n\ttmp = t.index(i)+1\n\tbi = bisect.bisect_left(cnt,tmp)\n\tcnt.insert(bi,tmp)\n\tans += tmp-1-bi\nprint(ans)\n\n', '\nimport bisect\nimport sys\ndef IL(): return list(map(int,input().split()))\ndef SL(): return input().split()\ndef I(): return int(sys.stdin.readline())\ndef S(): return input()\n\n\ndef nibutan(list,n):\n\tlist = [-int(10e10)]+list+[int(10e10)]\n\tleft = 0\n\tright = len(list)\n\twhile left+1 != right:\n\t\tmiddle = (left+right)//2\n\t\tif list[middle] <= n:\n\t\t\tleft = middle\n\t\telse:\n\t\t\tright = middle\n\treturn left\n\ns = [i for i in S()] \nt = [i for i in S()] \n\ncnt = []\nans = 0\nfor i in s:\n\ttmp = t.index(i)+1\n\tbi = nibutan(cnt,tmp)\n\tcnt.insert(bi,tmp)\n\tans += tmp-1-bi\nprint(ans)\n\n', 'import itertools\nimport numpy as np\nimport sys\ninput = sys.stdin.readline\ndef IL(): return list(map(int,input().split()))\ndef SL(): return input().split()\ndef I(): return int(sys.stdin.readline())\ndef S(): return input()\n\nA,B,C = IL()\n\nif A+B < C:\n print(B*2+A+1)\nelse:\n print(B+C)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s452028051', 's795574794', 's031836131']
[3064.0, 3064.0, 20652.0]
[18.0, 19.0, 365.0]
[418, 646, 287]
p03186
u637742907
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
["import sys\n\n\nif __name__ == '__main__':\n # a not yum, bc yum\n a = int(sys.argv[1])\n b = int(sys.argv[2])\n c = int(sys.argv[3])\n\n if (a+b) >= c:\n print(b+c)\n else:\n print(a+b+1+b)\n", 'import sys\n\n# a not yum, bc yum\na = int(sys.argv[1])\nb = int(sys.argv[2])\nc = int(sys.argv[3])\n\nif (a+b) >= c:\n return(b+c)\nelse:\n return(a+b+1+b)\n', 'import sys\n\n# a not yum, bc yum\na = int(sys.argv[1])\nb = int(sys.argv[2])\nc = int(sys.argv[3])\n\nif (a+b) >= c:\n print(b+c)\nelse:\n print(a+b+1+b)', "import sys\n\n\nif __name__ == '__main__':\n # a not yum, bc yum\n a, b, c = [int(i) for i in input().split()]\n\n if (a+b) >= c:\n print(b+c)\n else:\n print(a+b+1+b)\n"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s181826740', 's411789576', 's586472037', 's455148079']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 18.0]
[211, 153, 150, 184]
p03186
u648212584
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C = map(int,input().split())\n\nif B >= C:\n print(B+C)\nelse:\n print(2*B+min(C-B,A)+1)', 'A,B,C = map(int,input().split())\n\nif B >= C:\n print(B+C)\nelse:\n if A >= (C-B)-1:\n print(B+C)\n else:\n print(2*B+A+1)']
['Wrong Answer', 'Accepted']
['s690477719', 's507780670']
[2940.0, 2940.0]
[17.0, 17.0]
[93, 138]
p03186
u652081898
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = map(int, input().split())\n\nif a+b > c+1:\n print(b+c)\nelse:\n print(2*(a+b)+1)', 'a, b, c = map(int, input().split())\n\nif a+b > c+1:\n print(b+c)\nelse:\n print(2*b+a+1)\n', 'a, b, c = map(int, input().split())\n\nif b >= c-1:\n print(b+c)\nelse:\n if a+b >= c-1:\n print(b+c)\n else:\n print(a+b*2+1)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s000638224', 's345247612', 's682363673']
[3060.0, 2940.0, 2940.0]
[19.0, 17.0, 17.0]
[92, 91, 141]
p03186
u652656291
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c = map(int,input().split())\nif c >= a + b:\n print(c-(a+b)+1+b)\nelif c < a + b:\n if c >= b:\n print(c+b)\n else:\n print(c+c-1)\n ', 'a,b,c = map(int,input().split())\nif a+b+1 >= c:\n print(b+c)\nelse:\n print(b+(a+b+1))\n \n']
['Wrong Answer', 'Accepted']
['s347604702', 's172300381']
[3064.0, 2940.0]
[17.0, 18.0]
[142, 91]
p03186
u655048024
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C=map(int,input())\nif(A+B>=C+1):\n print(B+C)\nelse:\n print(B+A+B+1)', 'A.B.C=map(int,input())\nif(A+B>=C+1):\n print(B+C)\nelse:\n print(B+A+B+1)', 'A,B,C=map(int,input().split())\nif(A+B>=C+1):\n print(B+C)\nelse:\n print(B+A+B+1)', 'A,B,C=map(int,input().split())\nif(A+B>=C+1):\n print(B+C)\nelse:\n print(B+A+B+1)', 'A,B,C=map(int,input().split())\nif(A+B>=C-1):\n print(B+C)\nelse:\n print(B+A+B+1)']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s079677041', 's249930635', 's901180932', 's907946822', 's796441680']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0, 18.0, 17.0]
[72, 72, 80, 80, 80]
p03186
u655975843
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = map(int, input().split())\nif b >= c:\n print(a + b)\nelse:\n print(a + c)\n', 'a, b, c = map(int, input().split())\nif b >= c:\n print(b)\nelse:\n print(c)\n', 'a, b, c = map(int, input().split())\nif c >= a + b:\n print(a + b)\nelse:\n print(b + c)\n', 'a, b, c = map(int, input().split())\nif c > a + b:\n print(a + 2*b + 1)\nelse:\n print(b + c)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s170874956', 's559798262', 's735272325', 's205071393']
[2940.0, 2940.0, 3316.0, 3316.0]
[17.0, 18.0, 20.0, 21.0]
[87, 79, 91, 96]
p03186
u667084803
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = map(int,input().split())\n\nans = min(A, C)\nA -= ans\nC -= ans \n\nans += 2*min(B, C)\nB -= min(B, C)\nC -= min(B, C)\n\nans += B\nif C >0: ans += 1\nprint(ans)', 'A, B, C = map(int,input().split())\n\nans = min(A+B+1, C)\nans += B\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s768840612', 's786215502']
[3060.0, 2940.0]
[17.0, 17.0]
[159, 76]
p03186
u681444474
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split())\nans=0\n\nif a+b>c:\n print(b+c)\nelse:\n print(a+2*b+1)', 'a,b,c=map(int,input().split())\nans=0\n \nif a+b>=c:\n print(b+c)\nelse:\n print(a+2*b+1)']
['Wrong Answer', 'Accepted']
['s058236180', 's694925562']
[2940.0, 2940.0]
[18.0, 19.0]
[83, 85]
p03186
u684695949
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
[' a,b,c = [int(s) for s in input().split(" ")]\n ret = min(a+b+1,c) + b\n print(ret)', 'a,b,c = [int(s) for s in input().split(" ")]\nret = min(a+b+1,c) + b\nprint(ret)']
['Runtime Error', 'Accepted']
['s975679358', 's815214071']
[2940.0, 2940.0]
[18.0, 17.0]
[84, 78]
p03186
u687923925
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
["a, b, c = map(int, input().strip().split(' '))\nif b>c:\n print(b+c)\nelif a+b>c:\n print(b+c)\nelse:\n print(a+2*b+1)", "a, b, c = map(int, input().strip().split(' '))\nif b>=c:\n print(b+c)\nelif a+b>=c:\n print(b+c)\nelse:\n print(a+2*b+1)"]
['Wrong Answer', 'Accepted']
['s847196464', 's686696891']
[2940.0, 2940.0]
[18.0, 18.0]
[121, 123]
p03186
u688126754
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = map(int, input().split())\n\nx = min(B, C) * 2\n\ny = C - B\nif 0 < y <= A:\n xp = y\nelif 0 < y:\n xp = A\n\n\nprint(x + xp + 1)\n ', 'A, B, C = map(int, input().split())\n\nif C <= B:\n print(C + B)\nelif B < C <= A+B+1:\n print(C+B)\nelse:\n print(B*2+A+1)\n']
['Runtime Error', 'Accepted']
['s101626826', 's381738699']
[2940.0, 3064.0]
[18.0, 19.0]
[139, 126]
p03186
u694433776
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int, input().split())\nif a+b-1>=c:\n print(b+c)\nelse:\n print(a+2*b+1)', 'a,b,c=map(int, input().split())\nif a+b+1>=c:\n print(b+c)\nelse:\n print(a+2*b+1)']
['Wrong Answer', 'Accepted']
['s138364557', 's626219771']
[2940.0, 2940.0]
[17.0, 17.0]
[84, 84]
p03186
u706159977
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['l = list(map(int,input().split()))\nif max(l)==l[1]:\n print(l[1]+l[2])\nelif max(l)==l[0]:\n print(l[1]+l[2])\nelse:\n print(2*l[1])\n ', 'l = list(map(int,input().split()))\nif max(l)==l[1]:\n print(l[1]+l[2])\nelif max(l)==l[0]:\n print(l[1]+l[2])\nelse:\n if l[2]>l[0]+l[1]:\n print(2*l[1]+l[0]+1)\n else:\n print(l[1]+l[2])\n \n ']
['Wrong Answer', 'Accepted']
['s412216468', 's859942494']
[2940.0, 3060.0]
[17.0, 17.0]
[145, 223]
p03186
u713539685
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = map(int, input().split())\nif c >= a + b +1:\n print(a + 2*b + 1)\nelse:\n print(a + c )\n', 'a,b,c = map(int, input().split())\nif c >= a + b + 1:\n print(a + b*2 + 1)\nelse:\n print(b+c)']
['Wrong Answer', 'Accepted']
['s964592755', 's779466711']
[2940.0, 2940.0]
[19.0, 17.0]
[97, 92]
p03186
u723792785
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split())\nif b>=c:\n\tprint(b+c)\nelse:\n\tif a+b>=c+1:\n\t\tprint(c+b)\n\telse:\n\t\tif a+b<c+1:\n\t\t\tprint(b+a+b+1)', 'a,b,c=map(int,input().split())\nif b>=c:\n\tprint(b+c)\nelse:\n\tif a+b>=c:\n\t\tprint(c+b)\n\telse:\n\t\tprint(b+a+b+1)']
['Wrong Answer', 'Accepted']
['s435243522', 's922040507']
[2940.0, 2940.0]
[18.0, 18.0]
[123, 106]
p03186
u724742135
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['from sys import stdin\nA, B, C = [int(_) for _ in stdin.readline().rstrip().split()]\nif A+B+1 >= C:\n print(B+1)\nelse:\n print(B*2+A+1)', 'from sys import stdin\nA, B, C = [int(_) for _ in stdin.readline().rstrip().split()]\nif A+B+1 >= C:\n print(B+C)\nelse:\n print(B*2+A+1)\n']
['Wrong Answer', 'Accepted']
['s492109902', 's919116908']
[9060.0, 9156.0]
[26.0, 23.0]
[138, 139]
p03186
u727787724
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input(),split())\nif c<=a+b:\n print(b+c)\nelse:\n print(a+2*b)', 'a,b,c=map(int,input().split())\nif c<=a+b-1:\n print(b+c)\nelse:\n print(a+2*b+1)\n', 'a,b,c=map(int,input().split())\nif c<=a+b+1:\n print(b+c)\nelse:\n print(a+2*b+1)\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s000372668', 's767606878', 's086540983']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[79, 84, 84]
p03186
u747873993
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C=map(int,input().split())\nif A+B>C:\n print(B+C)\nelse:\n print(2*B+A+1)\n', 'A,B,C=map(int,input().split())\nif A+B>C or B>C:\n print(B+C)\nelse:\n print(2*B+A+1)\n', 'A,B,C=map(int,input().split())\nif A+B>C or B>C:\n print(B+C)\nelse:\n print(2*B+C-A-B)\n', 'A,B,C=map(int,input().split())\nif A+B>C or B>C:\n print(B+C)\nelse:\n print(2*B+C-A-B+1)\n', 'A=input()\nB=input()\nC=input()\nif A+B>C or B>C:\n print(B+C)\nelse:\n print(2*B+C-A-B)\n', 'A,B,C=map(int,input().split())\nif A+B>=C:\n print(B+C)\nelse:\n print(2*B+A+1)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s027063612', 's075711153', 's146407914', 's593854120', 's850379031', 's516380293']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0, 18.0, 17.0, 20.0]
[77, 84, 86, 88, 85, 78]
p03186
u760171369
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = input().split()\nif C > (A + B):\n num = A + 2*B\nelse:\n num = B + C\nprint(num)', 'a, b, c = map(int, input().split())\nif c > (a + b):\n num = a + 2*b + 1\nelse:\n num = b + c\nprint(num)']
['Wrong Answer', 'Accepted']
['s525907606', 's821096220']
[2940.0, 3316.0]
[17.0, 22.0]
[88, 102]
p03186
u760831084
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = map(int, input().split())\n\nif a + b + 1 >= c:\n print(a + b)\nelse:\n print(b + (a + b + 1))', 'a, b, c = map(int, input().split())\n\nif a + b + 1 >= c:\n print(b + c)\nelse:\n print(b + (a + b + 1))']
['Wrong Answer', 'Accepted']
['s779546137', 's282840950']
[9084.0, 9160.0]
[28.0, 26.0]
[105, 105]
p03186
u771532493
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=(int(i) for i in input().split())\nif b+1>=c:\n print(b+c)\nelse:\n if a+1>=c-b:\n print(2*b+c)\n else:\n print(2*b+a+1)', 'L,N=(int(i) for i in input().split())\nX = []\nfor i in range(0,N):\n a = int(input())\n X.append(a)\nimport math\nresult=0\nif X[math.ceil(N/2)]<L/2:\n for i in range (1,math.ceil(N/2)):\n for j in range (N,math.ceul(N/2),-1):\n result+=abs(X[j]-X[i])\nelse:\n for i in range (1,math.ceil(N/2)):\n for j in range (N,math.ceil(N/2),-1):\n result+=abs(X[i]-X[j])\nprint(result)', 'L,N=(int(i) for i in input().split())\nX = []\nfor i in range(0,N):\n a = int(input())\n X.append(a)\nimport math\nresult=0\nif X[math.ceil(N/2)]<L/2:\n for i in range (1,N/2):\n for j in range (N,L/2,-1):\n result+=abs(X[j]-X[i])\nelse:\n for i in range (1,N/2):\n for j in range (N,N/2,-1):\n result+=abs(X[i]-X[j])\nprint(result)', 'L,N=(int(i) for i in input().split())\nn = int(input())\nX = []\nfor i in range(0,N):\n a = int(input())\n X.append(a)\nimport math\nresult=0\nif X[math.ceil(N/2)]<L/2:\n for i in range (1,N/2):\n for j in range (N,L/2,-1):\n result+=abs(X[j]-X[i])\nelse:\n for i in range (1,N/2):\n for j in range (N,N/2,-1):\n result+=abs(X[i]-X[j])\nprint(result)', 'a,b,c=(int(i) for i in input().split())\nif b<c:\n print(2*b)\nelse:\n if a>c:\n print(b+c)\n else:\n print(2*b+a+1)', 'L,N=(int(i) for i in input().split())\nX = []\nfor i in range(0,N):\n a = int(input())\n X.append(a)\nimport math\nif X[math.ceil(N/2)]<L/2:\n result=X[N-1]\n i=0\n j=N-1\n while i<= math.floor(N/2)-1 and j<=math.ceil(N/2)-1:\n result+=abs(X[j]-X[i])\n j-=1\n i+=1\nelse:\n while i<= math.floor(N/2)-1 and j<=math.ceil(N/2)-1:\n result+=abs(X[i]-X[j])\n j-=1\n i+=1\nprint(result)', 'L,N=(int(i) for i in input().split())\nn = int(input())\nX = [0 for i in range(0,N)]\nfor i in range(0,N):\n X[i] = int(input())\na=0\nif X[2/L.ceil()]<L/2:\n for i in range (1,L/2):\n for j in range (N,L/2,-1):\n a+=abs(X[j]-X[i])\nelse:\n for i in range (1,L/2):\n for j in range (N,L/2,-1):\n a+=abs(X[i]-X[j])\nprint(a)', 'a,b,c=(int(i) for i in input().split())\nif b+1>=c:\n print(b+c)\nelse:\n if a+1>=c-b:\n print(2*b+c)\n else:\n print(2*b+a+1)', 'L,N=(int(i) for i in input().split())\nX = []\nfor i in range(0,N):\n a = int(input())\n X.append(a)\nimport math\nif X[math.ceil(N/2)]<L/2:\n result=X[N-1]\n for i in range (0,math.ceil(N/2)):\n for j in range (N-1,math.ceil(N/2)-1,-1):\n result+=abs(X[j]-X[i])\nelse:\n result=X[0]\n for i in range (0,math.ceil(N/2)):\n for j in range (N-1,math.ceil(N/2)-1,-1):\n result+=abs(X[i]-X[j])\nprint(result)', 'a.b.c=(int(i) for i in input().split())\nif b+1>c:\n print(b+c)\nelse:\n if a+1>c-b:\n print(2*b+c)\n else:\n print(2b+a+1)', 'a,b,c=(int(i) for i in input().split())\nif b+1>=c:\n print(b+c)\nelse:\n if a+1>c-b:\n print(2*b+c)\n else:\n print(2b+a+1)', 'L,N=(int(i) for i in input().split())\nn = int(input())\nX = []\nfor i in range(0,N):\n a = int(input())\n X.append(a)\nimport math\nresult=0\nif X[math.ceil(N/2)]<L/2:\n for i in range (1,L/2):\n for j in range (N,L/2,-1):\n result+=abs(X[j]-X[i])\nelse:\n for i in range (1,L/2):\n for j in range (N,L/2,-1):\n result+=abs(X[i]-X[j])\nprint(result)', 'L,N=(int(i) for i in input().split())\nX = []\nfor i in range(0,N):\n a = int(input())\n X.append(a)\nimport math\nresult=0\nif X[math.ceil(N/2)]<L/2:\n for i in range (1,math.ceil(N/2)):\n for j in range (N,math.ceil(N/2),-1):\n result+=abs(X[j]-X[i])\nelse:\n for i in range (1,math.ceil(N/2)):\n for j in range (N,math.ceil(N/2),-1):\n result+=abs(X[i]-X[j])\nprint(result)', 'L,N=(int(i) for i in input().split())\nX = []\nfor i in range(0,N):\n a = int(input())\n X.append(a)\nimport math\nif X[math.ceil(N/2)]<L/2:\n result=L-X[N-1]\n for i in range (0,math.ceil(N/2)):\n for j in range (N-1,math.ceil(N/2)-1,-1):\n result+=abs(X[j]-X[i])\nelse:\n result=X[0]\n for i in range (0,math.ceil(N/2)):\n for j in range (N-1,math.ceil(N/2)-1,-1):\n result+=abs(X[i]-X[j])\nprint(result)', 'a,b,c=(int(i) for i in input().split())\nif b+1>c:\n print(b+c)\nelse:\n if a+1>c-b:\n print(2*b+c)\n else:\n print(2b+a+1)', 'L,N=(int(i) for i in input().split())\nX = []\nfor i in range(0,N):\n a = int(input())\n X.append(a)\nimport math\nresult=0\nif X[math.ceil(N/2)]<L/2:\n for i in range (1,math.ceil(N/2)):\n for j in range (N,math.ceil(N/2)-1,-1):\n result+=abs(X[j]-X[i])\nelse:\n for i in range (1,math.ceil(N/2)):\n for j in range (N,math.ceil(N/2)-1,-1):\n result+=abs(X[i]-X[j])\nprint(result)', 'a,b,c=(int(i) for i in input().split())\nif b+1>=c:\n print(b+c)\nelse:\n if a+1>=c-b:\n print(b+c)\n else:\n print(2*b+a+1)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s005378071', 's005820493', 's040793074', 's167291958', 's316433044', 's358112823', 's381379406', 's488156567', 's492063634', 's744235512', 's747786710', 's761558625', 's916990631', 's924245683', 's940868615', 's949875001', 's687405465']
[2940.0, 3064.0, 3188.0, 3064.0, 2940.0, 3064.0, 3064.0, 2940.0, 2940.0, 2940.0, 2940.0, 3064.0, 3064.0, 3060.0, 2940.0, 3064.0, 2940.0]
[17.0, 17.0, 18.0, 17.0, 17.0, 18.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[128, 386, 342, 359, 118, 402, 331, 128, 415, 125, 126, 359, 386, 417, 125, 390, 126]
p03186
u799691369
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a, b, c = map(int, input().split())\n\ncnt = 0\nif a + b >= c:\n ans = a + b\nelse:\n ans = a + b + 2\n\nprint(cnt)', 'a, b, c = map(int, input().split())\n\ncnt = 0\nif a + b + 1>= c:\n ans = b + c\nelse:\n ans = b + a + b + 1\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s439467537', 's322247464']
[2940.0, 2940.0]
[17.0, 18.0]
[113, 120]
p03186
u800780376
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C = map(int,input().split())\n\ngedoku = A+B\n\nif gedoku>C:\n print(B+C)\nelse:\n print(gedoku+1+B)\n', 'A,B,C = map(int,input().split())\n\ngedoku = A+B\n\nif gedoku>=C:\n print(B+C)\nelse:\n print(gedoku+1+B)\n']
['Wrong Answer', 'Accepted']
['s420858031', 's807264575']
[3316.0, 3316.0]
[19.0, 18.0]
[104, 105]
p03186
u801106491
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split())\nd=a+b\nans=0\nif c>=d:\n ans=2*d\nelse:\n ans=c+d\nprint(ans)', 'a,b,c=map(int,input().split())\nd=a+b\ntotal=0\nif c>d:\n total=2*d+1\nelif c==d:\n total=2*d\nelse:\n total=c+d\nprint(total-a)']
['Wrong Answer', 'Accepted']
['s221446513', 's025340171']
[2940.0, 3060.0]
[18.0, 17.0]
[92, 128]
p03186
u812867074
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split())\nif a + b >= c:\n print(b+c)\nelse:\n print(a+2b)\n \n ', 'a,b,c=map(int,input().split())\nif a + b >= c + 1:\n print(b+c)\nelif a==b==c==0:\n print(0)\nelif a+b=c:\n print(b+c)\nelse:\n print(a+2*b+1)\n', 'a,b,c=map(int,input().split())\nif a + b >= c + 1:\n print(b+c+1)\nelse:\n print(a+2*b+1)', 'a,b,c=map(int,input().split())\nif a + b >= c + 1:\n print(b+c)\nelif a==b==c==0:\n print(0)\nelse:\n print(a+2*b+1)\n', 'a,b,c=map(int,input().split())\nif a + b >= c :\n print(b+c)\nelif a==b==c==0:\n print(0)\nelse:\n print(a+2*b+1)']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s534949464', 's583616954', 's605278232', 's973899976', 's867362498']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[84, 139, 87, 114, 110]
p03186
u820560680
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = map(int, input().split())\nprint(B + min(A+B+1, c))', 'A, B, C = map(int, input().split())\nprint(B + min(A+B+1, C))']
['Runtime Error', 'Accepted']
['s198172235', 's607114171']
[2940.0, 2940.0]
[17.0, 18.0]
[60, 60]
p03186
u825378567
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A=int(input())\nB=int(input())\nC=int(input())\nj=0\nfor i in range(C):\n j=j+1', 'A=int(input())\nB=int(input())\nC=int(input())\nif A+B >= C:\n print(B+C)\nelse:\n print(A+2*B+1)', 'A,B,C=int(input())\nif A+B >= C:\n print(B+C)\nelse:\n print(A+2*B+1)\n', 'A,B,C = map(int,input().split())\nif A+B >= C:\n print(B+C)\nelse:\n print(A+2*B+1)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s108115681', 's584448566', 's851873887', 's827246517']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 18.0, 18.0]
[75, 97, 72, 85]
p03186
u835907423
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['l = list(map(int, input().split()))\nA = l[0]\nB = l[1]\nC = l[2]\n\nif C - B - A >= 0:\n print(A + 2*B + 1)\nelse:\n print(B + C)', 'l = list(map(int, input().split()))\nA = l[0]\nB = l[1]\nC = l[2]\n\nif C - B - A > 0:\n print(A + 2*B + 1)\nelif C == B + A:\n print(A + 2*B)\nelse:\n print(B + C)']
['Wrong Answer', 'Accepted']
['s678315538', 's497073791']
[2940.0, 3060.0]
[17.0, 18.0]
[128, 163]
p03186
u837677955
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['def cookie(a,b,c):\n\tif (a+b)>c:\n\t\treturn c+b\n\telse:\n\t\treturn a+2*b', 'a, b, c = map(int, input().split())\nif (a+b)>=c:\n\treturn c+b\nelse:\n\treturn a+2*b', 'def cookie(a,b,c):\n\tif (a+b)>=c:\n\t\treturn c+b\n\telse:\n\t\treturn a+2*b', 'a, b, c = map(int, input().split())\nif (a+b)>=c:\n\tprint(c+b)\nelse:\n\tprint(a+2*b+1)']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s341306101', 's458942999', 's776102113', 's056419761']
[2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 18.0, 18.0, 18.0]
[66, 80, 67, 82]
p03186
u848654125
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = list(map(int, input().split()))\n\nif B >= C:\n print(B+C)\nelse:\n print(2*B+1)\n', 'A, B, C = list(map(int, input().split()))\n\nif (A+B) >= C:\n print(B+C)\nelse:\n print(A+2*B+1)']
['Wrong Answer', 'Accepted']
['s855519458', 's755076122']
[2940.0, 3064.0]
[18.0, 17.0]
[92, 97]
p03186
u876379401
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['import sys\nprint(1 + min(sys.argv[0] + sys.argv[1], sys.argv[2] - 1) + sys.argv[1])', 'import sys\nprint(1 + min(sys.argv[1] + sys.argv[2], sys.argv[3] - 1) + sys.argv[2])', 'import sys\na, b, c = (int(i) for i in input().split()) \nprint(1 + min(a + b, c - 1) + b)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s430166101', 's818845950', 's865180488']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[83, 83, 90]
p03186
u888092736
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = map(int, input().split())\nif A + B <= C - 1:\n print(B + C)\nelse:\n print(A + 2 * B + 1)', 'A, B, C = map(int, input().split())\nif A + B >= C - 1:\n print(B + C)\nelse:\n print(A + 2 * B + 1)\n']
['Wrong Answer', 'Accepted']
['s794990502', 's295937557']
[9132.0, 9024.0]
[26.0, 29.0]
[103, 103]
p03186
u900176303
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['\ndata = input().split() \n\nnums = list(map(int, input().split()))\nA = nums[0] \nB = nums[1]\nC = nums[2]\n\ncount=0\n\nwhile (C>0):\n C = C - 1\n count = count +1\n if B>0:\n B = B-1\n count = count +1\n elif A>0:\n A = A-1\n else:\n while(B>0):\n B = B -1\n count = count +1\n break\nprint(count)\n', '\nnums = list(map(int, input().split()))\nA = nums[0] \nB = nums[1]\nC = nums[2]\n\ncount=0\n\nif C-1-B <= 0 or C-1-B <=A:\n print(C+B)\nelse:\n print(1+2*B+A)']
['Runtime Error', 'Accepted']
['s771591272', 's600697340']
[3060.0, 2940.0]
[17.0, 17.0]
[391, 179]
p03186
u902151549
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C=map(int,input().split())\nif A+B>=C-1\n print(C+B)\nelse:\n print(A+A+B+1)\n ', '# coding: utf-8\nimport re\nimport math\nimport itertools\nfrom copy import deepcopy\nimport fractions\nimport random\nfrom heapq import heappop,heappush\nimport time\nimport os\nimport sys\nimport datetime\nfrom functools import lru_cache\nreadline=sys.stdin.readline\nsys.setrecursionlimit(2000)\n#import numpy as np\nalphabet="abcdefghijklmnopqrstuvwxyz"\nmod=int(10**9+7)\ninf=int(10**20)\ndef yn(b):\n if b:\n print("yes")\n else:\n print("no")\ndef Yn(b):\n if b:\n print("Yes")\n else:\n print("No")\ndef YN(b):\n if b:\n print("YES")\n else:\n print("NO")\nclass union_find():\n def __init__(self,n):\n self.n=n\n self.P=[a for a in range(N)]\n self.rank=[0]*n\n \n def find(self,x):\n if(x!=self.P[x]):self.P[x]=self.find(self.P[x])\n return self.P[x]\n \n def same(self,x,y):\n return self.find(x)==self.find(y)\n \n def link(self,x,y):\n if self.rank[x]<self.rank[y]:\n self.P[x]=y\n elif self.rank[y]<self.rank[x]:\n self.P[y]=x\n else:\n self.P[x]=y\n self.rank[y]+=1\n \n def unite(self,x,y):\n self.link(self.find(x),self.find(y))\n \n def size(self):\n S=set()\n for a in range(self.n):\n S.add(self.find(a))\n return len(S)\ndef bin_(num,size):\n A=[0]*size\n for a in range(size):\n if (num>>(size-a-1))&1==1:\n A[a]=1\n else:\n A[a]=0\n return A\ndef fac_list(n,mod_=0):\n A=[1]*(n+1)\n for a in range(2,len(A)):\n A[a]=A[a-1]*a\n if(mod>0):A[a]%=mod_\n return A\ndef comb(n,r,mod,fac):\n if(n-r<0):return 0\n return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod\ndef next_comb(num,size):\n x=num&(-num)\n y=num+x\n z=num&(~y)\n z//=x\n z=z>>1\n num=(y|z)\n if(num>=(1<<size)):return False\n else:\n return num\ndef get_primes(n,type="int"):\n A=[True]*(n+1)\n A[0]=False\n A[1]=False\n for a in range(2,n+1):\n if A[a]:\n for b in range(a*2,n+1,a):\n A[b]=False\n if(type=="bool"):return A\n B=[]\n for a in range(n+1):\n if(A[a]):B.append(a)\n return B\ndef is_prime(num):\n if(num<=2):return False\n i=2\n while i*i<=num:\n if(num%i==0):return False\n i+=1\n return True\ndef join(A,c=" "):\n n=len(A)\n A=list(map(str,A))\n s=""\n for a in range(n):\n s+=A[a]\n if(a<n-1):s+=c\n return s\n#############################################\nA,B,C=map(int,input().split())\nif A+B>=C-1:\n print(C+B)\nelse:\n print(B+A+B+1)\n \n']
['Runtime Error', 'Accepted']
['s184935585', 's214142125']
[2940.0, 8036.0]
[17.0, 80.0]
[81, 2581]
p03186
u909815117
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['l = list(map(int,input().split()))\nif l[0]+l[1] >= l[2]:\n print(l[1]+l[2])\n else:\n print(l[0]+2*l[1]+1)', ' l = list(map(int,input().split()))\n if l[0]+l[1] >= l[2]:\n print(l[1]+l[2])\n else:\n print(l[0]+2*l[1]+1)', 'l = list(map(int,input().split()))\nif l[0]+l[1] >= l[2]:\n print(l[1]+l[2])\nelse:\n print(l[0]+2*l[1]+1)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s002403853', 's643102387', 's161187821']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[108, 124, 104]
p03186
u940990031
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A, B, C = [int(x) for x in input().split()]\nprint(B+max(A+B+1, C))\n', 'A, B, C = [int(x) for x in input().split()]\nprint(B+min(A+B+1, C))\n']
['Wrong Answer', 'Accepted']
['s165130531', 's011447721']
[2940.0, 2940.0]
[17.0, 17.0]
[67, 67]
p03186
u957722693
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split())\nif a+b-1>=c:\n print(b+c)\nelse:\n print(a+b+1+b)', 'a,b,c=map(int,input().split())\nif a+b+1>=c:\n print(b+c)\nelse:\n print(a+b+1+b)']
['Wrong Answer', 'Accepted']
['s311686134', 's509260282']
[2940.0, 2940.0]
[22.0, 18.0]
[79, 79]
p03186
u961916328
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c=map(int,input().split())\nif c-a+b>1:\n print(b+c-(c-(a+b))+1)\nelse:\n print(b+c)', 'a,b,c=map(int,input().split())\nif c-(a+b)>1:\n print(b+c-(c-(a+b))+1)\nelse:\n print(b+c)']
['Wrong Answer', 'Accepted']
['s635741934', 's656616860']
[2940.0, 2940.0]
[18.0, 17.0]
[86, 88]
p03186
u970809473
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['a,b,c = map(int, input().split())\nif a + b > c + 1:\n print(b + c)\nelse:\n print(a + 2 * b + 1)', 'a,b,c = map(int, input().split())\nif a + b >= c:\n print(b + c)\nelse:\n print(a + 2 * b + 1)']
['Wrong Answer', 'Accepted']
['s498210475', 's077718043']
[2940.0, 2940.0]
[17.0, 17.0]
[95, 92]
p03186
u978313283
2,000
1,048,576
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches. Find the maximum number of tasty cookies that Takahashi can eat.
['A,B,C=map(int,input().split())\nif B>=C:\n ans=B+C\nelse C>B:\n ans+=2*B\n if A>C:\n ans+=C\n else:\n ans+=A\nprint(ans)\n', 'A,B,C=map(int,input().split())\nif B>=C:\n ans=B+C\nelse C>B:\n ans=2*B\n if A>C:\n ans+=C\n else:\n ans+=A\nprint(ans)\n', 'A,B,C=map(int,input().split())\nif B>=C:\n print(B+C)\nelse:\n ans=2*B\n C-=B\n if A>=C:\n print(ans+C)\n else:\n print(ans+A+1)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s724437405', 's990567375', 's811519154']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 21.0]
[122, 121, 149]
p03187
u026075806
2,000
1,048,576
Takahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi. Each point on the circumference of the lake has a coordinate between 0 and L (including 0 but not L), which is the distance from the Takahashi's residence, measured counter-clockwise. There are N trees around the lake; the coordinate of the i-th tree is X_i. There is no tree at coordinate 0, the location of Takahashi's residence. Starting at his residence, Takahashi will repeat the following action: * If all trees are burnt, terminate the process. * Specify a direction: clockwise or counter-clockwise. * Walk around the lake in the specified direction, until the coordinate of a tree that is not yet burnt is reached for the first time. * When the coordinate with the tree is reached, burn that tree, stay at the position and go back to the first step. Find the longest possible total distance Takahashi walks during the process.
["def main():\n L, N = map(int, input().split())\n lines = sys.stdin.readlines()\n\n trees_ccw = [None] * N\n for i in range(N):\n trees_ccw[i] = int(lines[i])\n\n trees_cw = [L - trees_ccw[-(i+1)] for i in range(N)]\n trees_ccw_accum = [0] + [None] * N\n trees_cw_accum = [0] + [None] * N\n for i in range(N):\n trees_ccw_accum[i+1] = trees_ccw_accum[i] + trees_ccw[i]\n trees_cw_accum[i+1] = trees_cw_accum[i] + trees_cw[i]\n\n #print(trees_ccw)\n #print(trees_cw)\n #print(trees_ccw_accum)\n #print(trees_cw_accum)\n\n dist_max = 0\n\n for i in range(1,N+1):\n offset_left = i\n n_left = offset_left + (N-offset_left) // 2 \n n_right = N - n_left \n\n\n\n '''\n [print('L', end='') for _ in range(offset_left-1)]\n print('L', end='_')\n for i_ in range(N-offset_left):\n if i_ % 2 == 0:\n print('R', end='')\n else:\n print('L', end='')\n print()\n print(offset_left, n_left, n_right)\n '''\n\n\n dist_1 = 2 * (trees_ccw_accum[n_left] - trees_ccw_accum[i-1]) + 2 * trees_cw_accum[n_right]\n dist_2 = 2 * (trees_cw_accum[n_left] - trees_cw_accum[i-1]) + 2 * trees_ccw_accum[n_right]\n\n\n\n if (N-offset_left) % 2 == 0:\n dist_1 -= trees_ccw[n_left-1]\n dist_2 -= trees_cw[n_left-1]\n else:\n dist_1 -= trees_cw[n_right-1]\n dist_2 -= trees_ccw[n_right-1]\n\n if dist_max < dist_1:\n dist_max = dist_1\n\n if dist_max < dist_2:\n dist_max = dist_2\n\n #print(n_left, dist_1, dist_2, dist_max)\n\n print(dist_max)\n return\n\nmain()", "import sys\ndef main():\n L, N = map(int, input().split())\n lines = sys.stdin.readlines()\n\n trees_ccw = [None] * N\n for i in range(N):\n trees_ccw[i] = int(lines[i])\n\n trees_cw = [L - trees_ccw[-(i+1)] for i in range(N)]\n trees_ccw_accum = [0] + [None] * N\n trees_cw_accum = [0] + [None] * N\n for i in range(N):\n trees_ccw_accum[i+1] = trees_ccw_accum[i] + trees_ccw[i]\n trees_cw_accum[i+1] = trees_cw_accum[i] + trees_cw[i]\n\n #print(trees_ccw)\n #print(trees_cw)\n #print(trees_ccw_accum)\n #print(trees_cw_accum)\n\n dist_max = 0\n\n for i in range(1,N+1):\n offset_left = i\n n_left = offset_left + (N-offset_left) // 2 \n n_right = N - n_left \n\n\n\n '''\n [print('L', end='') for _ in range(offset_left-1)]\n print('L', end='_')\n for i_ in range(N-offset_left):\n if i_ % 2 == 0:\n print('R', end='')\n else:\n print('L', end='')\n print()\n print(offset_left, n_left, n_right)\n '''\n\n\n dist_1 = 2 * (trees_ccw_accum[n_left] - trees_ccw_accum[i-1]) + 2 * trees_cw_accum[n_right]\n dist_2 = 2 * (trees_cw_accum[n_left] - trees_cw_accum[i-1]) + 2 * trees_ccw_accum[n_right]\n\n\n\n if (N-offset_left) % 2 == 0:\n dist_1 -= trees_ccw[n_left-1]\n dist_2 -= trees_cw[n_left-1]\n else:\n dist_1 -= trees_cw[n_right-1]\n dist_2 -= trees_ccw[n_right-1]\n\n if dist_max < dist_1:\n dist_max = dist_1\n\n if dist_max < dist_2:\n dist_max = dist_2\n\n #print(n_left, dist_1, dist_2, dist_max)\n\n print(dist_max)\n return\n\nmain()\n"]
['Runtime Error', 'Accepted']
['s377124989', 's385624914']
[3064.0, 53556.0]
[18.0, 407.0]
[1694, 1706]
p03187
u060938295
2,000
1,048,576
Takahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi. Each point on the circumference of the lake has a coordinate between 0 and L (including 0 but not L), which is the distance from the Takahashi's residence, measured counter-clockwise. There are N trees around the lake; the coordinate of the i-th tree is X_i. There is no tree at coordinate 0, the location of Takahashi's residence. Starting at his residence, Takahashi will repeat the following action: * If all trees are burnt, terminate the process. * Specify a direction: clockwise or counter-clockwise. * Walk around the lake in the specified direction, until the coordinate of a tree that is not yet burnt is reached for the first time. * When the coordinate with the tree is reached, burn that tree, stay at the position and go back to the first step. Find the longest possible total distance Takahashi walks during the process.
['# -*- coding: utf-8 -*-\n"""\nCreated on Sun Dec 30 09:04:16 2018\n\n@author: Yamazaki Kenichi\n"""\ninp = input().split()\n\n#L,N = map(int, input().split(\' \'))\nL,N = int(inp[0]),int(inp[1])\nX = [int(i) for i in inp[2:]]\n\nXr = [0] + X\nXl = [0]\nprint(N)\nfor i in range(-1,-N-1,-1):\n Xl.append(X[N+i] - L)\n\nYr = ["d"]\nfor i in range(0,N):\n Yr.append( Xr[i+1] - Xr[i])\n\nYl = ["d"]+[L-X[N-1]]\nYl += Yr[::-1]\n\nanswer = 0\nfor itr in range(1,7):\n sum = 0\n counter = 1\n while counter <= itr:\n sum += Yr[counter]\n counter += 1\n turn = counter-1\n counter2 = 1\n sum2 = sum\n while counter <= N:\n if counter2 % 2 ==1:\n sum2 += Yl[counter2//2+1]\n sum += sum2 \n else:\n sum2 += Yr[turn + counter2//2]\n sum += sum2\n counter += 1\n counter2 += 1\n answer = max(answer,sum)\n\nfor itr in range(1,7):\n sum = 0\n counter = 1\n while counter <= itr:\n sum += Yl[counter]\n counter += 1\n turn = counter-1\n counter2 = 1\n sum2 = sum\n while counter <= N:\n if counter2 % 2 ==1:\n sum2 += Yr[counter2//2+1]\n sum += sum2 \n else:\n sum2 += Yl[turn + counter2//2]\n sum += sum2\n counter += 1\n counter2 += 1\n answer = max(answer,sum)\nprint(answer)\n', '# -*- coding: utf-8 -*-\n"""\nCreated on Sun Dec 30 09:04:16 2018\n\n@author: Yamazaki Kenichi\n"""\n\nL,N = map(int, input().split())\nX = [int(input()) for i in range(N)]\n\nXr = [0] + X\nXl = [0]\n\nfor i in range(-1,-N-1,-1):\n Xl.append(X[N+i] - L)\n\nYr = ["d"]\nfor i in range(0,N):\n Yr.append( Xr[i+1] - Xr[i])\n\nYl = ["d"]+[L-X[N-1]]\nYl += Yr[::-1]\n\nanswer = 0\nfor itr in range(1,7):\n sum = 0\n counter = 1\n while counter <= itr:\n sum += Yr[counter]\n counter += 1\n turn = counter-1\n counter2 = 1\n sum2 = sum\n while counter <= N:\n if counter2 % 2 ==1:\n sum2 += Yl[counter2//2+1]\n sum += sum2 \n else:\n sum2 += Yr[turn + counter2//2]\n sum += sum2\n counter += 1\n counter2 += 1\n answer = max(answer,sum)\n\nfor itr in range(1,7):\n sum = 0\n counter = 1\n while counter <= itr:\n sum += Yl[counter]\n counter += 1\n turn = counter-1\n counter2 = 1\n sum2 = sum\n while counter <= N:\n if counter2 % 2 ==1:\n sum2 += Yr[counter2//2+1]\n sum += sum2 \n else:\n sum2 += Yl[turn + counter2//2]\n sum += sum2\n counter += 1\n counter2 += 1\n answer = max(answer,sum)\nprint(answer)\n', '# -*- coding: utf-8 -*-\n"""\nCreated on Sun Dec 30 09:04:16 2018\n\n@author: Yamazaki Kenichi\n"""\n#L,N = map(int, input().split(\' \'))\n\n\ninp = input().split()\ninp = [int(i) for i in inp]\nL, N = inp[0],inp[1]\nX = inp[2:]\n\nX = [0] + X \ntemp = L - X[1]\nans = temp\n\nitr1 = 0\nitr2 = N\n\na = N%2\n\nfor i in range(-(N-1),N):\n if (i+a)%2 == 1:\n itr1 += 1\n else:\n itr2 -= 1\n\n if X[i]-X[i-itr1] >=0:\n minus = X[i]-X[i-itr1]\n else:\n minus = L+(X[i]-X[i-itr1])\n\n if X[i+itr2]-X[i] >=0:\n plus = X[i+itr2]-X[i]\n else:\n plus = L+(X[i+itr2]-X[i])\n temp = temp - minus + plus\n print(temp)\n ans = max(ans,temp)\nprint(ans)\n', '# -*- coding: utf-8 -*-\n"""\nCreated on Sun Dec 30 09:04:16 2018\n\n@author: Yamazaki Kenichi\n"""\nL,N = map(int, input().split(\' \'))\nX = [int(input()) for i in range(N) ]\n\n#inp = input().split()\n\n#L, N = inp[0],inp[1]\n#X = inp[2:]\n\nX = [0] + X \ntemp = L - X[1]\nans = temp\n\nitr1 = 0\nitr2 = N\n\na = N%2\n\nfor i in range(-(N-1),N):\n if (i+a)%2 == 1:\n itr1 += 1\n else:\n itr2 -= 1\n\n if X[i]-X[i-itr1] >=0:\n minus = X[i]-X[i-itr1]\n else:\n minus = L+(X[i]-X[i-itr1])\n\n if X[i+itr2]-X[i] >=0:\n plus = X[i+itr2]-X[i]\n else:\n plus = L+(X[i+itr2]-X[i])\n temp = temp - minus + plus\n# print(temp)\n ans = max(ans,temp)\nprint(ans)\n\n \n\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s082721269', 's541447743', 's685648091', 's514335024']
[3192.0, 31156.0, 3064.0, 12716.0]
[18.0, 1841.0, 18.0, 927.0]
[1324, 1267, 706, 716]
p03187
u259418313
2,000
1,048,576
Takahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi. Each point on the circumference of the lake has a coordinate between 0 and L (including 0 but not L), which is the distance from the Takahashi's residence, measured counter-clockwise. There are N trees around the lake; the coordinate of the i-th tree is X_i. There is no tree at coordinate 0, the location of Takahashi's residence. Starting at his residence, Takahashi will repeat the following action: * If all trees are burnt, terminate the process. * Specify a direction: clockwise or counter-clockwise. * Walk around the lake in the specified direction, until the coordinate of a tree that is not yet burnt is reached for the first time. * When the coordinate with the tree is reached, burn that tree, stay at the position and go back to the first step. Find the longest possible total distance Takahashi walks during the process.
['a, b = map(int, input().split())\npos = 0\nlength = 0\ntree=[]\n\ndef position(b,i,pos,posA, posB):\n print(posA, posB)\n if(posA == posB):\n for j in range(b-1-i):\n neia, neib = (tree[j+1]-tree[j], tree[b-i-1-j]-tree[b-i-2-j])\n print(neia, neib)\n if(neia > neib):\n posB = 0\n break\n elif(neib > neia):\n posA = 0\n break\n target = max(posA, posB)\n print(posA, posB)\n if(posA == target):\n pos = tree[0]\n del tree[0]\n else:\n pos = tree[b-i-1]\n del tree[b-i-1]\n return (pos, target)\n\nfor i in range(b):\n tree.append(int(input()))\nfor i in range(b):\n print(tree)\n if(pos > tree[b-i-1]):\n pos, target = position(b,i,pos,abs(tree[0]+a-pos),abs(tree[b-i-1]-pos))\n else:\n pos, target = position(b,i,pos,abs(tree[0]-pos),a-abs(tree[b-i-1]-pos))\n length += target\n print(i+1, "----", pos, target, length) \nprint(length)', 'L, N = map(int, input().split())\nX=[0]\nsumL=[0]\nsumR=[0]\nfor i in range(N):\n X.append(int(input()))\n sumL.append(sumL[-1]+X[-1])\nfor i in range(N):\n sumR.append(sumR[-1]+L-X[N-i])\nsumR.append(0)\nsumR.reverse()\n#print(X)\n#print("sumL",sumL)\n#print("sumR",sumR)\nans = 0\nfor b in range(N+1):\n z = sumL[b] + sumR[b+1]\n if(b > 0):\n if(b <= N-b):\n ans = max(ans, z+sumL[b-1]+sumR[b+1]-2*sumR[N+1-(N-b-b)])\n \n else:\n ans = max(ans, z+sumL[b-1]+sumR[b+1]-2*sumL[b-(N-b)-1])\n \n if(b < N):\n if(b >= N-b):\n ans = max(ans, z+sumL[b]+sumR[b+2]-2*sumL[b-(N-b)])\n \n \n else:\n ans = max(ans, z+sumL[b]+sumR[b+2]-2*sumR[N+1-(N-b-b)+1])\n \n #print("------------------------")\nprint(ans)']
['Runtime Error', 'Accepted']
['s858434088', 's570909676']
[148432.0, 28476.0]
[1958.0, 915.0]
[991, 1092]
p03187
u314906167
2,000
1,048,576
Takahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi. Each point on the circumference of the lake has a coordinate between 0 and L (including 0 but not L), which is the distance from the Takahashi's residence, measured counter-clockwise. There are N trees around the lake; the coordinate of the i-th tree is X_i. There is no tree at coordinate 0, the location of Takahashi's residence. Starting at his residence, Takahashi will repeat the following action: * If all trees are burnt, terminate the process. * Specify a direction: clockwise or counter-clockwise. * Walk around the lake in the specified direction, until the coordinate of a tree that is not yet burnt is reached for the first time. * When the coordinate with the tree is reached, burn that tree, stay at the position and go back to the first step. Find the longest possible total distance Takahashi walks during the process.
['L, N = map(int, input())\nX = []\nfor _ in range(N):\n X.append(int(input()))\nX.sort()\n\nY = [L - x for x in X]\nans = 2*sum(X[:(N-1)//2+1]) + 2*sum(Y[-1:(N-1)//2:-1]) - min(X[(N-1)//2], Y[N//2])\n\nprint(ans)\n', 'L, N = map(int, input().split())\nX = [0]\nfor _ in range(N):\n X.append(int(input()))\n\ns = [0] * (N + 1)\nt = [0] * (N + 1)\nfor i in range(1, N + 1):\n s[i] = s[i-1] + X[i]\n t[i] = t[i-1] + (L - X[N - i + 1])\nY = [0] + [L - X[N - i] for i in range(N)]\n\n\n\n\ndef get_d(s, x, i):\n if i == N:\n return x[N]\n a = i + (N - i) // 2\n return (\n 2 * (s[a] - s[i-1] + L * (N - a) - s[N] + s[a]) -\n (x[a] if (N - i) % 2 == 0 else (L - x[a + 1]))\n )\n\n\nans = 0\nfor i in range(1, N + 1):\n ans = max(ans, get_d(s, X, i), get_d(t, Y, i))\n\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s425803715', 's890286430']
[3064.0, 39476.0]
[17.0, 985.0]
[206, 580]
p03187
u326609687
2,000
1,048,576
Takahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi. Each point on the circumference of the lake has a coordinate between 0 and L (including 0 but not L), which is the distance from the Takahashi's residence, measured counter-clockwise. There are N trees around the lake; the coordinate of the i-th tree is X_i. There is no tree at coordinate 0, the location of Takahashi's residence. Starting at his residence, Takahashi will repeat the following action: * If all trees are burnt, terminate the process. * Specify a direction: clockwise or counter-clockwise. * Walk around the lake in the specified direction, until the coordinate of a tree that is not yet burnt is reached for the first time. * When the coordinate with the tree is reached, burn that tree, stay at the position and go back to the first step. Find the longest possible total distance Takahashi walks during the process.
['import numpy as np\nimport sys\n\nL, N = map(int, input().split())\nX = np.array([int(sys.stdin.readline()) for _ in range(N)])\nY1 = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))\nY2 = Y1[::-1]\n\n\ndef func(n):\n return np.concatenate((np.full(n + 1, N - n, dtype=np.int), np.arange(N - n - 2, -1, -2), np.arange(N - n - 1, -1, -2)[::-1]))\n\n\nans = 0\nfor n in range(0, (N + 1) // 2):\n a = func(n)\n len1 = np.dot(a, Y1)\n len2 = np.dot(a, Y2)\n ans = max(ans, len1, len2)\n\nprint(ans)', 'import numpy as np\nimport sys\n\nL, N = map(int, input().split())\nX = np.array([int(sys.stdin.readline()) for _ in range(N)])\nY1 = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))\n\nX2 = X[::-1]\nY2 = Y1[::-1]\n\n\ndef func(n):\n return np.concatenate((np.full(n + 1, N - n, dtype=np.int), np.arange(N - n - 2, -1, -2), np.arange(N - n - 1, -1, -2)[::-1]))\n\n\nif N < 10000:\n ans = 0\n for n in range((N + 1) // 2):\n a = func(n)\n len1 = np.dot(a, Y1)\n len2 = np.dot(a, Y2)\n ans = max(ans, len1, len2)\n\n print(ans)\nelse:\n ans = 0\n cn = (N + 1) // 200\n len1 = [0] * cn\n len2 = [0] * cn\n can1 = [0] * cn\n can2 = [0] * cn\n for n in range(0, (N + 1) // 2, 100):\n a = func(n)\n i = n // 100\n len1[i] = np.dot(a, Y1)\n len2[i] = np.dot(a, Y2)\n ans = max(ans, len1[i], len2[i])\n\n for n, len_ in enumerate(len1):\n if len_ + 50 * L > ans:\n for j in range(100 * n, 100 * n + 100):\n ans = max(np.dot(func(j), Y1), ans)\n\n for n, len_ in enumerate(len2):\n if len_ + 50 * L > ans:\n for j in range(100 * n, 100 * n + 100):\n ans = max(np.dot(func(j), Y2), ans)\n print(ans)', 'import numpy as np\nimport sys\n\nL, N = map(int, input().split())\nX = np.array([int(sys.stdin.readline()) for _ in range(N)])\nY1 = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))\n\nX2 = X[::-1]\nY2 = Y1[::-1]\n\n\ndef func(n):\n return np.concatenate((np.full(n + 1, N - n, dtype=np.int), np.arange(N - n - 2, -1, -2), np.arange(N - n - 1, -1, -2)[::-1]))\n\n\nif N < 10000:\n ans = 0\n for n in range((N + 1) // 2):\n a = func(n)\n len1 = np.dot(a, Y1)\n len2 = np.dot(a, Y2)\n ans = max(ans, len1, len2)\n\n print(ans)\nelse:\n ans = 0\n cn = (N + 1) // 200\n len1 = [0] * cn\n len2 = [0] * cn\n can1 = [0] * cn\n can2 = [0] * cn\n for n in range(0, (N + 1) // 2, 100):\n a = func(n)\n i = n // 100\n len1[i] = np.dot(a, Y1)\n len2[i] = np.dot(a, Y2)\n can1[i] = (X[n + (N - n + 100)//2] - 2 * X[n] - (L - X[(N - n - 101)//2])) * 100\n can2[i] = (X2[n + (N - n + 100) // 2] - 2 * X2[n] - (L - X2[(N - n - 101) // 2])) * 100\n ans = max(ans, len1[i], len2[i])\n\n for n, (len_, can) in enumerate(zip(len1, can1)):\n if len_ + can > ans:\n for j in range(100 * n, 100 * n + 100):\n ans = max(np.dot(func(j), Y1), ans)\n\n for n, (len_, can) in enumerate(zip(len2, can2)):\n if len_ + can > ans:\n for j in range(100 * n, 100 * n + 100):\n ans = max(np.dot(func(j), Y2), ans)\n print(ans)', 'import numpy as np\nimport sys\n\nL, N = map(int, input().split())\nX = np.array([int(sys.stdin.readline()) for _ in range(N)])\nY1 = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))\n\nX2 = X[::-1]\nY2 = Y1[::-1]\n\n\ndef func(n):\n return np.concatenate((np.full(n + 1, N - n, dtype=np.int), np.arange(N - n - 2, -1, -2), np.arange(N - n - 1, -1, -2)[::-1]))\n\n\nif N < 10000:\n ans = 0\n for n in range((N + 1) // 2):\n a = func(n)\n len1 = np.dot(a, Y1)\n len2 = np.dot(a, Y2)\n ans = max(ans, len1, len2)\n\n print(ans)\nelse:\n ans = 0\n cn = (N + 1) // 200\n len1 = [0] * cn\n len2 = [0] * cn\n can1 = [0] * cn\n can2 = [0] * cn\n for n in range(0, (N + 1) // 2, 100):\n a = func(n)\n i = n // 100\n len1[i] = np.dot(a, Y1)\n len2[i] = np.dot(a, Y2)\n can1[i] = X[n + (N - n + 100)//2] - 2 * X[n] - (L - X[(N - n - 101)//2])\n can2[i] = X2[n + (N - n + 100) // 2] - 2 * X2[n] - (L - X2[(N - n - 101) // 2])\n ans = max(ans, len1[i], len2[i])\n\n for n, (len_, can) in enumerate(zip(len1, can1)):\n if len_ + can > ans:\n for j in range(100 * n, 100 * n + 100):\n ans = max(np.dot(func(j), Y1), ans)\n\n for n, (len_, can) in enumerate(zip(len2, can2)):\n if len_ + can > ans:\n for j in range(100 * n, 100 * n + 100):\n ans = max(np.dot(func(j), Y2), ans)\n print(ans)\n', 'import numpy as np\nimport sys\n\nL, N = map(int, input().split())\nX = np.array([int(sys.stdin.readline()) for _ in range(N)])\nY1 = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))\nY2 = Y1[::-1]\n\n\ndef func(n):\n return np.concatenate((np.full(n + 1, N - n, dtype=np.int), np.arange(N - n - 2, -1, -2), np.arange(N - n - 1, -1, -2)[::-1]))\n\n\nans = 0\nflag1 = True\nflag2 = True\n\nfor n in range(0, (N + 1) // 2):\n a = func(n)\n if flag1:\n len1 = np.dot(a, Y1)\n if ans - len1 > L:\n flag1 = False\n if flag2:\n break\n if flag2:\n len2 = np.dot(a, Y2)\n if ans - len2 > L:\n flag2 = False\n if flag1:\n break\n ans = max(ans, len1, len2)\n\nprint(ans)\n', 'import numpy as np\nimport sys\n\nL, N = map(int, input().split())\nX = np.array([int(sys.stdin.readline()) for _ in range(N)])\nY1 = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))\n\nX2 = X[::-1]\nY2 = Y1[::-1]\n\n\ndef func(n):\n return np.concatenate((np.full(n + 1, N - n, dtype=np.int), np.arange(N - n - 2, -1, -2), np.arange(N - n - 1, -1, -2)[::-1]))\n\n\nif N < 10000:\n ans = 0\n for n in range((N + 1) // 2):\n a = func(n)\n len1 = np.dot(a, Y1)\n len2 = np.dot(a, Y2)\n ans = max(ans, len1, len2)\n\n print(ans)\nelse:\n ans = 0\n cn = (N + 1) // 200\n len1 = [0] * cn\n len2 = [0] * cn\n can1 = [0] * cn\n can2 = [0] * cn\n for n in range(0, (N + 1) // 2, 100):\n a = func(n)\n i = n // 100\n len1[i] = np.dot(a, Y1)\n len2[i] = np.dot(a, Y2)\n ans = max(ans, len1[i], len2[i])\n\n print(ans)', 'import numpy as np\nimport sys\n\nL, N = map(int, input().split())\nX = np.array([int(sys.stdin.readline()) for _ in range(N)])\nY1 = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))\nY2 = Y1[::-1]\n\n\ndef func(n):\n return np.concatenate((np.full(n + 1, N - n, dtype=np.int), np.arange(N - n - 2, -1, -2), np.arange(N - n - 1, -1, -2)[::-1]))\n\n\nif N < 10000:\n ans = 0\n for n in range((N + 1) // 2):\n a = func(n)\n len1 = np.dot(a, Y1)\n len2 = np.dot(a, Y2)\n ans = max(ans, len1, len2)\n\n print(ans)\nelse:\n ans = 0\n for n in range(0, (N + 1) // 2, 100):\n a = func(n)\n i = n // 100\n len1 = np.dot(a, Y1)\n len2 = np.dot(a, Y2)\n ans = max(ans, len1, len2)\n\n print(ans)', 'import numpy as np\n\nL, N = map(int, input().split())\nX = np.array([int(input()) for _ in range(N)])\nY = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))\n\n\ndef func1(n):\n return np.concatenate((np.full(n + 1, N - n, dtype=np.int), np.arange(N - n - 2, -1, -2), np.arange(N - n - 1, -1, -2)[::-1]))\n\n\ndef func2(n):\n return np.concatenate((np.arange(N - n - 1, -1, -2), np.arange(N - n - 2, -1, -2)[::-1], np.full(n + 1, N - n, dtype=np.int)))\n\n\nans = 0\nfor n in range((N + 1) // 2):\n len_ = np.dot(func1(n), Y)\n ans = max(ans, len_)\n len_ = np.dot(func2(n), Y)\n ans = max(ans, len_)\n\nprint(ans)\n', 'import numpy as np\nimport sys\n\nL, N = map(int, input().split())\nX = np.array([int(sys.stdin.readline()) for _ in range(N)])\nX2 = X[::-1]\nY1 = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))\nY2 = Y1[::-1]\n\n\ndef func(n):\n return np.concatenate((np.full(n + 1, N - n, dtype=np.int), np.arange(N - n - 2, -1, -2), np.arange(N - n - 1, -1, -2)[::-1]))\n\n\nif N < 10000:\n ans = 0\n for n in range((N + 1) // 2):\n a = func(n)\n len1 = np.dot(a, Y1)\n len2 = np.dot(a, Y2)\n ans = max(ans, len1, len2)\n \n print(ans)\nelse:\n ans = 0\n len1 = [0] * (N + 1) // 200\n len2 = [0] * (N + 1) // 200\n can1 = [0] * (N + 1) // 200\n can2 = [0] * (N + 1) // 200\n for n in range(0, (N + 1) // 2, 100):\n a = func(n)\n i = n // 100\n len1[i] = np.dot(a, Y1)\n len2[i] = np.dot(a, Y2)\n can1[i] = X[n + (N - n + 100)//2] - 2 * X[n] - (L - X[(N - n - 101)//2])\n can2[i] = X2[n + (N - n + 100) // 2] - 2 * X2[n] - (L - X2[(N - n - 101) // 2])\n ans = max(ans, len1[n], len2[n])\n \n for n, len_, can in enumerate(zip(len1, can1)):\n if len + can > ans:\n for j in range(100 * n, 100 * n + 100):\n ans = max(np.dot(func(j), Y1), ans)\n \n for n, len_, can in enumerate(zip(len2, can2)):\n if len + can > ans:\n for j in range(100 * n, 100 * n + 100):\n ans = max(np.dot(func(j), Y2), ans)\n print(ans)\n', 'import numpy as np\nimport sys\n\nL, N = map(int, input().split())\nX = np.array([int(sys.stdin.readline()) for _ in range(N)])\nX2 = L - X[::-1]\nY1 = np.concatenate(([X[0]], X[1:] - X[:-1], [L - X[-1]]))\nY2 = Y1[::-1]\nZ = np.concatenate((np.arange(N, -1, -2), np.arange(N - 1, -1, -2)[::-1]))\n\n\ndef myfunc(n, x):\n return x[n + (N - n + 1)//2 - 1] - 2 * x[n - 1] - (L - x[N - (N - n + 1)//2])\n\n\nlen1 = np.dot(Z, Y1)\nlen2 = np.dot(Z, Y2)\nx1 = X.tolist()\nx2 = X2.tolist()\nans = max(len1, len2)\nfor n in range(1, (N + 1) // 2):\n len1 += myfunc(n, x1)\n len2 += myfunc(n, x2)\n ans = max(ans, len1, len2)\n\nprint(ans)']
['Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s006122670', 's037505309', 's347949329', 's517645781', 's545141589', 's614787510', 's656360116', 's788809907', 's906728463', 's000927099']
[23072.0, 22944.0, 23040.0, 51232.0, 21840.0, 22948.0, 21860.0, 21880.0, 21860.0, 36424.0]
[2109.0, 2109.0, 857.0, 871.0, 1660.0, 847.0, 844.0, 2109.0, 353.0, 694.0]
[494, 1218, 1433, 1418, 752, 873, 743, 616, 1463, 617]
p03187
u371467115
2,000
1,048,576
Takahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi. Each point on the circumference of the lake has a coordinate between 0 and L (including 0 but not L), which is the distance from the Takahashi's residence, measured counter-clockwise. There are N trees around the lake; the coordinate of the i-th tree is X_i. There is no tree at coordinate 0, the location of Takahashi's residence. Starting at his residence, Takahashi will repeat the following action: * If all trees are burnt, terminate the process. * Specify a direction: clockwise or counter-clockwise. * Walk around the lake in the specified direction, until the coordinate of a tree that is not yet burnt is reached for the first time. * When the coordinate with the tree is reached, burn that tree, stay at the position and go back to the first step. Find the longest possible total distance Takahashi walks during the process.
['l,n=map(int,input().split())\nx=[int(input()) for i in range(n)]\ny=x[::-1]\na=[]\nb=[]\nfor j in x:\n a=abs(0-x[i])\n b=abs(l-y[i])\ns=max(a[0],b[0])\nfor k in range(1,n):\n e+=max(a[k]+b[x])\nprint(e) ', 'L,N = list(map(int,input().split()))\nX=[]\nY=[]\nSX=[0]\nSY=[0]\nsx=0\nsy=0\nfor i in range(N):\n x=int(input())\n X.append(x)\n sx+=x\n SX.append(sx)\n Y.append(L-x)\n sy+=L-x\n SY.append(sy) \n\nmax_score=0 \nfor i in range(N):\n if i>N-i-1:\n max_score=max(2*(SX[i]-SX[2*i-N])+2*(SY[N]-SY[i+1])+Y[i],max_score)\n elif i<N-i-1:\n max_score=max(2*(SX[i]-SX[0])+2*(SY[2*i+2]-SY[i+1])+X[i],max_score)\n\n \n ind = min(i,N-i-1)\n max_score=max(2*(SX[i]-SX[i-ind])+2*(SY[i+ind+1]-SY[i+1])+X[i],max_score)\n max_score=max(2*(SX[i]-SX[i-ind])+2*(SY[i+ind+1]-SY[i+1])+Y[i],max_score)\n\n\nprint(max_score)\n#copy code.']
['Runtime Error', 'Accepted']
['s404069009', 's568653199']
[12580.0, 38544.0]
[328.0, 1185.0]
[201, 637]
p03187
u858748695
2,000
1,048,576
Takahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi. Each point on the circumference of the lake has a coordinate between 0 and L (including 0 but not L), which is the distance from the Takahashi's residence, measured counter-clockwise. There are N trees around the lake; the coordinate of the i-th tree is X_i. There is no tree at coordinate 0, the location of Takahashi's residence. Starting at his residence, Takahashi will repeat the following action: * If all trees are burnt, terminate the process. * Specify a direction: clockwise or counter-clockwise. * Walk around the lake in the specified direction, until the coordinate of a tree that is not yet burnt is reached for the first time. * When the coordinate with the tree is reached, burn that tree, stay at the position and go back to the first step. Find the longest possible total distance Takahashi walks during the process.
['#!/usr/bin/env python3\nfrom itertools import accumulate\nL, N = map(int, input().split())\nX = [int(input()) for _ in range(N)]\nY = [L - x for x in X][::-1]\n\nsx = [0] + list(accumulate(X))\nsy = [0] + list(accumulate(Y))\n\nans = 0\nfor i in range(N):\n j = N - i - 1\n mn = min(i, j)\n\n now = X[i]\n now += 2 * (sx[i] - sx[i - mn]) + 2 * (sy[j] - sy[j - mn - (i < j)])\n print(i - mn)\n ans = max(ans, now)\n\n now = Y[j]\n now += 2 * (sx[i] - sx[i - mn - (i > j)]) + 2 * (sy[j] - sy[j - mn])\n ans = max(ans, now)\n\nprint(ans)\n', '#!/usr/bin/env python3\nfrom itertools import accumulate\nL, N = map(int, input().split())\nX = [0] + [int(input()) for _ in range(N)]\nY = [0] + [L - x for x in X[1:]][::-1]\n\nsx = list(accumulate(X))\nsy = list(accumulate(Y))\n\nans = 0\nfor i in range(1, N + 1):\n j = N - i\n\n mn = min(i - 1, j)\n now = X[i]\n now += 2 * (sx[i - 1] - sx[i - 1 - mn]) + 2 * (sy[j] - sy[j - mn - (j > mn)])\n ans = max(ans, now)\n\nfor i in range(N):\n j = N - i\n\n mn = min(i, j - 1)\n now = Y[j]\n now += 2 * (sx[i] - sx[i - mn - (i > mn)]) + 2 * (sy[j - 1] - sy[j - 1 - mn])\n ans = max(ans, now)\n\nprint(ans)\n\n']
['Wrong Answer', 'Accepted']
['s354571369', 's295167996']
[40288.0, 41044.0]
[1099.0, 1046.0]
[539, 608]
p03200
u022871813
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the following operation: * Choose i (1 \leq i < N) such that the i-th piece from the left is showing black and the (i+1)-th piece from the left is showing white, then flip both of those pieces. That is, the i-th piece from the left is now showing white and the (i+1)-th piece from the left is now showing black. Find the maximum possible number of times this operation can be performed.
["from sys import stdin\n\ns = stdin.readline().rstrip()\n\ncount = 0\nwhite = 0\nfor i, stone in enumerate(s):\n if stone == 'w':\n count += (i - white)\n white +=1\nprint(count)\n", "from sys import stdin\n\ns = stdin.readline().rstrip()\n\ncount = 0\nwhite = 0\nfor i, stone in enumerate(s):\n if stone == 'W':\n count += (i - white)\n white +=1\nprint(count)\n"]
['Wrong Answer', 'Accepted']
['s437433903', 's125481202']
[3500.0, 3500.0]
[40.0, 67.0]
[185, 185]
p03200
u023229441
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the following operation: * Choose i (1 \leq i < N) such that the i-th piece from the left is showing black and the (i+1)-th piece from the left is showing white, then flip both of those pieces. That is, the i-th piece from the left is now showing white and the (i+1)-th piece from the left is now showing black. Find the maximum possible number of times this operation can be performed.
['s=input()\nt=list(s).count("W")\nA=[i for i,x in enumerate (list(s)) if x=="W"]\nprint(int(sum(A)-t*(t+1)/2))', 's=input()\nt=list(s).count("W")\nA=[i for i,x in enumerate (list(s)) if x=="W"]\nprint(int(sum(A)-t*(t-1)/2))\n']
['Wrong Answer', 'Accepted']
['s811559395', 's018456959']
[12620.0, 12620.0]
[42.0, 42.0]
[106, 107]
p03200
u026075806
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the following operation: * Choose i (1 \leq i < N) such that the i-th piece from the left is showing black and the (i+1)-th piece from the left is showing white, then flip both of those pieces. That is, the i-th piece from the left is now showing white and the (i+1)-th piece from the left is now showing black. Find the maximum possible number of times this operation can be performed.
['import bisect\n\ndef main():\n _ = int(input())\n nums = list(map(int, input().split()))\n n = len(nums)\n nums.sort()\n used = [False] * n\n \n cnt = 0\n \n\n for cur in reversed(range(n)):\n continue\n if used[cur]:\n continue\n num = nums[cur]\n power_of_2 = 1 << len("{:b}".format(num))\n\n pair = power_of_2 - num\n\n idx = bisect.bisect_left(nums, pair)\n if idx >= cur or nums[idx] != pair:\n \n continue\n\n while used[idx]:\n idx += 1\n\n if nums[idx] == pair:\n used[idx] = True\n cnt += 1\n\n #print(idx, num, power_of_2, pair)\n #print(cnt, nums, used)\n\n print(cnt)\n\n return\n\nmain()', "def main():\n txt = input()\n\n w_cnt = 0\n cnt = 0\n for char in reversed(txt):\n if char == 'W':\n w_cnt += 1\n else:\n cnt += w_cnt\n print(cnt)\n return\n\nmain()"]
['Runtime Error', 'Accepted']
['s305336637', 's354765208']
[3500.0, 3500.0]
[20.0, 33.0]
[786, 207]
p03200
u046432236
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the following operation: * Choose i (1 \leq i < N) such that the i-th piece from the left is showing black and the (i+1)-th piece from the left is showing white, then flip both of those pieces. That is, the i-th piece from the left is now showing white and the (i+1)-th piece from the left is now showing black. Find the maximum possible number of times this operation can be performed.
["a=input()\nlen_a=len(a)\n#maxpoint=len_a * (len_a+1) / 2\npoint=0\nhowmany_w=0\nfor a_n in range(len(a)):\n\tif a[a_n]=='W':\n\t\tpoint+=(len_a-a_n)\n\t\thowmany_w+=1\n\nmaxpoint = (len_a - howmany_w/2 + 1/2) * (howmany_w)\n\nkaisu=maxpoint-point\nprint(kaisu)", "a=input()\nlen_a=len(a)\n#maxpoint=len_a * (len_a+1) / 2\npoint=0\nhowmany_w=0\nfor a_n in range(len(a)):\n\tif a[a_n]=='W':\n\t\tpoint+=(len_a-a_n)\n\t\thowmany_w+=1\n\nmaxpoint = (len_a - howmany_w/2 + 1/2) * (howmany_w)\n\nkaisu=maxpoint-point\nprint(int(kaisu))"]
['Wrong Answer', 'Accepted']
['s601818258', 's179157724']
[3500.0, 3500.0]
[78.0, 82.0]
[242, 247]
p03200
u050698451
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the following operation: * Choose i (1 \leq i < N) such that the i-th piece from the left is showing black and the (i+1)-th piece from the left is showing white, then flip both of those pieces. That is, the i-th piece from the left is now showing white and the (i+1)-th piece from the left is now showing black. Find the maximum possible number of times this operation can be performed.
["S = list(input())\nans = 0\n# print(S)\ncl1 = []\ncl2 = []\nwhile True:\n\tfor i in range(len(S)-1):\n\t\tif S[i] == 'B' and S[i+1] == 'W' and i not in cl1:\n\t\t\tS[i] = 'W'\n\t\t\tS[i+1] = 'B'\n\t\t\tans += 1\n\t\t\tcl1.append(i)\n\t\telif S[i] == 'W' and S[i+1] == 'B' and i not in cl1:\n\t\t\tS[i] = 'B'\n\t\t\tS[i+1] = 'W'\n\t\t\tans += 1\n\t\t\tcl1.append(i)\n\t\telse:\n\t\t\tpass\n\t\t# print(S)\n\tif cl1 == cl2:\n\t\tbreak\n\telse:\n\t\tcl1, cl2 = cl2, cl1\n\t\tcl1 = []\nprint(ans)\n", "S = list(input())\nmove = 0\nans = 0\nfor i in range(len(S)):\n\tif S[i] == 'B':\n\t\tmove += 1\n\telse:\n\t\tans += move\nprint(ans)\n"]
['Time Limit Exceeded', 'Accepted']
['s124563389', 's051358189']
[5272.0, 4840.0]
[2104.0, 60.0]
[424, 120]