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
|
---|---|---|---|---|---|---|---|---|---|---|
p02682 | u165318982 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = list(map(int, input().split()))\n\nans = 0\nwhile K:\n if A:\n ans += 1\n A -= 1\n elif B:\n B -= 1\n else:\n ans -= 1\n\nprint(str(ans))', 'A, B, C, K = list(map(int, input().split()))\n\nans = 0\nif A > K:\n print(K)\nelif A == K:\n print(A)\nelif A + B >= K:\n print(A)\nelse:\n print(A - (K - A - B))'] | ['Time Limit Exceeded', 'Accepted'] | ['s950746149', 's523066961'] | [8988.0, 9108.0] | [2206.0, 27.0] | [153, 157] |
p02682 | u167681994 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a , b , c , k = map(int, input().split())\n\nif a + b = k:\n print(a)\nelse:\n print(2*a - k + b)\n\n', 'a , b , c , k = map(int, input().split())\n\nif a > k:\n print(k)\nelif a + b >= k:\n print(a)\nelse:\n print(2*a - k + b) \n'] | ['Runtime Error', 'Accepted'] | ['s976467460', 's120393507'] | [8812.0, 9116.0] | [25.0, 27.0] | [97, 121] |
p02682 | u174158426 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['one = int(input())\nzero = int(input())\nng_one = int(input())\ncard = int(input())\n\ncard_list = []\nfor i in range(one):\n card_list.append(1)\nfor i in range(zero):\n card_list.append(0)\nfor i in range(ng_one):\n card_list.append(-1)\n\nprint(sum(card_list[:card]))', 'one,zero,ng_one,card = map(int, input().split())\n\nif card < one:\n print(card)\nelif card <= one+zero:\n print(one)\nelse:\n print(one - (card - one - zero))'] | ['Runtime Error', 'Accepted'] | ['s918914946', 's198952355'] | [9140.0, 9180.0] | [21.0, 24.0] | [266, 161] |
p02682 | u176165272 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a = list(map(int,input().split()))\nA = a[0]\nB = a[1]\nC = a[2]\nK = a[3]\nif A > k :\n print(A)\nelif (A + B) > K:\n print(A)\nelse:\n print(A-(K-A-B))', 'a = list(map(int,input().split()))\nA = a[0]\nB = a[1]\nC = a[2]\nK = a[3]\nif A > K :\n print(K)\nelif (A + B) > K:\n print(A)\nelse:\n print(A-(K-A-B))\n'] | ['Runtime Error', 'Accepted'] | ['s626070114', 's247189351'] | [9184.0, 9060.0] | [22.0, 26.0] | [152, 153] |
p02682 | u179581055 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = map(int, input().split())\nif a >= k:\n print(a)\nelse:\n print(a - ((k-a)-b)', 'a, b, c, k = map(int, input().split())\nif a >= k:\n print(k)\nelse:\n print(a - ((k-a)-b)', 'a, b, c, k = map(int, input().split())\nif a >= k:\n print(k)\nelse:\n print(a - ((k-a)-b))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s265499488', 's634793780', 's884926019'] | [9032.0, 9040.0, 9156.0] | [25.0, 24.0, 25.0] | [92, 92, 93] |
p02682 | u181785042 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['import sys\na,b,c,k=map(int,input().split())\nt=0\nfor i in range(a):\n t+=1\n for j in range(b):\n t+=0\n if a+b>=k:\n print(t)\n sys.exit()\n else:\n for p in range(k-a-b):\n t+=-1\n print(t)\n sys.exit()', 'a,b,c,k=map(int,input().split())\nif a<k:\n print(k)\nelif a+b>k:\n print(a)\nelif a+b+c>k:\n print(a-(k-a-b))', 'import sys\na,b,c,k=map(int,input().split())\nif a+b>c:\n print(a+b)\nelse:\n print(a+b+c-k-2)', 'a,b,c,k=map(int,input().split())\nif a>k:\n print(k)\nelse:\n if a+b>k:\n print(a)\n else:\n print(a-(k-a-b))'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s251444037', 's265000354', 's834758866', 's235811768'] | [9196.0, 9172.0, 9168.0, 9200.0] | [2205.0, 21.0, 22.0, 25.0] | [297, 113, 95, 125] |
p02682 | u182178426 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['2 1 1 3', 'a,b,c,k = map(int,input().split())\n\nif k<=a:\n print(k)\nelif a<k<=a+b:\n print(a)\nelse:\n print(a-(k-(a+b)))'] | ['Runtime Error', 'Accepted'] | ['s588891937', 's373167225'] | [9008.0, 9168.0] | [23.0, 22.0] | [7, 114] |
p02682 | u185405877 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,d = list(map(int, input().split()))\nif a+b>=d:\n print(d)\nelse:\n print(a-(d-a-b))', 'a,b,c,d = list(map(int, input().split()))\nif a+b>=d:\n print(a)\nelse:\n print(a-(d-a-b)', 'a,b,c,d= list(map(int, input().split()))\nif d<a:\n print(d)\nelif d<a+b:\n print(a)\nelse:\n print(a-(d-a-b))'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s122729774', 's694822488', 's968430530'] | [9164.0, 8968.0, 9156.0] | [24.0, 21.0, 22.0] | [92, 91, 113] |
p02682 | u193582576 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['*a, k = map(int, input().split())\n\nprint(a, k)\ns = 0\nb = [1, 0, -1]\nfor i, j in enumerate(a):\n n = min(j, k)\n k -= n\n s = s + b[i]*n\nprint(s)\n', '*a, k = map(int, input().split())\n\nprint(a, k)\ns = 0\nb = [1, 0, -1]\nfor i, j in enumerate(a):\n n = min(j, k)\n k -= n\n s = s + b[i]*n\n if k<=0:\n break\nprint(s)\n', '*a, k = map(int, input().split())\n\ns = 0\nb = [1, 0, -1]\nfor i, j in enumerate(a):\n n = min(j, k)\n k -= n\n s = s + b[i]*n\n if k<=0:\n break\nprint(s)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s127821323', 's905494887', 's011848142'] | [9176.0, 9176.0, 9176.0] | [23.0, 22.0, 19.0] | [151, 178, 166] |
p02682 | u193880030 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | [' = input()\n \nA, B, C, K = map(int, a.split())\n \nif A >= K:\n print(K)\nelif A + B >= K > A:\n print(A)\nelse:\n print(- B - C +K)', ' = input()\n \nA, B, C, K = map(int, a.split())\n \nif A >= K:\n print(A)\nelif A + B >= K > A:\n print(A)\nelse:\n print(- B - C +K)', 'a = input()\n \nA, B, C, K = map(int, a.split())\n \nif A >= K:\n print(K)\nelif A + B >= K > A:\n print(A)\nelse:\n print(2 * A + B - K)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s543545697', 's737977969', 's019021322'] | [8936.0, 8856.0, 9136.0] | [23.0, 23.0, 21.0] | [127, 127, 131] |
p02682 | u197237612 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = map(int, input().split())\n\nif k - a <= 0:\n print(k)\nelif k - a + b <= 0:\n print(a)\nelse:\n k -= (a + b)\n for i in range(1, c+1):\n if k - i == 0:\n print(a-i)\n \n ', 'a, b, c, k = map(int, input().split())\n\nif a >= k:\n print(k)\nelif a + b >= k:\n print(a)\nelse:\n print(a + (-1)*(k - (a + b)))'] | ['Wrong Answer', 'Accepted'] | ['s825794141', 's191895741'] | [8996.0, 9132.0] | [2206.0, 25.0] | [190, 127] |
p02682 | u204616996 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K=map(input().split())\nif A>=K:\n print(K)\nelif A+B>=K:\n print(A)\nelse:\n print(A+A+B-K)', 'A,B,C,K=map(int,input().split())\nif A>=K:\n print(K)\nelif A+B>=K:\n print(A)\nelse:\n print(A+A+B-K)\n'] | ['Runtime Error', 'Accepted'] | ['s814612004', 's423940851'] | [9060.0, 9152.0] | [21.0, 24.0] | [95, 100] |
p02682 | u206352909 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K=map(int,input().split())\n\nans=0\n\nif A>=K:\n ans=A\nelif B>=(K-A):\n ans=A\nelse:\n ans=A-(K-A-B)', 'A,B,C,K=map(int,input().split())\n\nans=0\n\nif A>=K:\n ans=K\nelif B>=(K-A):\n ans=A\nelse:\n ans=A-(K-A-B)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s010408302', 's874836591'] | [9192.0, 9180.0] | [24.0, 22.0] | [108, 119] |
p02682 | u207400417 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a = list(map(int, input().split())) \nmax = 0\nfor x in range(0,a[0]):\n if x <= a[3]:\n for y in range(0,a[1]):\n if x + y <= a[3]:\n for z in range(0,a[2]):\n if x + y + z == a[3]:\n if max <= x -z:\n max = x-z\n \nprint(max)', 'one, zero, dif_one,num = map(int,input().split())\nif num <= one:\n print(num)\nelif num <= one + zero:\n print(one)\nelse:\n print(one-(num-one-zero))\n '] | ['Wrong Answer', 'Accepted'] | ['s543943578', 's399826771'] | [9140.0, 9164.0] | [2206.0, 20.0] | [278, 151] |
p02682 | u209911545 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k=map(int,input().split())\nif a > k:\n vis = [1]*a\nelif a+b > k:\n vis=[1]*a+[0]*b\nelse:\n vis=[1]*a+[0]*b+[-1]*c\n \ns = 0\n\nsum(vis[0:k])\n \nprint(s)', 'a,b,c,k=map(int,input().split())\nvis=[1]*a + [0]*b + [-1]*c\ns = 0\n\nsum(vis[0:k])\n \nprint(s)', 'a,b,c,k=map(int,input().split())\nif a >= k:\n vis = k\nelif a + b >= k:\n vis = a\nelse:\n vis= a + (-1*(k-a-b))\n \nprint(vis)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s083855778', 's196041510', 's553581902'] | [3463724.0, 3288724.0, 9172.0] | [2290.0, 2289.0, 24.0] | [165, 94, 132] |
p02682 | u215286521 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['from math import floor,ceil,sqrt,factorial,log\nfrom collections import Counter, deque\nfrom functools import reduce\nimport numpy as np\ndef S(): return input()\ndef I(): return int(input())\ndef MS(): return map(str,input().split())\ndef MI(): return map(int,input().split())\ndef FLI(): return [int(i) for i in input().split()]\ndef LS(): return list(MS())\ndef LI(): return list(MI())\ndef LLS(): return [list(map(str, l.split() )) for l in input()]\ndef LLI(): return [list(map(int, l.split() )) for l in input()]\ndef LLSN(n: int): return [LS() for _ in range(n)]\ndef LLIN(n: int): return [LI() for _ in range(n)]\n\nA,B,C,K = MI()\n\ndef result(K):\n if K <= 0:\n print(sum)\n exit()\n\nsum = 0\nsum += K\n\nK -= A\n\nresult(K)\n\nK -= B\nresult(K)\n\nsum -= K\n\nresult(K)', 'from math import floor,ceil,sqrt,factorial,log\nfrom collections import Counter, deque\nfrom functools import reduce\nimport numpy as np\ndef S(): return input()\ndef I(): return int(input())\ndef MS(): return map(str,input().split())\ndef MI(): return map(int,input().split())\ndef FLI(): return [int(i) for i in input().split()]\ndef LS(): return list(MS())\ndef LI(): return list(MI())\ndef LLS(): return [list(map(str, l.split() )) for l in input()]\ndef LLI(): return [list(map(int, l.split() )) for l in input()]\ndef LLSN(n: int): return [LS() for _ in range(n)]\ndef LLIN(n: int): return [LI() for _ in range(n)]\n\nA,B,C,K = MI()\n\ndef result(K):\n if K <= 0:\n print(sum)\n exit()\n\nsum = 0\n\nif K <= A:\n sum += K\n print(sum)\n exit()\nelse:\n sum += A\n K -= A\n\nK -= B\nresult(K)\n\nsum -= K\n\nprint(sum)'] | ['Wrong Answer', 'Accepted'] | ['s553449001', 's152617412'] | [27016.0, 27176.0] | [104.0, 106.0] | [754, 808] |
p02682 | u217303170 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = map(int, input().split())\nif (1*a)+(0*b)+(-1*c) <= 0:\n print(0)\nelse:\n print((1*a)+(0*b)+(-1*c))\n', 'a, b, c, k = map(int, input().split())\nprint(min(k, a) - max(0,k-a-b))'] | ['Wrong Answer', 'Accepted'] | ['s273033679', 's817803296'] | [9168.0, 9112.0] | [20.0, 19.0] | [116, 70] |
p02682 | u217836256 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['N = input()\nn =[int(x) for x in N]\nA = n[0]\nB = n[1]\nC = n[2]\nK = n[3]\nif A>=K:\n print(K)\nelif K <= A+B:\n print(A)\nelse:\n print(2*A+B-K)', 'N = input()\nn =[int(x) for x in N.split()]\nA = n[0]\nB = n[1]\nC = n[2]\nK = n[3]\nif A>=K:\n print(K)\nelif K <= A+B:\n print(A)\nelse:\n print(2*A+B-K)'] | ['Runtime Error', 'Accepted'] | ['s927864229', 's840046697'] | [9188.0, 9124.0] | [22.0, 23.0] | [145, 153] |
p02682 | u218506594 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k=map(int, input().split())\nans =0\nif a>=k:\n\tans+=k\nelse:\n\tans+=a\nif =k-a-b>=1:\n\tans+=-(k-a-b)\nprint(ans)\n', 'a,b,c,k=map(int, input().split())\nans =0\nif a>=k:\n\tans+=k\nelse:\n\tans+=a\nif k-a-b>=1:\n\tans+=-(k-a-b)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s576929028', 's460147412'] | [8960.0, 9180.0] | [23.0, 23.0] | [112, 110] |
p02682 | u224825657 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = input().split(" ")\n\n"""\nprint(a)\nprint(b)\nprint(c)\nprint(k)\n"""\nif a >= k:\n print(a)\n\nelif (a + b) >= k:\n print(a)\n\nelse:\n print(a-c)\n', 'a, b, c, k = map(int, input().split(" "))\n\n\n"""\nprint(a)\nprint(b)\nprint(c)\nprint(k)\n"""\nif a >= k:\n print(k)\n\nelif (a + b) >= k:\n print(a)\n\nelse:\n print(a - (k - a - b))\n'] | ['Runtime Error', 'Accepted'] | ['s630576514', 's635608947'] | [8884.0, 9156.0] | [21.0, 23.0] | [156, 179] |
p02682 | u225020286 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | [',B,C,K=map(int,input().split())\nans=0\nif A>=K:\n ans=K\nelif A<K and K<=A+B:\n ans=A\nelse :\n ans=A-(K-A-B)\nprint(ans)', 'A,B,C,K=map(int,input().split())\nans=0\nif A>=K:\n ans=K\nelif A<K and K<=A+B:\n ans=A\nelse :\n ans=A-(K-A-B)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s306981566', 's537412548'] | [8944.0, 9168.0] | [23.0, 20.0] | [117, 118] |
p02682 | u225627575 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K = map(int,input().split())\nif A < K:\n print(K)\nelif K <= A+B:\n print(A)\nelse:\n print(A-(K-A-B))', 'A,B,C,K = map(int,input().split())\nif K<A:\n print(K)\nelif K <= A+B:\n print(A)\nelse:\n print(A-(K-A-B))'] | ['Wrong Answer', 'Accepted'] | ['s663315451', 's639449104'] | [9168.0, 9168.0] | [21.0, 21.0] | [112, 110] |
p02682 | u227210643 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K=map(int,input().split())\nif (A>=K):\n print(K)\nelse:\n K = K-A\n if (B>=D):\n print(A)\n else:\n K = K-B\n print(A-K)', 'A,B,C,K=map(int,input().split())\nif (A>=K):\n\tprint(K)\nelse:\n\tK = K-A\n\tif (B>=D):\n\t\tprint(A)\n\telse:\n\t\tK = K-B\n\t\tprint(A-K)', 'A,B,C,K=map(int,input().split())\nif (A>=K):\n print(K)\nelse:\n D = K-A\n if (B>=D):\n print(D)\n else:\n print(A-D)', 'A,B,C,K=map(int,input().split())\nif (A>=K):\n\tprint(K)\nelse:\n\tK = K-A\n\tif (B>=K):\n\t\tprint(A)\n\telse:\n\t\tK = K-B\n\t\tprint(A-K)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s073194034', 's494748769', 's720620476', 's754781034'] | [9160.0, 9208.0, 9176.0, 9176.0] | [24.0, 20.0, 23.0, 23.0] | [131, 121, 119, 121] |
p02682 | u228303592 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = int(input())\n\nif k <= a:\n print(k)\nelif k <= a + b:\n print(a)\nelse:\n print(a-(k - (a + b)))', '#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n int a, b, c, k;\n cin >> a >> b >> c >> k;\n if(k <= a) cout << k << endl;\n else if(k <= a + b) cout << a << endl;\n else cout << a - (k - a - b) << endl;\n return 0;\n}\n', 'a, b, c, k = map(int, input().split())\n\nif k <= a:\n print(k)\nelif k <= a + b:\n print(a)\nelse:\n print(a-(k - (a + b)))\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s700838633', 's748601999', 's985501652'] | [9152.0, 8996.0, 9160.0] | [24.0, 23.0, 23.0] | [107, 232, 121] |
p02682 | u233841219 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = map(int, input().split())\ns = a-c\nif s > 0:\n print(s)\nelse:\n print(0)', 'a, b, b, k = map(int, input().split())\np = min(a, k)\ns = p\nk -= p\n \nq = min(b, k)\nk -= q\ns -= k\n\nr = min(c, k)\nk -= r\ns -= k\nprint(s)', 'a, b, c, k = map(int, input().split())\np = min(a, k)\ns = p\nk -= p\n \nq = min(b, k)\nk -= q\ns -= k\n \nr = min(c, k)\nk -= r\ns -= k\nprint(s)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s833437221', 's991593372', 's405183538'] | [9164.0, 9128.0, 9156.0] | [21.0, 22.0, 23.0] | [84, 133, 134] |
p02682 | u235783479 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = map(int, input().split())\n\nscore = 0\nif A >= K:\n K -=A\n score += A\nelse:\n score = K\n print(score)\n exit()\n\nif B >= K:\n K -=B\nelse:\n print(score)\n exit()\n\nif C >= K:\n K -=B\n score -= C\nelse:\n score -= K\n print(score)\n exit()\nprint(score)', 'A, B, C, K = map(int, input().split())\n\nif A >= K:\n print(A)\nelif A+B >=K:\n print(A)\nelse A+B+C >=K:\n nc = K - A - B\n print(A - nc)\n\n', 'A, B, C, K = map(int, input().split())\n\nif A >= K:\n print(A)\nelif A+B >=K:\n print(K)\nelif A+B+C >=K:\n nc = K - A - B\n print(A - nc)\nelse:\n print(A-C)\n\n', 'A, B, C, K = map(int, input().split())\n\nprint(max(A, K))', 'A, B, C, K = map(int, input().split())\n\nscore = 0\nif A < K:\n K -=A\n score += A\nelse:\n score = K\n print(score)\n exit()\n\nif B < K:\n K -=B\nelse:\n print(score)\n exit()\n\nif C < K:\n K -=C\n score -= C\nelse:\n score -= K\n print(score)\n exit()\nprint(score)'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s369854164', 's599178991', 's798975046', 's866903520', 's908754417'] | [9192.0, 9020.0, 9168.0, 9152.0, 8952.0] | [23.0, 25.0, 21.0, 21.0, 21.0] | [288, 145, 166, 56, 285] |
p02682 | u239048001 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['2000000000 0 0 200000000', 'a,b,c,k=map(int,input())\nmax_value=0\nif k=<a+b:\n max_value=a\nelif a+b<k=<a+b+c:\n max_value=a-k+a+b\nprint(max_value)', 'list=list(map(int,input().split()))\na=list[0]\nb=list[1]\nc=list[2]\nk=list[3]\nif k=<a+b:\n max_value=a\nelse:\n max_value=a-k+a+b\nprint(max_value)\n', 'a,b,c,k=map(int,input().split())\nif k=<a+b:\n max_value=a\nelse:\n max_value=a-k+a+b\nprint(max_value)\n', 'a,b,c,k=map(int,input())\nif k=<a+b:\n max_value=a\nelse:\n max_value=a-k+a+b\nprint(max_value)\n', 'a,b,c,k=map(int,input().split)\nmax_value=0\nif k=<a+b:\n max_value=a\nelif a+b<k=<a+b+c:\n max_value=a-k+a+b\nprint(max_value)', 'a,b,c,k=map(int,input().split())\nmax_value=0\nif k=<a+b:\n max_value=a\nelif a+b<k=<a+b+c:\n max_value=a-k+a+b\nprint(max_value)', 'a,b,c,k=map(int,input().split())\nif a<=k<=a+b:\n max_value=a\nelif k<a:\n\tmax_value=k\nelse:\n max_value=a*2-k+b\nprint(max_value)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s008588663', 's326426584', 's338557211', 's453348865', 's804778738', 's934140679', 's998443442', 's926904240'] | [8936.0, 8948.0, 8980.0, 8968.0, 9016.0, 8816.0, 9020.0, 9156.0] | [24.0, 24.0, 21.0, 24.0, 24.0, 22.0, 24.0, 20.0] | [24, 117, 144, 101, 93, 123, 125, 127] |
p02682 | u239668086 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = map(int, input().split())\ncount = 0\n\nif k-a-b <= 0:\n count = k\nelse:\n count = 2*a + b - k\n\nprint(count)', 'a, b, c, k = map(int, input().split())\ncount = 0\n\nif k-a <= 0:\n count = k\nelif k-a-b <= 0:\n count = a\nelse:\n count = 2*a + b - k\n\nprint(count)'] | ['Wrong Answer', 'Accepted'] | ['s440972864', 's509412260'] | [9168.0, 9132.0] | [22.0, 24.0] | [118, 145] |
p02682 | u240793404 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = map(int, input().split())\nans = 0\nif a > 0:\n ans = min(a, k)\n k = k - min(a, k)\nif k > 0:\n k = k - b\nif k > 0:\n ans = ans - k', 'a, b, c, k = map(int, input().split())\nans = 0\nif a > 0:\n ans = min(a, k)\n k = k - min(a, k)\nif k > 0:\n k = k - b\nif k > 0:\n ans = ans - k\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s838551479', 's289466969'] | [9180.0, 9184.0] | [22.0, 26.0] | [150, 161] |
p02682 | u241159583 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k = map(int, input().split())\nn = 0\nans = 0\nfor i in range(3):\n if i == 0: \n n+=a\n ans += a\n elif i == 2:\n n += b\n else:\n n += 1\n ans -= 1\n if n >= k: break\nprint(ans)', 'a,b,c,k = map(int, input().split())\n\nans = 0\nif a <= k:\n ans += a\n k -= a\nelif k <= a:\n ans += k\n print(ans)\n exit()\nif b <= k:\n k -= b\nelif k <= b:\n print(ans)\n exit()\nans -= k\nprint(ans) '] | ['Wrong Answer', 'Accepted'] | ['s351951630', 's537792898'] | [9176.0, 8912.0] | [23.0, 27.0] | [192, 213] |
p02682 | u242890210 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ["S = list(map(int,input().split()))\n\nif S[0] + S[1] + S[2] >= 2 * 10 ** 9:\n print('Error')\nelif S[0] >= S[3]:\n print(S[3])\nelif S[3] > S[0] and S[3] < S[0] + S[1]:\n print(S[0])\nelif S[3] > S[0] + S[1] and S[3] <= S[0] + S[1] + S[2]:\n print(-1 * (S[3] - S[0] - S[1]) + S[0])\nelse:\n print('Error')\n ", "S = list(map(int,input().split()))\n\nif S[0] + S[1] + S[2] >= 2 * 10 ** 9:\n print('Error')\nelif S[0] >= S[3]:\n print(S[3])\nelif S[3] > S[0] and S[3] < S[0] + S[1]:\n print(S[0])\nelif S[3] > S[0] + S[1] and S[3] <= S[0] + S[1] + S[2]:\n print(-1 * (S[3] - S[0] - S[1]) + S[0])\nelse:\n print('Error')", "A = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\nif A + B + C >= 2 * 10 ** 9:\n print('Error')\nelif A >= K:\n print(K)\nelif K > A and K < A + B:\n print(A)\nelif K > A + B and K <= A + B + C:\n print(-1 * (K - A - B) + A)\nelse:\n print('Error')", "S = list(map(int,input().split()))\n\nif S[0] + S[1] + S[2] > 2 * 10 ** 9:\n print('Error')\nelif S[0] >= S[3]:\n print(S[3])\nelif S[3] > S[0] and S[3] <= S[0] + S[1]:\n print(S[0])\nelif S[3] > S[0] + S[1] and S[3] <= S[0] + S[1] + S[2]:\n print(-1 * (S[3] - S[0] - S[1]) + S[0])\nelse:\n print('Error')"] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s005445862', 's349285854', 's519571464', 's977306756'] | [9144.0, 9084.0, 9180.0, 9216.0] | [22.0, 24.0, 24.0, 22.0] | [314, 309, 272, 309] |
p02682 | u244466744 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = map(int, input().split())\n\nif A > K:\n print(K)\n \ntemp = K - A\n\nif temp >= B:\n print(A)\n \ntemp = temp - B\n\nprint(A - C)\n ', 'A, B, C, K = map(int, input().split())\n\nif A >= K:\n print(K)\n exit()\n \ntemp = K - A\n\nif B >= temp:\n print(A)\n exit()\n \ntemp = temp - B\n\nprint(A - temp)\n \n'] | ['Wrong Answer', 'Accepted'] | ['s312479476', 's655946762'] | [9156.0, 9080.0] | [29.0, 29.0] | [138, 161] |
p02682 | u249372595 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K = map(int,input().split())\nprint(A,B,C,K)\nres = 0\nif A>=K:\n res= 1*A\nelse:\n for b in range(K-A,B+1):\n c = K-A-b\n if c >= 0:\n ans = 1*A + 0*b + (-1)*c\n res = max(res,ans)\n else:\n break\nprint(res)', 'A,B,C,K = map(int,input().split())\nres = 0\nif A>=K:\n res= 1*A\nelse:\n for c in range(K-A,C+1):\n b = K - A - c\n ans = 1*A + 0*b + (-1)*c\n res = max(res,ans)\nprint(res)', 'A,B,C,K = map(int,input().split())\nres = 0\nif A>=K:\n res= 1*A\nelse:\n for c in range(K-A,C+1):\n b = K-A-c\n ans = 1*A + 0*b + (-1)*c\n res = max(res,ans)\nprint(res)', 'A,B,C,K = map(int,input().split())\nprint(A,B,C,K)\nres = 0\nfor i in range(A+1):\n for j in range(B+1):\n ans = 1*i + 0*j + (-1)*(K-i-j)\n res = max(res,ans)\nprint(res)', 'A,B,C,K = map(int,input().split())\nprint(A,B,C,K)\nres = 0\nif A>=K:\n res= 1*A\nelse:\n for b in range(K-A,B+1):\n c = K-A-b\n ans = 1*A + 0*b + (-1)*c\n res = max(res,ans)\nprint(res)', 'A,B,C,K = map(int,input().split())\nxa = min(K,A)\nxb = min(K-xa,B)\nxc = K-xa-xb\nans = 1*xa + 0*xb + (-1)*xc\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s189277668', 's721364639', 's765454094', 's812850529', 's847559979', 's995586409'] | [9192.0, 9172.0, 9192.0, 9060.0, 9196.0, 9176.0] | [23.0, 2206.0, 2206.0, 2205.0, 21.0, 22.0] | [228, 176, 172, 170, 187, 117] |
p02682 | u249690677 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = map(int, input().split())\nif K < A:\n print(K)\nelif K =< A+B:\n print(A)\nelse:\n print(A + (K-A-B)*-1)', 'A, B, C, K = map(int, input().split())\nif K < A:\n print(K)\nelif K <= A+B:\n print(A)\nelse:\n print(A + (K-A-B)*-1)'] | ['Runtime Error', 'Accepted'] | ['s585306128', 's840391130'] | [8872.0, 9160.0] | [23.0, 22.0] | [121, 121] |
p02682 | u249987458 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k = int(input())\ntotal = a*1 + b*0 - c*1\nprint(int(total))', 'a,b,c,k = map(int, input().split())\ns = 0\nif k <= a:\n s += k\nelse:\n s += a\nif 0 < k-(a+b):\n s -= k-(a+b)\nprint(s)'] | ['Runtime Error', 'Accepted'] | ['s702327941', 's907988533'] | [9108.0, 9164.0] | [21.0, 29.0] | [64, 122] |
p02682 | u250703962 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['def test(a,b,c,k):\n\tif k<=a:\n\t\treturn k\n\telif k<= a+b:\n\t\treturn k\n\telse:\n\t\treturn a-(k-a-b)\n\n\na,b,c,k = list(map(int, input().split(" ")))\nprint(test(a,b,c,k))', 'def test(a,b,c,k):\n\tif k<=a:\n\t\treturn k\n\telif k<= a+b:\n\t\treturn a\n\telse:\n\t\treturn a-(k-a-b)\n \n \na,b,c,k = list(map(int, input().split(" ")))\nprint(test(a,b,c,k))'] | ['Wrong Answer', 'Accepted'] | ['s373769612', 's290133681'] | [9044.0, 9104.0] | [24.0, 21.0] | [159, 161] |
p02682 | u251781244 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['n=list(map(int,input().split()))\ns=0\nk=n[3]\na=n[0]\nd=k-a\nif k-a>0:\n s=a-k+a\nif k-a<=0:\n s=k\nprint(s)\n', 'n=list(map(int,input().split()))\ns=0\nk=n[3]\na=n[0]\nb=n[1]\nd=k-a\n\nif k-a<=0:\n s=k\nif k-a>0:\n if k-a-b<=0:\n s=a;\n else:\n s=a-k+a+b\nprint(s)\n'] | ['Wrong Answer', 'Accepted'] | ['s147896690', 's157942444'] | [9164.0, 9060.0] | [21.0, 22.0] | [107, 161] |
p02682 | u255595446 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['\n\nA,B,C,K = map(int,input().split())\nprint(A,B,C,K)\nANS = 0\n\nANS += min([A,K])\nK -= A\nif K<1:\n print(ANS)\n exit()\nK -= B\nif K<1:\n print(ANS)\n exit()\nANS -= min([C,K])\nprint(ANS)', 'A,B,C,K = map(int,input().split())\nANS = 0\n\nANS += min([A,K])\nK -= A\nK -= B\n\nif K<1:\n print(ANS)\n exit()\nANS -= min([C,K])\nprint(ANS)'] | ['Wrong Answer', 'Accepted'] | ['s839140410', 's339137655'] | [9192.0, 9180.0] | [22.0, 22.0] | [189, 139] |
p02682 | u260906801 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k =map(int, input().split())\nif k <= a:\n print (a)\nelif k > a:\n if k <= (a + b):\n print(a) \n elif k > (a + b):\n print(a - (k - (a + b))', 'a, b, c, k =map(int, input().split())\nif k <= a:\n print a\nelif k > a:\n if k <= (a + b):\n print a \n elif k > (a + b):\n print a - (k - a)', 'a, b, c, k =map(int, input().split())\nif k <= a:\n print (k)\nelif k > a:\n if k <= (a + b):\n print(a) \n elif k > (a + b):\n print(a - (k - (a + b)))\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s132595297', 's221728446', 's412845273'] | [8944.0, 9008.0, 9116.0] | [24.0, 22.0, 22.0] | [167, 158, 169] |
p02682 | u263352518 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['abck = input().split()\n\na = int(abck[0])\nb = int(abck[1])\nc = int(abck[2])\nk = int(abck[3])\n\n\nif k <= a:\n print(k)\nelif k <= a+b:\n print(k)\nelse:\n print(a - (k-(a+b)))', 'abck = input().split()\n\na = int(abck[0])\nb = int(abck[1])\nc = int(abck[2])\nk = int(abck[3])\n\n\nif k <= a+b:\n print(k)\nelse:\n print(a - (k-(a+b)))', 'abck = input().split()\n\na = int(abck[0])\nb = int(abck[1])\nc = int(abck[2])\nk = int(abck[3])\n\n\nif k <= a:\n print(k)\nelif k <= a+b:\n print(a)\nelse:\n print(a - (k-(a+b)))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s146134111', 's517431756', 's658215598'] | [9184.0, 9208.0, 9184.0] | [19.0, 24.0, 24.0] | [170, 146, 170] |
p02682 | u266675845 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['\nA = int(input())\nB = int(input())\nC = int(input())\nK = int(input())\n#the number of A,B,C for given K\nif K-A<0: \n NA = K\n NB = 0\n NC = 0\nelse: \n NA = A\n if (K-A)-B<0: \n NB = K-A\n NC = 0\n else: \n NB = B\n NC = K-A-B\n\n\nsum = NA *1 + NB *0 + NC *(-1)\n\n\nprint(sum)', 'A, B, C, K = map(int,input().split())\nif K <= A:\n print(K)\nelif K <= A + B:\n print(A)\nelse:\n print(2*A + B - K)\n\n'] | ['Runtime Error', 'Accepted'] | ['s291173022', 's684940461'] | [9204.0, 9008.0] | [24.0, 23.0] | [590, 122] |
p02682 | u270341037 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['\na,b,c,k = map(int,input().split())\n\nif k < a:\n print(k)\nelif k < a + b:\n print(a)\nnelse:\n print(2*a + b - k)', '\na,b,c,k = map(int,input().split())\n\nif k < a:\n print(k)\nelif k < a + b:\n print(a)\nelse:\n print(2*a + b - k)'] | ['Runtime Error', 'Accepted'] | ['s881591015', 's044379249'] | [8968.0, 9048.0] | [22.0, 20.0] | [119, 118] |
p02682 | u271811784 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = map(int, input().split())\nout = min(A, K) - max(K-A-B, 0)', 'A, B, C, K = map(int, input().split())\nout = min(A, K) - max(K-A-B, 0)\nprint(out)'] | ['Wrong Answer', 'Accepted'] | ['s644009707', 's153514290'] | [9068.0, 9104.0] | [20.0, 25.0] | [70, 81] |
p02682 | u273186459 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k=map(int,input().split())\nct=k\nresult = 0\nif a>0:\n result=1*ct\n ct=k-a\nif ct>0 and b>0:\n ct=ct-b\nif ct>0 and c>0:\n result=result+(-1*ct)\nprint(result)', 'a,b,c,k=map(int,input().split())\nct=k\nresult = 0\nif a>0:\n if ct>a:\n result=1*a\n elif a>=ct:\n result=1*ct\n ct=k-a\nif ct>0 and b>0:\n ct=ct-b\nif ct>0 and c>0:\n result=result+(-1*ct)\nprint(result)'] | ['Wrong Answer', 'Accepted'] | ['s059626486', 's879429932'] | [9112.0, 9008.0] | [22.0, 22.0] | [161, 203] |
p02682 | u275030199 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k = map(int,input())\nif k<a:\n print(k)\nelif k < a+b:\n print(a)\nelse:\n print(2*a+b-k)', 'a,b,c,k = map(int,input().split())\nif k<a:\n print(k)\nelif k < a+b:\n print(a)\nelse:\n print(2*a+b-k)'] | ['Runtime Error', 'Accepted'] | ['s686437222', 's527007964'] | [9088.0, 9172.0] | [23.0, 20.0] | [99, 107] |
p02682 | u277104886 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = map(int, input().split())\nif a > k:\n print(k)\nelif a + b > k:\n print(a)\nelse:\n print(2*a - k - b)', 'a, b, c, k = map(int, input().split())\nif a >= k:\n print(k)\nelif a + b >= k:\n print(a)\nelse:\n print(2*a - k + b)'] | ['Wrong Answer', 'Accepted'] | ['s153477223', 's424507087'] | [9024.0, 9132.0] | [21.0, 24.0] | [119, 121] |
p02682 | u277641173 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k=map(int,input().split())\n\nif k>=a+b+c:\n print(a-c):\nelif a+b<=k<=a+b+c:\n print(a-(k-(a+b)))\nelif a<=k<=a+b:\n print(a)\nelif 0<=k<=a:\n print(k)', 'a,b,c,k=map(int,input().split())\n\nif k>=a+b+c:\n print(a-c)\nelif a+b<=k<=a+b+c:\n print(a-(k-(a+b)))\nelif a<=k<=a+b:\n print(a)\nelif 0<=k<=a:\n print(k)\n'] | ['Runtime Error', 'Accepted'] | ['s804445736', 's366293036'] | [9000.0, 9176.0] | [25.0, 24.0] | [153, 153] |
p02682 | u281055657 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['\n\n\n\n\n\n#a,b=(x for x in input().split()) \na,b,c,k=(int(x) for x in input().split())\n\nif(k<=a):\n print(a*k)\nelse:\n sum=a*k\n t=k-a\n if(t<=b):\n print(sum)\n else:\n \n t2=t-c\n print(sum-c*t2)\n', 'a,b,c,k=(int(x) for x in input().split())\n\nif(k<=a):\n print(a*k)\nelse:\n sum=a*k\n t=k-a\n if(t<=b):\n print(sum+b*t)\n else:\n sum+=b*t\n t2=t-c\n print(sum+c*t2)\n', '\n\n\n\n\n\n#a,b=(x for x in input().split()) \na,b,c,k=(int(x) for x in input().split())\n\nif(k<=a):\n print(a*k)\nelse:\n sum=k\n t=k-a\n if(t<=b):\n print(sum)\n else:\n \n \n t2=t-c\n print(sum-t2)\n', 'a,b,c,k=(int(x) for x in input().split())\n\nif(k<=a):\n print(a*len(k))\nelse:\n sum=a*len(k)\n t=k-a\n if(t<=b):\n print(sum+b*len(t))\n else:\n sum+=b*len(t)\n t2=t-c\n print(sum+c*len(t2))', 'a, b, c, k = map(int, input().split())\nif k <= a:\n ans = k\nelif k <= b:\n ans = a\nelse:\n ans = a - (k - a - b)\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s545241309', 's721269737', 's845527183', 's915906039', 's669732816'] | [9176.0, 9100.0, 9104.0, 9196.0, 9168.0] | [23.0, 24.0, 25.0, 23.0, 22.0] | [254, 173, 255, 197, 129] |
p02682 | u281334626 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K = map(int, input().split())\n\nS = A+B+C\nresult = 0\n\nif ( K > (A+B) ):\n result = A*(1) + (K-(A+B))*(-1)\nelse ( (A+B) >= K ):\n result = A*(1)\n\nprint(result)\n', 'A,B,C,K = map(int, input().split())\n\nS = A+B+C\nresult = 0\n\nif ( K > (A+B) ):\n result = A*(1) + (K-(A+B))*(-1)\nelif ( (A+B) >= K >= A):\n result = A*(1)\nelif ( A > K ):\n result = K*(1)\n\nprint(result)\n'] | ['Runtime Error', 'Accepted'] | ['s542242216', 's597450104'] | [9044.0, 9124.0] | [20.0, 22.0] | [168, 207] |
p02682 | u281796054 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,d=map(int,input().split())\nif a+b >= d:\n print(d)\nelse:\n print(2*a+b-d)', 'a,b,c,d=map(int,input().split())\nif a+b >= d:\n print(d)\nelse:\n print(2a+b-d)', 'a,b,c,d=map(int,input().split())\nif a >= d:\n print(d)\nelif a+b >= d:\n print(a)\nelse:\n print(2*a+b-d)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s356636107', 's877212584', 's638783549'] | [9164.0, 8964.0, 9168.0] | [22.0, 19.0, 24.0] | [79, 78, 103] |
p02682 | u283751459 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k = map(int,input().split())\n\nif k<=a:\n print(a*k)\nelif a< k <= a+b:\n print(a*k)\nelif a+b < k <= a+b+c:\n print(a-(k-b-a))\n', 'a,b,c,k = map(int,input().split())\n\nif k<=a:\n print(k)\nelif a< k <= a+b:\n print(a)\nelif a+b < k <= a+b+c:\n print(a-(k-b-a))'] | ['Wrong Answer', 'Accepted'] | ['s901894184', 's556849673'] | [9068.0, 9176.0] | [31.0, 28.0] | [131, 126] |
p02682 | u284363684 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['# input\nA, B, C, K = map(int, input().split())\n\n\nresult_score = 0\nfor score, i in [(1, A), (0, B), (-1, C)]:\n if K <= 0:\n continue \n \n if K >= i:\n result_score =- score * i\n K -= i\n else:\n result_score =- score * K\n K = 0\n\nprint(result_score)', '# input\nA, B, C, K = map(int, input().split())\n\n\nresult_score = 0\nfor score, i in [(1, A), (0, B), (-1, C)]:\n if K <= 0:\n continue\n\n if K >= i:\n result_score += score * i\n K -= i\n else:\n result_score += score * K\n K = 0\n\nprint(result_score)'] | ['Wrong Answer', 'Accepted'] | ['s319238622', 's493522631'] | [9188.0, 9132.0] | [20.0, 20.0] | [335, 326] |
p02682 | u287660527 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ["def main():\n s = input()\n t = input()\n a = len(s)\n\n if len(s) > 10 or len(s) < 1:\n print('no')\n else:\n if t[0:a] != s:\n print('no')\n else:\n if len(t) == len(s) + 1:\n print('yes')\n\nmain()", "s = input()\nt = input()\na = len(s)\n\nif len(s) > 10 or len(s) < 1:\n print('no')\nelse:\n if t[0:a] != s:\n print('no')\n else:\n if len(t) == len(s) + 1:\n print('yes')", 'a,b,c,k = map(int,input().split())\n\nif a >= k:\n print(k)\nelse:\n if a + b >= k:\n print(a)\n else:\n print(2 * a + b - k)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s617138744', 's848586054', 's839115505'] | [8988.0, 9036.0, 9164.0] | [27.0, 24.0, 36.0] | [217, 175, 126] |
p02682 | u294385082 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k = map(int,input().split())\n \nif k <= a:\n print(a)\nelif a < k and k <= a+b:\n print(a)\nelif a+b < k and k <= a+b+c\n print(a-k+a+b)', 'a,b,c,k = map(int,input().split())\n\nif k <= a:\n print(a)\nelif a < k and k <= a+b:\n print(a)\nelse:\n print(a-k+a+b))', 'a,b,c,k = map(int,input().split())\n \nif k <= a:\n print(k)\nelif a < k and k <= a+b:\n print(a)\nelse:\n print(a-k+a+b)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s430364262', 's543857840', 's987528706'] | [8920.0, 8772.0, 9168.0] | [24.0, 24.0, 21.0] | [139, 117, 117] |
p02682 | u294490207 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ["A,B,C,K = int(input().split(' '))\nout = 0\nif A>K:\n print(K)\nelse:\n out += A\n K -= A\n if B > K:\n print(out)\n else:\n K -= B\n out -= K\n print(out)", "A,B,C,K = map(int,input().split(' '))\nout = 0\nif A>K:\n print(K)\nelse:\n out += A\n K -= A\n if B > K:\n print(out)\n else:\n K -= B\n out -= K\n print(out)"] | ['Runtime Error', 'Accepted'] | ['s389908472', 's291279514'] | [9116.0, 9124.0] | [25.0, 22.0] | [160, 164] |
p02682 | u303344598 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k = map(int, input().split())\n\nif a <= k:\n print(k)\nelif a + b <= k:\n print(a)\nelse:\n print(k - b)', 'a,b,c,k = map(int, input().split())\n \nif a >= k:\n print(k)\nelif a + b >= k:\n print(a)\nelse:\n print(a - (k - a - b))'] | ['Wrong Answer', 'Accepted'] | ['s031594602', 's621568449'] | [8992.0, 9160.0] | [30.0, 28.0] | [107, 118] |
p02682 | u324090406 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = list(map(input().split()))\nif k < a:\n return k\nelif k < a+b:\n return a\nelse:\n return a - (k-a-b)', 'a, b, c, k = list(map(int, input().split()))\nif k < a:\n print(k)\nelif k < a+b:\n print(a)\nelse:\n print(a-(k-a-b))'] | ['Runtime Error', 'Accepted'] | ['s204473471', 's850024254'] | [9032.0, 9168.0] | [22.0, 22.0] | [118, 121] |
p02682 | u325149030 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = map(int, input().spliit())\nif K <= A :\n print(K)\n\nelif K <= A + B:\n print(A)\n\nelse:\n print(A - (K - (A + B)))\n', 'A, B, C, K = map(int, input().spliit())\nif K <= A :\n return K\n\nelif K <= A + B:\n return A\n\nelse:\n return A - (K - (A + B))\n', 'A, B, C, K = map(int, input().split())\nif K <= A :\n print(K)\n\nelif K <= A + B:\n print(A)\n\nelse:\n print(A - (K - (A + B)))\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s025305163', 's664971404', 's273497158'] | [8692.0, 9000.0, 9172.0] | [21.0, 22.0, 21.0] | [132, 132, 131] |
p02682 | u329962837 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['if K < A:\n print(A)\nelif A <= K and B >= (K-A):\n print(A)\nelse:\n print(A - (K-A-B))', 'A,B,C,K =list(map(int,input().split()))\nif K < A:\n print(K)\nelif A <= K and B >= (K-A):\n print(A)\nelse:\n print(A - (K-A-B))'] | ['Runtime Error', 'Accepted'] | ['s040826155', 's321197867'] | [9028.0, 9012.0] | [24.0, 25.0] | [86, 126] |
p02682 | u339199690 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = map(int, input().split()) \n\nif A + B >= K:\n print(K)\nelse:\n print(A - (K - (A + B)))\n', 'A, B, C, K = map(int, input().split()) \n\nif A >= K:\n print(K)\nelif A + B >= K:\n print(K)\nelse:\n print(max(0, A - (K - (A + B))))\n', 'A, B, C, K = map(int, input().split())\n\nif A >= K:\n print(K)\nelif A + B >= K:\n print(A)\nelse:\n print(A - (K - A - B))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s135095219', 's313346475', 's201579309'] | [9180.0, 9168.0, 8876.0] | [22.0, 23.0, 24.0] | [104, 138, 127] |
p02682 | u342062419 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a = int(input())\nb = int(input())\nc = int(input())\nk = int(input())\ns = 0\nif a + b >= k:\n s = a\nelse:\n s = a - c \nprint(s)', 'a = int(input())\nb = int(input())\nc = int(input())\nk = int(input())\ns = 0\nif 0 < a and 0 < k:\n s += a\n k -= a\nelif 0 < b and 0 < k:\n k -= b\nelif 0 < c and 0 < k:\n s -= c\n k -= c\nprint(s)', 'a = int(input())\nb = int(input())\nc = int(input())\nk = int(input())\ns = 0\nwhile(0 < a and 0 < k):\n s += 1\n k -= 1\n a -= 1\nwhile(0 < b and 0 < k):\n k -= 1\n b -= 1\nwhile(0 < c and 0 < k):\n s -= 1\n k -= 1\n c -= 1\nprint(s)', 'a, b, c, k = map(int, input().split())\ns = 0\nif a >= k:\n s = k\nelif a + b >= k:\n s = a\nelse:\n s = a - (k - a - b) \nprint(s)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s410895720', 's746782841', 's782520287', 's434951362'] | [9096.0, 9180.0, 8952.0, 9100.0] | [23.0, 24.0, 22.0, 25.0] | [129, 201, 242, 133] |
p02682 | u345483150 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k=map(int,input().split())\nif k<=a+b:\n print(a)\nelif k<=a+b+c:\n print(2a-k+b)\nelse:\n print(a-c)', 'a,b,c,k=map(int,input().split())\nif k<=a:\n print(k)\nelif k<=a+b:\n print(a)\nelse: \n print(2*a-k+b)'] | ['Runtime Error', 'Accepted'] | ['s444656557', 's751758817'] | [9016.0, 9168.0] | [25.0, 22.0] | [104, 100] |
p02682 | u345621867 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k=map(int,input().split())\nif k <= a:\n print(k)\nelif k <= a+b:\n print(0)\nelse:\n print(2*a-k+b)', 'a,b,c,k=map(int,input().split())\nif k <= a+b:\n print(k)\nelse:\n print(2*a-k+b)', 'a,b,c,k=map(int,input().split())\nif k <= a:\n print(k)\nelif k <= a+b:\n print(a)\nelse:\n print(2*a-k+b)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s722160094', 's888110664', 's562629678'] | [9092.0, 9152.0, 9156.0] | [21.0, 22.0, 23.0] | [109, 83, 109] |
p02682 | u351892848 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['def solve(A, B, C, K):\n num = K\n\n if K <= A:\n return 1 * A\n\n num -= A\n ans = 1 * A\n\n if num <= B:\n return ans\n\n num -= B\n\n if num < 0:\n return ans\n\n return ans - num\n\n\nA, B, C, K = map(int, input().split())\nprint(solve1(A, B, C, K))\n\n', 'A, B, C, K = map(int, input().split())\n\nif K <= A:\n print(K)\nelif K <= A + B:\n print(A)\nelse:\n print(A - (K - (A + B)))\n'] | ['Runtime Error', 'Accepted'] | ['s662773393', 's245185445'] | [9176.0, 9088.0] | [21.0, 22.0] | [279, 129] |
p02682 | u353519457 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = map(int, input().split())\n\nnokori = K - A - B\n\nwa = 0\nwa += A\n\nif nokori == 0:\n a \nelif C >= nokori:\n wa -= nokori\nelse:\n wa -= C\n\nprint(wa)', 'A, B, C, K = map(int, input().split())\n\nnokori = K - A - B\n\nwa = 0\nwhile True:\n if A >= K:\n wa += K\n break\n else:\n wa += A\n if C >= nokori:\n wa -= nokori\n break\n else:\n wa -= C\n break\n\nprint(wa)'] | ['Runtime Error', 'Accepted'] | ['s384663933', 's661406673'] | [9096.0, 9184.0] | [21.0, 21.0] | [165, 255] |
p02682 | u354863714 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a = int(input())\nb = int(input())\nc = int(input())\nk = int(input())\n\ncount = 0\n\nif k <= a+b:\n count += a\nelse:\n count += a-(k-(a+b))\nprint(count)', '#B\ni = input()\na = int(i.split()[0])\nb = int(i.split()[1])\nc = int(i.split()[2])\nk = int(i.split()[3])\n\ncount = 0\n\nif k < a:\n count += a-(a-k)\nelif k <= a+b:\n count += a\nelif a+b < k:\n count += (a)-(k-(a+b))\nprint(count)'] | ['Runtime Error', 'Accepted'] | ['s767233373', 's289712099'] | [9180.0, 9228.0] | [22.0, 22.0] | [151, 229] |
p02682 | u357403505 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K = map(int, input().split())\ntotal = 0\nif A <= K:\n total = A\n if B <= K - A:\n total = total - (K-A)\nprint(total)\n', 'A,B,C,K = map(int, input().split())\ntotal = 0\nif A <= K:\n total = A\n if B <= K - A:\n total = total - (K-A)\nprint(total)\n', 'A,B,C,K = map(int, input().split())\ntotal = K\nif total <= A:\n print(total)\nelse:\n if K-A <= B:\n print(total)\n else:\n print(total - (K-A-B))\n ', 'A,B,C,K = map(int, input().split())\ntotal = K\nif total <= A:\n print(total)\nelse:\n if K-A < B:\n print(total)\n else:\n print(total - (K-A-B))', 'A,B,C,K = map(int, input().split())\ntotal = K\nif total <= A:\n print(total)\nelse:\n if K-A <= B:\n print(A)\n else:\n print(A - (K-A-B))\n '] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s300863901', 's497522698', 's584082230', 's867496165', 's527891126'] | [9144.0, 9152.0, 9164.0, 9200.0, 9164.0] | [23.0, 22.0, 22.0, 22.0, 21.0] | [133, 133, 167, 161, 159] |
p02682 | u357651829 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K=map(int,input().split())\ncount=0\nwhile K>0:\n if A>0:\n count+=A\n A=0\n K-=A\n elif B>0:\n K-=B\n B=0\n else:\n count-=K\n K=0\n C=0\nprint(count) ', 'A,B,C,K=map(int,input().split())\ncount=0\nif A>=K:\n count=K\nelif A+B>=K:\n count=A\nelse:\n count=A\n count-=K-(A+B)\nprint(count) \n'] | ['Wrong Answer', 'Accepted'] | ['s630089030', 's893853052'] | [9152.0, 9060.0] | [24.0, 22.0] | [174, 131] |
p02682 | u358957649 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['def main(a,b,c,k):\n res = 0\n if k < a:\n res = k\n elif a <= k < a+b:\n res = a\n elif a+b <= k:\n res = a - (k - (a + b))\n return res\n\na,b,c,k = mi()\nprint(main(a,b,c,k))', 'ii = lambda:int(input())\nmi = lambda:list(map(int,input().split()))\nix = lambda x:list(input() for _ in range(x))\nmix = lambda x:list(mi() for _ in range(x))\niix = lambda x:list(int(input()) for _ in range(x))\n##########\ndef main(a,b,c,k):\n res = 0\n if k < a:\n res = k\n elif a <= k < a+b:\n res = a\n elif a+b <= k:\n res = a - (k - (a + b))\n return res\n\na,b,c,k = mi()\nprint(main(a,b,c,k))'] | ['Runtime Error', 'Accepted'] | ['s209530573', 's544579967'] | [9064.0, 9216.0] | [23.0, 20.0] | [202, 423] |
p02682 | u364099990 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['s = input()\nA B C K = s.split(" ")\n\nif K <= A:\n print(K)\nelif K <= A + B:\n print(A)\nelif K <= A + B + C:\n print(A - (K - A))', 's = input()\nA, B, C, K = [int(v) for v in s.split(" ")]\n\nif K <= A:\n print(K)\nelif K <= A + B:\n print(A)\nelif K <= A + B + C:\n print(A - (K - A - B))'] | ['Runtime Error', 'Accepted'] | ['s667134498', 's820107182'] | [8944.0, 9116.0] | [22.0, 22.0] | [127, 152] |
p02682 | u365156087 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K = map(int, input().split())\nif A >= K:\n print(K)\nelif: A + B >= K:\n print(A)\nelse\n print(A-(K-A-B))', 'A,B,C,K = map(int, input().split())\nif A >= K:\n print(K)\nelif A + B >= K:\n print(A)\nelse:\n print(A-(K-A-B))'] | ['Runtime Error', 'Accepted'] | ['s831722461', 's820155774'] | [8884.0, 9120.0] | [24.0, 28.0] | [110, 110] |
p02682 | u367548378 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K=map(int,input().strip().split())\nK=K-A\nif K>0:\n Sum=A\n K=K-B\n if K>0:\n if K>C:\n print(Sum-C)\n \telse:\n print(Sum-K)\n else:\n print(Sum)\nelse:\n print(K)', 'A,B,C,K=map(int,input().strip().split())\nK=K-A\nif K>0:\n Sum=K-A\n K=K-B\n if K>0:\n print(Sum-K)\n else:\n print(Sum)\nelse:\n print(K)', 'A,B,C,K=map(int,input().strip().split())\nif K-A>0:\n K=K-A\n Sum=A\n K=K-B\n if K>0:\n if K>C:\n print(Sum-C)\n else:\n print(Sum-K)\n #if K>C:\n else:\n print(Sum)\nelse:\n\tprint(K)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s593194184', 's783643480', 's077423031'] | [9032.0, 9180.0, 9060.0] | [22.0, 24.0, 23.0] | [185, 141, 196] |
p02682 | u369796672 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = map(int, input().split())\n\nif K <= A + B:\n print(K)\nelse:\n print(K - B)', 'A, B, C, K = map(int, input().split())\n \nif K <= A:\n print(K)\nelif K <= A + B:\n print(A)\nelse:\n print(2*A + B - K)'] | ['Wrong Answer', 'Accepted'] | ['s842992918', 's689558784'] | [9120.0, 9172.0] | [25.0, 24.0] | [86, 117] |
p02682 | u373422978 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = map(int, input().split())\nif A >= K:\n print(A)\nelif (A + B) >= K:\n print(A)\nelif (A + B + C) > K:\n print(A - (K - A - B)\nelif (A + B + C) == K:\n print(A - C)', 'A, B, C, K = map(int, input().split())\nresult = 0\n\nif A >= K:\n print(K)\nelif (A + B) >= K:\n print(K)\nelse:\n for i in range(K):\n if A > (i + 1):\n result += 1\n continue\n elif A == (i + 1):\n result += 1\n continue\n\n if B > (i + 1 - A):\n result += 0\n continue\n elif B == (i + 1 - A):\n result += 0\n continue\n\n if C > (i + 1 - A - B):\n result -= 1\n continue\n elif C == (i + 1 - A - B):\n result -= 1\n break\n else:\n break\n print(result)\n', 'A, B, C, K = map(int, input().split())\nresult = 0\n\nif A >= K:\n print(A)\nelif (A + B) >= K:\n print(A)\nelse:\n if (A + B + C) > K:\n print(A - (K - (A + B))\n elif (A + B + C) <= K:\n print(A - C)', 'A, B, C, K = map(int, input().split())\nresult = 0\np\n\nif A >= K:\n print(A)\nelif (A + B) >= K:\n print(A)\nelse:\n for i in range(K):\n print(i)\n if A > (i + 1):\n result += 1\n continue\n elif A == (i + 1):\n result += 1\n continue\n\n if B > (i + 1 - A):\n continue\n elif B == (i + 1 - A):\n continue\n\n if C > (i + 1 - A - B):\n result -= 1\n continue\n elif C == (i + 1 - A - B):\n result -= 1\n break\n else:\n break\n print(result)', 'A, B, C, K = map(int, input().split())\nresult = 0\n\nfor i in range(K):\n if A > (i + 1):\n result += 1\n elif A == (i + 1):\n result += 1\n continue\n else:\n break\n\n if B > (i + 1 - A):\n result += 0\n elif B == (i + 1 - A):\n result += 0\n continue\n else:\n break\n\n if C > (i + 1 - A - B):\n result -= 1\n elif C == (i + 1 - A - B):\n result -= 1\n break\n else:\n break\n\nprint(result)\n', 'A, B, C, K = map(int, input().split())\nresult = 0\n\nif A <= K:\n print(K)\nelif (A + B) <= K:\n print(K)\nelse:\n for i in range(K):\n if A > (i + 1):\n result += 1\n continue\n elif A == (i + 1):\n result += 1\n continue\n\n if B > (i + 1 - A):\n result += 0\n continue\n elif B == (i + 1 - A):\n result += 0\n continue\n\n if C > (i + 1 - A - B):\n result -= 1\n continue\n elif C == (i + 1 - A - B):\n result -= 1\n break\n else:\n break\n print(result)\n', 'A, B, C, K = map(int, input().split())\nif A >= K:\n print(K)\nelif (A + B) >= K:\n print(A)\nelif (A + B + C) > K:\n print(A - (K - A - B))\nelif (A + B + C) == K:\n print(A - C)'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s067559981', 's088956438', 's402864796', 's831940263', 's870978431', 's998683883', 's082311731'] | [9024.0, 9224.0, 9032.0, 9148.0, 9096.0, 9152.0, 9168.0] | [24.0, 2205.0, 27.0, 20.0, 2206.0, 2206.0, 21.0] | [182, 632, 216, 602, 480, 632, 183] |
p02682 | u373858851 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['abck=list(input().split())\na=abck[0]\nb=abck[1]\nc=abck[2]\nk=abck[3]\n\nif a>=k:\n print(a)\nelif a<k:\n if a+b>k:\n print(a)\n else:\n print(a-(k-a-b))', 'abck=list(map(int,input().split()))\na=abck[0]\nb=abck[1]\nc=abck[2]\nk=abck[3]\n\nif a>=k:\n print(k)\nelif a<k:\n if a+b>=k:\n print(a)\n else:\n print(a-(k-a-b))\n \n'] | ['Runtime Error', 'Accepted'] | ['s798571673', 's978972740'] | [9120.0, 9176.0] | [22.0, 21.0] | [165, 181] |
p02682 | u375193358 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = map(int,input().split())\nstep1 = K-A\nstep2 = step1 - B\nstep3 = step2 - C\nif step1 <= 0:\n print(K)\nelif step2 <= 0:\n print(K)\nelse:\n print(A-step2)\n', 'A, B, C, K = map(int,input().split())\nstep1 = K-A\nstep2 = step1 - B\nstep3 = step2 - C\nif step1 <= 0:\n print(K)\nelif step2 <= 0:\n print(A)\nelse:\n print(A-step2)\n'] | ['Wrong Answer', 'Accepted'] | ['s567511053', 's687213077'] | [9000.0, 9076.0] | [22.0, 24.0] | [169, 169] |
p02682 | u379378343 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k = list(map(int,input().split()))\nsum1 = 0\nwhile(k>0):\n if(k>=a and a!=0):\n k = k-a\n a = 0\n sum1+=a\n elif(k<a):\n a = a - k\n sum1 = k\n elif(k>=b and b!=0):\n b=0\n k = k-b\n elif(k<b):\n b = b - k\n sum1=k\n elif(k>=c and c!=0):\n k = k-c\n sum1 = sum1 - c\n c=0\n elif(k<c):\n c = c-k\n sum1 = k\nprint(sum1)', 'a,b,c,k = map(int,input().split())\nsum1 = 0\nwhile(k>0):\n if(k>=a and a!=0):\n k = k-a\n sum1+=a\n a=0\n elif(k<a):\n a = a - k\n sum1 += k\n k = k-k\n \n elif(k>=b and b!=0):\n k = k-b\n b=0\n elif(k<b):\n b = b - k\n k = k-k\n \n elif(k>=c and c!=0):\n k = k-c\n sum1 = sum1 - c\n c=0\n elif(k<c):\n c = c-k\n sum1 = sum1 - k\n k = k-k\n\nprint(sum1)\n'] | ['Wrong Answer', 'Accepted'] | ['s211722535', 's025198826'] | [9224.0, 8976.0] | [2205.0, 21.0] | [419, 464] |
p02682 | u380669795 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ["ABCK = input()\nkey = ['A', 'B', 'C', 'K']\nABCK = [int(i) for i in list(ABCK.split())]\nABCK = {k: v for k, v in zip(key, ABCK)}\nsum = 0\nprint(ABCK)\n\nif ABCK['A'] > ABCK['K']:\n sum = ABCK['K']\nelse:\n if ABCK['A'] + ABCK['B'] >= ABCK['K']:\n sum = ABCK['A']\n else:\n K = ABCK['K'] - (ABCK['A'] + ABCK['B'])\n if ABCK['A'] - K < 0:\n sum = 0\n else:\n sum = ABCK['A'] - K\nprint(sum)", "ABCK = input()\nkey = ['A', 'B', 'C', 'K']\nABCK = [int(i) for i in list(ABCK.split())]\nABCK = {k: v for k, v in zip(key, ABCK)}\nsum = 0\nprint(ABCK)\n\nif ABCK['A'] > ABCK['K']:\n sum = ABCK['K']\nelse:\n if ABCK['A'] + ABCK['B'] >= ABCK['K']:\n sum = ABCK['A']\n else:\n if ABCK['A'] - ABCK['C'] < 0:\n sum = 0\n else:\n sum = ABCK['A'] - ABCK['C']\nprint(sum)", 'a, b, c, k = [int(i) for i in input().split()]\nans = 0\n\nif k <= a:\n ans = k\nelif k <= (a+b):\n ans = a\nelse:\n ans = a - (k - (a+b))\n\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s472656857', 's545756088', 's632827302'] | [9148.0, 9180.0, 9128.0] | [21.0, 23.0, 24.0] | [397, 369, 145] |
p02682 | u382423941 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = map(int, input().split())\nif a + b >= k:\n print(max(a, k))\nelse:\n print(a - (k - a - b))', 'a, b, c, k = map(int, input().split())\nif a + b >= k:\n print(min(a, k))\nelse:\n print(a - (k - a - b))'] | ['Wrong Answer', 'Accepted'] | ['s254897994', 's233599359'] | [9168.0, 9132.0] | [22.0, 23.0] | [107, 107] |
p02682 | u382639013 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A, B, C, K = map(int, input().split())\n\na = 0\nfor i in range(1,A+1):\n a = a + 1\n\nif (A + B) < K:\n for i in range(0,K-A-B):\n a = a - 1', 'A, B, C, K = map(int, input().split())\n\nif A > K:\n a = K\nelse:\n a = A\n \nif (A + B) < K:\n a = a - K + A + B\nprint(a)'] | ['Wrong Answer', 'Accepted'] | ['s907516813', 's588958644'] | [9144.0, 9156.0] | [2205.0, 22.0] | [146, 127] |
p02682 | u387870994 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a = list(map(int, input().split()))\n\nsum = 0\n\nsum += 1 * a[0]\na[3] -= a[0]\na[3] -= a[1]\n\nif a[2] >= a[3]:\n sum += -1 * a[0]\n\nprint(sum)', 'a = list(map(int, input().split()))\n\nsum = 0\n\nif a[0] >= a[3]:\n sum += -1 * a[3]\nelse:\n sum += -1 * a[0]\n\na[3] -= a[0]\na[3] -= a[1]\n\nif a[3] > 0:\n if a[2] > a[3]:\n sum += -1 * a[3]\n else:\n sum += -1 * a[2]\n\nprint(sum)', 'a = input().split\n\nsum = 0\n\nsum += 1 * a[0]\na[3] -= a[0]\na[3] -= a[1]\n\nif a[2] < a[3]:\n sum -= 1 * a[0]\n\nprint(sum)', 'a = list(map(int, input().split()))\n\nsum = 0\n\nif a[0] >= a[3]:\n sum += -1 * a[3]\nelse:\n sum += -1 * a[0]\n\na[3] -= a[0]\na[3] -= a[1]\n\nif a[2] >= a[3]:\n sum += -1 * a[3]\nelse:\n sum += -1 * a[2]\n\nprint(sum)', 'a = list(map(int, input().split()))\n\nsum = 0\n\nfor i in range(3):\n if a[3] <= 0:\n break\n if a[i] >= a[3]:\n sum += (1 - i) * a[3]\n else:\n sum += (1 - i) * a[i]\n a[3] -= a[i]\n \nprint(sum)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s545529431', 's787906511', 's897065729', 's953229954', 's254654879'] | [9180.0, 9204.0, 9120.0, 9192.0, 9188.0] | [21.0, 22.0, 22.0, 24.0, 23.0] | [138, 243, 118, 215, 224] |
p02682 | u398203017 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K=int(input().split())\nif A>=K:\n print(K)\nelif (A+B)>=K:\n print(A)\nelse:\n print(A-(K-A))\n ', 'A,B,C,K=map(int,input().split())\nif A>=K:\n print(K)\nelif (A+B)>=K:\n print(A)\nelse:\n print(A-(K-A-B))\n \n'] | ['Runtime Error', 'Accepted'] | ['s161954308', 's844766753'] | [9124.0, 9064.0] | [24.0, 21.0] | [100, 107] |
p02682 | u404789658 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K = map(int,input().split())\n\nif A >= K:\n print(K)\nelif A + B >= K:\n print(K)\nelse:\n print(A - (K-(A+B)))', 'A,B,C,K = map(int,input().split())\n\nif A >= K:\n print(K)\nelif A + B >= K:\n print(A)\nelse:\n print(A - (K-(A+B)))'] | ['Wrong Answer', 'Accepted'] | ['s892619397', 's068686781'] | [9168.0, 8900.0] | [24.0, 24.0] | [120, 120] |
p02682 | u406138190 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k=map(int,input().split())\nans\nif(a>=k):\n ans=k\nelse:\n if((a+b)>=k):\n ans=a\n else:\n x=k-a-b\n ans=a-x\nprint(ans)', 'a,b,c,k=map(int,input().split())\nprint(a)\ns=[]\nans=0\nfor i in range (a):\n s.append(1)\nfor i in range (b):\n s.append(0)\nfor i in range (c):\n s.append(-1)\nfor i in range (k):\n ans+=s[i]\nprint(ans)', 'a,b,c,k=map(int,input().split())\nans=0\nif(a>=k):\n ans=k\nelse:\n if((a+b)>=k):\n ans=a\n else:\n x=k-a-b\n ans=a-x\nprint(ans)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s923409207', 's987337834', 's171135363'] | [9176.0, 245332.0, 9176.0] | [24.0, 2211.0, 23.0] | [147, 206, 149] |
p02682 | u407513296 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A = input()\nB = input()\nC = input()\nK = input()\n\nresult = 0\n\nfor i in K:\n if A != 0:\n result = result - 1;\n A = A - 1;\n elif A == 0 and B != 0:\n \n B = B - 1;\n elif A == 0 and B == 0:\n result = result - 1;\n C = C - 1;\n else:\n break\n\nprint(result)\n', 'a,b,c,k = map(int, input().split())\n\nresult = 0\n\nfor i in k:\n if a != 0:\n result = result + 1\n a = a - 1\n elif a == 0 and b != 0:\n \n b = b - 1\n elif a == 0 and b == 0 and c != 0:\n result = result - 1\n c = c - 1\n else:\n break\n\nprint(result)\n', 'a, b, c, k = map(int, input().split())\n\nif a >= k:\n print(k)\n exit()\nif b >= k-a:\n print(a)\n exit()\nif c >= k-a-b:\n print(a-(k-a-b))\n exit()\n\nprint(a-c)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s000367590', 's216285786', 's974896106'] | [9116.0, 9184.0, 9064.0] | [24.0, 22.0, 21.0] | [326, 321, 171] |
p02682 | u408620326 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ["def main():\n import sys\n sys.setrecursionlimit(10**6)\n input = sys.stdin.readline\n A, B, C, K = [int(x) for x in input().strip().split()]\n if K <= A + B:\n print(min(K, A))\n else:\n print(A - (K - A - B)))\n \nif __name__ == '__main__':\n main()", "def main():\n import sys\n sys.setrecursionlimit(10**6)\n input = sys.stdin.readline\n A, B, C, K = [int(x) for x in input().strip().split()]\n if K <= A + B:\n print(min(K, A))\n else:\n print(A - (K - A - B))\n \nif __name__ == '__main__':\n main()"] | ['Runtime Error', 'Accepted'] | ['s977051413', 's394762061'] | [8976.0, 9172.0] | [22.0, 22.0] | [278, 277] |
p02682 | u408791346 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = map(int, input().split())\nabc = []\nfor i in range(a):\n abc.append(1)\n\nfor j in range(b):\n abc.append(0)\n\nfor l in range(c):\n abc.append(-1)\n\nprint(sum(abc[0:l]))', 'a, b, c, k = map(int, input().split())\nabc = []\nfor i in range(a):\n abc.append(1)\nfor j in range(b):\n abc.append(0)\nfor k in range(c):\n abc.append(-1)\n\nprint(sum(abc[0:k]))', 'a, b, c, k = map(int, input().split())\nans = 0\nif a >= k :\n ans += k\nelif a < k :\n ans += a\n if b >= (k-a):\n ans += 0\n elif b < (k-a) :\n ans += ((k-a)-b)*-1\n\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s314055592', 's619769382', 's863214746'] | [243804.0, 243320.0, 9184.0] | [2211.0, 2211.0, 22.0] | [183, 181, 194] |
p02682 | u409254176 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['\n \na,b,c,k = map(int,input().split())\nz=k-min(k,a)\nif z>0:\n z=k-min(k,b)\nprint(a-z)\n', 'z=0\na,b,c,k = map(int,input().split())\nz=k-a\nprint(a+z*-1)\n\n\n', '\n \na,b,c,k = map(int,input().split())\nz=k-min(k,a)\nz=k-min(k,b)\nprint(a-z)\n', 'a,b,c,k = map(int,input().split())\nax=min(a,k)\nk=k-ax\nbx=min(b,k)\nk=k-bx\ncx=k\nprint(ax-cx)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s504009893', 's532579186', 's858006867', 's760115443'] | [9160.0, 9152.0, 9084.0, 9172.0] | [21.0, 23.0, 23.0, 21.0] | [87, 61, 75, 90] |
p02682 | u409306788 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['import sys\ninput = sys.stdin.readline\n\n\na, b, c, k = map(int, input().split())\n\nif a < k:\n\tprint(k)\nelif a + b >= k:\n\tprint(a)\nelse:\n\tminus = k - (a + b)\n\tprint(a - minus)', 'import sys\ninput = sys.stdin.readline\n\n\na, b, c, k = map(int, input().split())\n\nif a > k:\n\tprint(k)\nelif a + b >= k:\n\tprint(a)\nelse:\n\tminus = k - (a + b)\n\tprint(a - minus)'] | ['Wrong Answer', 'Accepted'] | ['s642644976', 's506875984'] | [9180.0, 9104.0] | [24.0, 22.0] | [200, 200] |
p02682 | u411478442 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k = (int(x) for x in input().split())\n\nmax = 0\n\nif(a > k):\n max += k\n k = 0\nelse:\n max += a\n k -= a \n \nif(not k == 0)and(b > k):\n k = 0\nelse:\n k -= b\n \nif(not k == 0)and(c > k):\n max -= k\nelse:\n max -= c\n\nprint(max)\n ', 'a,b,c,k = (int(x) for x in input().split())\n\nmax = 0\n\nif(a > k):\n max += k\n k = 0\nelse:\n max += a\n k -= a \n \nif(k != 0)and(b > k):\n k = 0\nelif k != 0:\n k -= b\n \nif(c > k):\n max -= k\nelif k != 0:\n max -= c\n\nprint(max)\n '] | ['Wrong Answer', 'Accepted'] | ['s617794547', 's456211226'] | [9196.0, 9200.0] | [21.0, 23.0] | [235, 230] |
p02682 | u413960612 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K = map(int, input().split())\n\nif(A - K < 0):\n if(A + B - K < 0):\n print(2 * A - K + B))\n else:\n print(A)\nelse:\n print(K)', 'A,B,C,K = map(int, input().split())\n\nif(A - K < 0):\n if(A + B - K < 0):\n print(2 * A - K + B)\n else:\n print(A)\nelse:\n print(K)'] | ['Runtime Error', 'Accepted'] | ['s682640731', 's112122300'] | [8924.0, 9036.0] | [25.0, 30.0] | [150, 149] |
p02682 | u418589486 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = map(int,input().split())\nif k < a :\n print(k)\nelif k> a and k=< a+b \n print(a)\nelse :\n print(2*a + b - k)\n', 'a, b, c, k = map(int,input().split())\nif k <= a :\n\tprint(k)\nelif k > a and k <= a+b :\n\tprint(a)\nelse :\n\tprint(2*a + b - k)\n'] | ['Runtime Error', 'Accepted'] | ['s887032444', 's100741066'] | [8820.0, 9092.0] | [24.0, 21.0] | [122, 123] |
p02682 | u427514507 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['import itertools\n\nA, B, C, K = map(int, input().split(" "))\ndata = [1 for _ in range(A)] + [0 for _ in range(B)] + [-1 for _ in range(C)]\n\nsums = [sum(conb) for conb in itertools.combinations_with_replacement(data, K)]\nprint(max(sums))\n', 'import itertools\n\nA, B, C, K = map(int, input().split(" "))\ndata = [1 for _ in range(A)] + [0 for _ in range(B)] + [-1 for _ in range(C)]\n\nconbs = list(itertools.combinations_with_replacement(data, K))\nsums = [sum(conb) for conb in conbs]\nprint(max(sums))\n', 'A, B, C, K = map(int, input().split(" "))\nif K-A <= 0:\n print(K)\nelse:\n if K - (A + B) <= 0:\n print(A)\n elif K == A+B+C:\n print(A-C)\n else:\n print(A - (K-(A+B)))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s069755899', 's684305817', 's075589744'] | [627348.0, 627572.0, 9060.0] | [2226.0, 2221.0, 26.0] | [236, 256, 195] |
p02682 | u430726059 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['A,B,C,K = map(int,input().split())\nif A>=K:\n print(A)\nelif A+B>=K:\n print(K)\nelse:\n print(2*A+B-K)', 'A,B,C,K = map(int,input().split())\nif A>=K:\n print(K)\nelif A+B>=K:\n print(A)\nelse:\n print(2*A+B-K)'] | ['Wrong Answer', 'Accepted'] | ['s691997158', 's746200403'] | [9144.0, 9076.0] | [28.0, 29.0] | [101, 101] |
p02682 | u432754124 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = int(input())\nif a > k:\n\tprint(sum(([1] * a)[:k]))\nelse:\n\tprint(sum([1] * a))', 'a, b, c, k = list(map(int, input().split()))\nif k <= (a + b):\n\ts = k * 1\nelse:\n\ts = (k * 1) + ((k-(a+b)) * (-1))\nprint(s) ', 'a, b, c, k = list(map(int, input().split()))\nif k <= (a + b):\n\ts = k * 1\nelse:\n\ts = (a * 1) + ((k-(a+b)) * (-1))\nprint(s) ', 'a, b, c, k = list(map(int, input().split()))\nif k <= a:\n\ts = k * 1\nelif k <= (a+b):\n\ts = a * 1\nelse:\n\ts = (a * 1) + ((k-(a+b)) * (-1))\nprint(s) '] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s174632553', 's490066565', 's816352184', 's454344775'] | [9148.0, 9128.0, 9108.0, 9156.0] | [23.0, 23.0, 21.0, 25.0] | [89, 122, 122, 144] |
p02682 | u436173409 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = [int(e) for e in input().split()]\n\nimport numpy as np\n\nall = np.zeros(k)\nall[:a] +=1\nall[a+b:] -=1\n\nprint(sum(all))', 'a, b, c, k = [int(e) for e in input().split()]\n\ncount=0\n\nif k <= a:\n count +=k\nelif k <= a+b:\n count +=a\nelse:\n count = 2*a + b - k\n\nprint(count)'] | ['Runtime Error', 'Accepted'] | ['s876864570', 's242921364'] | [2924044.0, 9160.0] | [2279.0, 22.0] | [128, 154] |
p02682 | u440129511 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k=map(int,input())\nif k<=a:\n print(k)\nelif k<=a+b:\n print(a)\nelse:\n print(a-(k-a-b))', 'a,b,c,k=map(int,input().split())\nif k<=a:\n print(k)\nelif k<=a+b:\n print(a)\nelse:\n print(a-(k-a-b))'] | ['Runtime Error', 'Accepted'] | ['s477549733', 's858435432'] | [9164.0, 9164.0] | [25.0, 20.0] | [99, 107] |
p02682 | u440608859 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k=map(int,input().split())\nans=min(a,k)\nt=min(a,k)\nk=k-t\nans+=min(b,k)\nk-=min(b,k)\nans+=min(c,k)\nprint(ans)\n ', 'a,b,c,k=map(int,input().split())\nans=min(a,k)\nk-=min(a,k)\nk-=min(b,k)\nans-=min(c,k)\nprint(ans)\n '] | ['Wrong Answer', 'Accepted'] | ['s026366148', 's018527309'] | [9180.0, 9168.0] | [22.0, 22.0] | [118, 99] |
p02682 | u443151804 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a,b,c,k=[int(i) for i in input().split()]\nprint(k if k<= a else a if k <=a+b else 2a+b-k)', 'a,b,c,k=[int(i) for i in input().split()]\nprint(k if k<=a else a if k <=a+b else 2*a+b-k)'] | ['Runtime Error', 'Accepted'] | ['s607306173', 's132546423'] | [8920.0, 9164.0] | [24.0, 21.0] | [89, 89] |
p02682 | u443569380 | 2,000 | 1,048,576 | We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen? | ['a, b, c, k = map(int, input().split())\n\nif k <= a:\n print(a)\nelif k - a > b:\n print(-1 * ((k - a) - b) + a)\n', 'a, b, c, k = map(int, input().split())\n\nif k <= a:\n print(k)\nelif k - a > b:\n print(-1 * ((k - a) - b) + a)\nelse:\n print(a)'] | ['Wrong Answer', 'Accepted'] | ['s447508719', 's933768623'] | [9160.0, 9176.0] | [19.0, 21.0] | [114, 132] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.