problem_id
int64
0
4.72k
problem_content
stringlengths
152
5.64k
code_prompt
stringclasses
1 value
difficulty
stringclasses
3 values
solutions
stringlengths
98
1.12M
test_cases
stringlengths
70
1.03M
4,683
Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). -----Constraints----- - 2 \leq N \leq 2\times 10^5 - 0 \leq A_i \leq 10^9 - All values in input are integers. -----Input----- Input is given from Standard Input in the following format: N A_1 \ldots A_N -----Output----- Print \sum_{i=1}^{N-1}\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7). -----Sample Input----- 3 1 2 3 -----Sample Output----- 11 We have 1 \times 2 + 1 \times 3 + 2 \times 3 = 11.
introductory
[{"code": "def main():\n N=int(input())\n CONST= 10**9+7\n Output = 0\n lis = list(map(int,input().split())) \n lis.sort()\n SumLis = [0]*N\n for i,item in enumerate(lis):\n SumLis[i] += SumLis[i-1]+item\n for i,item in enumerate(lis):\n Output += lis[i] * (SumLis[-1]-SumLis[i])\n Output %= CONST\n print(Output)\n\n \ndef __starting_point():\n main()\n\n\n__starting_point()", "passed": true, "time": 0.36, "memory": 14308.0, "status": "done"}, {"code": "def cumsum(xs):\n result = [xs[0]]\n for x in xs[1:]:\n result.append(result[-1] + x)\n return result\n\nN = int(input())\nA = list(map(int, input().split()))\n\nans = 0\nMOD = 10**9 + 7\nA.reverse()\nruisekiwa = cumsum(A)\nruisekiwa.reverse()\nA.reverse()\n\nfor i in range(N-1):\n ans = (ans + A[i] * ruisekiwa[i+1]) % MOD\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\ns = [0]\nfor i in range(n):\n\ts.append(s[i] + a[i])\nans = sum(a[i] * (s[n]-s[i+1]) for i in range(n))\nprint(ans % (10**9 + 7))", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nmod = 10**9 + 7\ns = sum(a)\nans = 0\n\nfor x in a:\n s -= x\n ans += s * x\n \nprint(ans%mod)", "passed": true, "time": 0.28, "memory": 14252.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nA2 = [A[0]]\nmod = 10 ** 9 + 7\nres = 0\nfor i in range(1, N):\n A2.append((A2[i-1] + A[i]) % mod)\nfor i in range(N-1):\n res = (res + A[i] * (A2[N-1] - A2[i])) % mod\nprint(res)", "passed": true, "time": 0.32, "memory": 14104.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nmod = 10**9 + 7\nans = 0\ns = sum(a)\n\nfor x in a:\n s -= x\n ans += s * x\n ans %= mod\n \nans %= mod\nprint(ans)", "passed": true, "time": 0.36, "memory": 14104.0, "status": "done"}, {"code": "CONST = 10 ** 9 + 7\nN = int(input())\nnumbers = list(map(int, input().split()))\nr = 0\n\n\ndef cumsum(xs):\n result = []\n for i in range(len(xs)):\n if i == 0:\n result.append(xs[0])\n else:\n result.append(result[-1] + xs[i])\n return result\n\n\nnumbers.reverse()\nnum_sum = cumsum(numbers)\nnum_sum.reverse()\nnumbers.reverse()\ndel num_sum[0]\nfor i in range(N-1):\n r += (numbers[i]*num_sum[i])%CONST\nprint((r % CONST))\n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "import math\nprime = [True for i in range(10**6+1)]\ndef SieveOfEratosthenes(n): \n\tp = 2\n\twhile (p * p <= n): \n\t\tif (prime[p] == True):\n\t\t\tfor i in range(p * p, n+1, p): \n\t\t\t\tprime[i] = False\n\t\tp += 1\n\ndef __starting_point():\n\tN = int(input())\n\tL = list(map(int,input().split()))\n\tMOD = 10**9 + 7\n\tsum_L = sum(L)\n\tans = 0\n\tfor i in range(N - 1):\n\t\tsum_L = sum_L - L[i]\n\t\tans = (ans + sum_L*L[i])%MOD\n\tprint(ans)\n\n\n\n\n\n__starting_point()", "passed": true, "time": 0.3, "memory": 21276.0, "status": "done"}, {"code": "import math\nprime = [True for i in range(10**6+1)]\ndef SieveOfEratosthenes(n): \n\tp = 2\n\twhile (p * p <= n): \n\t\tif (prime[p] == True):\n\t\t\tfor i in range(p * p, n+1, p): \n\t\t\t\tprime[i] = False\n\t\tp += 1\n\ndef __starting_point():\n\tN = int(input())\n\tL = list(map(int,input().split()))\n\tMOD = 10**9 + 7\n\tsum_L = sum(L)\n\tans = 0\n\tfor i in range(N - 1):\n\t\tsum_L = sum_L - L[i]\n\t\tans = (ans + sum_L*L[i])%MOD\n\tprint(ans)\n\n\n\n\n3\n__starting_point()", "passed": true, "time": 0.33, "memory": 21396.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nmod = 10**9+7\n\n# result = 0\n# for i in range(N):\n# for j in range(N):\n# if i < j:\n# result += (A[i] * A[j]) % mod\n\n# print(result % mod)\n\n# result = 0\n# for i in range(N):\n# j = i+1\n\n# while(j < N):\n# result += (A[i] * A[j]) % mod\n# #print(i, \" : \", j)\n# j += 1\n\n# print(result % mod)\n\nA_sum = sum(A)\nresult = 0\nfor i in range(N):\n A_sum = A_sum - A[i]\n result += (A[i] * A_sum) % mod\n\nprint(result % mod)", "passed": true, "time": 0.3, "memory": 14184.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\ns = [0]\nfor i in range(n):\n\ts.append(s[i] + a[i]) # \u7d2f\u7a4d\u548c\nans = sum(a[i] * (s[n]-s[i+1]) for i in range(n))\nprint(ans % (10**9 + 7))", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\ns = 0\ns2 = sum(A)\n\nfor i in range(N-1):\n s2 -= A[i]\n s += A[i] * s2\n\nanswer = s % (10**9+7)\nprint(answer)", "passed": true, "time": 0.26, "memory": 14212.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nsuma = sum(a)\nc = 0\nfor num in a:\n c += num**2\nprint((suma**2-c)//2%(10**9+7))", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "n = int(input().strip())\nl = list(map(int,input().strip().split()))\ns = sum(l)\nans=0\nMOD=1000000007\nfor i in range(n-1):\n\tans+=l[i]*(s-l[i])\n\ts-=l[i]\n\t\nprint((ans%MOD))\n\t\n", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "mod = 10**9 + 7\nn = int(input())\nl = list(map(int,input().split()))\nsum_l = sum(l)\nans = 0\nfor i in range(n):\n sum_l -= l[i]\n ans += sum_l * l[i]\nprint(ans%mod)", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "CONST = 10 ** 9 + 7\nN = int(input())\nnumbers = list(map(int, input().split()))\nr = 0\n\n\ndef cumsum(xs):\n result = []\n for i in range(len(xs)):\n if i == 0:\n result.append(xs[0])\n else:\n result.append(result[-1] + xs[i])\n return result\n\n\nnumbers.reverse()\nnum_sum = cumsum(numbers)\nnum_sum.reverse()\nnumbers.reverse()\ndel num_sum[0]\nfor i in range(N-1):\n r += (numbers[i]*num_sum[i])%CONST\nprint((r % CONST))\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n = int(input())\narr = input()\nar = list(map(int,arr.split(' ')))\nsum=0\ns=0\nmod=1000000007\nfor i in range(0,n):\n sum=sum+(ar[i]*ar[i])\n s=s+ar[i]\ns=s*s\nprint(((s-sum)//2)%mod)", "passed": true, "time": 0.26, "memory": 14220.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nprint((sum(A)**2-sum(a**2 for a in A))//2%(10**9+7))", "passed": true, "time": 0.15, "memory": 14232.0, "status": "done"}, {"code": "n = int(input())\nA = [int(x) for x in input().split()]\nmod = 10**9+7\na_cum = [0] * (n+1)\n# \u7d2f\u7a4d\u548c\u306e\u8a08\u7b97\nfor i in range(n):\n a_cum[i + 1] = a_cum[i] + A[i]\nans = 0\nfor i in range(len(A)-1):\n # a_cum[n]\u306f\u5168\u3066\u306e\u5408\u8a08\u3068\u540c\u7fa9\u3002a_cum\u306findex\u304c1\u3064\u305a\u308c\u3066\u3044\u308b\u306e\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\u3002 \n ans += A[i] * (a_cum[n] - a_cum[i+1]) % mod\nans %= mod\nprint(ans)", "passed": true, "time": 0.16, "memory": 14192.0, "status": "done"}, {"code": "n=int(input())\nalst=list(map(int,input().split()))\nmod=10**9+7\n\nlst_sm=sum(alst)\nsm=lst_sm**2\nfor i in range(n):\n sm-=alst[i]**2\nsm//=2\nprint((sm%mod))\n", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nmod = 10 ** 9 + 7\nans = 0\ntotal = sum(a)\nfor i in range(n):\n total -= a[i]\n ans = (ans + total * a[i]) % mod\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\ns = sum(a)\nans = 0\nsub = 0\n\nfor i in range(n):\n ans += a[i]*s\n \nfor j in range(n):\n sub += a[j]**2\n \nprint(((ans-sub)//2)%(10**9 + 7))", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "def cusum(a):\n cusum = [a[0]]\n for i in range(len(a)-1):\n cusum.append(cusum[i] + a[i+1])\n return cusum\n\n\ndef solve1(n, a):\n ans = 0\n mod = 10**9 + 7\n cusum_a = cusum(a)\n\n for i in range(n):\n ans += a[i] * (cusum_a[-1] - cusum_a[i])\n \"\"\"\n print(a[i], \"*\",\n \"(\", a[i+1:], \"=\", (cusum_a[-1] - cusum_a[i]), \")\",\n \"=\", a[i] * (cusum_a[-1] - cusum_a[i]))\n \"\"\"\n ans %= mod\n\n return ans\n\n\nn = int(input())\na = list(map(int, input().split(\" \")))\nprint((solve1(n, a)))\n", "passed": true, "time": 0.21, "memory": 14316.0, "status": "done"}, {"code": "import sys\n# from numpy import cumsum\ninput = sys.stdin.readline\nn = int(input())\na = [int(_) for _ in input().split()]\nmod = 10**9 + 7\nans = 0\ns = [0]\na_ = a[::-1]\nfor i in range(len(a_)-1):\n s.append(s[i]+a_[i])\ns = s[::-1]\ns.pop(len(s)-1)\n# print(s)\nfor i in range(len(a)-1):\n ans += a[i] * s[i]\n ans = ans % mod\nprint(ans)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "CONST = 10 ** 9 + 7\nN = int(input())\nnumbers = list(map(int, input().split()))\nr = 0\n\n\ndef cumsum(xs):\n result = []\n for i in range(len(xs)):\n if i == 0:\n result.append(xs[0])\n else:\n result.append(result[-1] + xs[i])\n return result\n\n\nnumbers.reverse()\nnum_sum = cumsum(numbers)\nnum_sum.reverse()\nnumbers.reverse()\ndel num_sum[0]\nfor i in range(N - 1):\n r += (numbers[i] * num_sum[i]) % CONST\nprint((r % CONST))\n", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\ns = sum(a)\nx = [i**2 for i in a]\nx = sum(x)\nans = (s**2-x)//2\nprint(ans%(10**9+7))", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\ns = [0]*(n+1)\nmod = 10**9 + 7\nfor i in range(1,n+1):\n s[i] = s[i-1] + a[i-1]\nans = 0\nfor j in range(1,n):\n ans += a[j-1]*(s[n]-s[j])\nprint(ans%mod)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "# -*- coding utf-8 -*-\n\nMOD = 10 ** 9 + 7\n\nN = int(input())\nAN = list(map(int, input().split()))\n\ncumsum = [0] * (len(AN) + 1)\nfor i in range(1, N + 1):\n cumsum[i] = cumsum[i - 1] + AN[i - 1]\n\nans = 0\nfor i in range(1, N):\n ans += AN[i] * cumsum[i]\n ans %= MOD\n\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n = input()\na = list(map(int,input().split()))\nsum = 0\nmsum = 0\nfor i in a:\n sum += i\n msum += i*i\nans = int((sum*sum - msum)//2)\nprint(int(ans%1000000007))", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "n = int(input())\nl = list(map(int,input().split()))\nA = sum(l)-l[0]\nans = 0\nfor i in range(len(l)) :\n ans += l[i]*A\n \n if A == l[-1] :\n break\n else :\n A -= l[i+1]\n\nprint(ans%(10**9+7))", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "#abc177c\nn=int(input())\na=list(map(int,input().split()))\ns=sum(a)\nt=sum([x*x for x in a])\nprint(((s*s-t)//2%(10**9+7)))\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "def cin():\n return list(map(int, input().split()))\n\n\nN = int(input())\nA = cin()\n\ntotal = 0\nstore = 0\nfor i in range(N - 1):\n store += A[N - i - 1]\n total += A[N - i - 2] * store\nprint((total % (pow(10, 9) + 7)))\n", "passed": true, "time": 0.64, "memory": 14096.0, "status": "done"}, {"code": "N=int(input())\nb = 0\na = list(map(int, input().split()))\nc = 0\nfor i in range(0,N):\n c = c + a[i]\nfor i in range(0,N):\n c = c - a[i]\n b = (b + a[i] * c) %(10**9+7)\nprint(b)", "passed": true, "time": 0.68, "memory": 14304.0, "status": "done"}, {"code": "N = int(input())\nmod = 10**9 + 7\nA = list(map(int, input().split()))\nAsum = sum(A)\nans = 0\nfor a in A:\n Asum -= a\n ans += a*Asum % mod\nprint(ans % mod)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\ncount = 0\nans = 0\nfor i in range(1,n):\n count += a[-i]\n ans += a[-i-1]*count\n ans = ans%(10**9+7)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\ns = sum(a)\nans = 0\nfor i in a:\n s -= i\n ans += i*s\nmod = ans % (10**9 + 7)\nprint(mod)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "MOD=10**9+7\nN=int(input())\nA=list(map(int,input().split()))\nsum_of_all=sum(A)**2\nsum_of_diagonal=0\nfor i in range(N):\n sum_of_diagonal+=A[i]**2\nprint((sum_of_all-sum_of_diagonal)//2%MOD)", "passed": true, "time": 0.23, "memory": 14340.0, "status": "done"}, {"code": "CONST = 10 ** 9 + 7\nN = int(input())\nnumbers = list(map(int, input().split()))\nr=0\n\ndef cumsum(xs):\n result = []\n for i in range(len(xs)):\n if i == 0:\n result.append(xs[0])\n else:\n result.append(result[-1] + xs[i])\n return result\nnumbers.reverse()\nnum_sum = cumsum(numbers)\nnum_sum.reverse()\nnumbers.reverse()\ndel num_sum[0]\nfor i in range(N-1):\n r+=(numbers[i]*num_sum[i])%CONST\nprint(r%CONST)", "passed": true, "time": 0.36, "memory": 14272.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\n\nmod = 10 ** 9 + 7\ns = sum(A) % mod\nans = 0\nfor i in range(n):\n s -= A[i]\n ans = (ans + (A[i] * s) % mod) % mod\nprint(ans)", "passed": true, "time": 0.15, "memory": 14068.0, "status": "done"}, {"code": "n = int(input())\nc = list(map(int, input().split()))\nc_ans = []\nans = 0\n\n#print(c)\nfor i in range(n):\n ans += c[i]\n #print(ans)\n c_ans.append(ans)\n \nre_ans = 0\n#print(c_ans)\n\nfor i in range(n):\n re_ans += c[i] * (c_ans[n-1] - c_ans[i])\n\nre_ans = re_ans % (10**9 + 7)\nprint(re_ans)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\n\ntotal = (sum(A))**2\nfor i in range(n):\n total -= (A[i])**2\nans = (total//2)%(10**9+7)\nprint(ans)\n", "passed": true, "time": 0.23, "memory": 14372.0, "status": "done"}, {"code": "from functools import reduce\nfrom operator import add\n\nN = int(input())\nA = list(map(int, input().split()))\n\ndef cum(total, a):\n total.append(a + total[-1])\n return total\n\ncumsum = reduce(cum, A, [0])\ncum_last = cumsum[-1]\n\np = 1000000007\n\ndef i_fixed(i):\n return (A[i] * (cum_last - cumsum[i+1])) % p\n\ndef solve():\n return map(i_fixed, range(N-1))\n\nprint(sum(solve()) % p)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nans = 0\nmod = 10**9 + 7\nb = sum(a)\n\nfor i in range(n-1):\n b = b-a[i]\n ans += a[i]*b\n\nprint(ans%mod)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nsuma = sum(a)\nans = 0\nfor i in range(len(a)):\n suma = suma - a[i]\n ans += suma * a[i]\nans = ans % (10**9+7)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int, input().split()))\ns=[]\nc=0\nans = 0\nfor i in a:\n\tc += i\n\ts.append(c)\nfor i in range(n-1):\n\tans += (a[i] * (s[n-1]-s[i])) % 1000000007\nprint(ans % 1000000007)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "def __starting_point():\n\n N = int(input())\n A = list(map(int, input().lstrip().split(' ')))\n\n cumA = [A[0]]\n for i in range(1,N):\n cumA.append(cumA[-1] + A[i])\n \n count = 0\n for i in range(N - 1):\n count += A[i] * ( cumA[N-1] - cumA[i] )\n \n print(count % (10**9 + 7))\n__starting_point()", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "def main():\n N = int(input())\n mod = 10**9 + 7\n \n a = list(map(int, input().split()))\n\n ans = 0\n s = 0\n \n for i in range(1, N):\n s += a[i]\n \n \n for i in range(1, N):\n ans += (a[i-1] * s) % mod\n s -= a[i]\n \n print(ans % mod)\n \n \n \ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "N = int(input())\nA = [int(a) for a in input().split()]\nmod = 10**9+7\n\nL = [0]*(N+1)\nfor i in range(N):\n L[i+1] = (L[i]+A[i])%mod\n\nans = 0\nfor i in range(N):\n ans += A[i]*(L[-1]-L[i+1])\n ans %= mod\nprint(ans)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\n\nmod = 10**9+7\n\nsum_list = []\nsum_ = 0\nfor i in range(len(A)-1):\n sum_ += A[i+1]\n sum_list.append(sum_)\n \nlen_ = 0\nfor i in range(len(A)-1):\n len_ += (A[i+1] * (sum_list[-1] - sum_list[i]) )% mod\n\nprint(((len_+A[0]*sum_list[-1])%mod))\n", "passed": true, "time": 0.15, "memory": 14292.0, "status": "done"}, {"code": "N, = map(int,input().split())\nA = list(map(int,input().split()))\nsu = A[N-1]\nsuu = su*A[N-2]\nfor i in reversed(range(1,N-1)):\n su+=A[i]\n suu+=(su*A[i-1])\nprint(suu%(10 ** 9+7))", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "import sys\nn=int(input())\na=[int(x) for x in input().split()]\n\ns=0\nfor i in range(n):\n s+=a[i]\nc=0\nsum=0\nfor k in range(n-1):\n c+=a[k]\n co=s-c\n sum+=a[k]*co\n\nprint((sum%(10**9+7)))\n", "passed": true, "time": 0.16, "memory": 14300.0, "status": "done"}, {"code": "from sys import stdin\nN = int(stdin.readline().rstrip())\nA = [int(_) for _ in stdin.readline().rstrip().split()]\n\nsa = sum(A)\nans = 0\n\nfor i in range(N):\n sa -= A[i]\n ans += A[i]*sa \n ans %= (10**9+7)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nrsum = [0 for _ in range(N)]\nans = 0\nfor i in range(N):\n if i == 0:\n continue\n rsum[-(i+1)] = rsum[-i] + A[-i]\nfor i in range(N):\n ans += A[i] * rsum[i]\nans %= (10 ** 9 + 7)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\n\ns = 0\nsum = 0\nans = 0\n\nfor i in range(n):\n s += A[i]\n\nfor j in range(n-1):\n s -= A[j]\n sum += A[j] * s\n\nans = sum % (10**9+7)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "MOD = 10 ** 9 + 7 # MOD\u306f\u5909\u6570\u306b\u5165\u308c\u3066\u3057\u307e\u3063\u305f\u307b\u3046\u304c\u6253\u3061\u9593\u9055\u3048\u306a\u304f\u3066\u3044\u3044\u3067\u3059\n\nN = int(input())\nA = list(map(int, input().split()))\n\nS = sum(A) % MOD\nans = 0\n\n# A_N\u3082\u542b\u307e\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u3068\u304d\u306fs=0\u306a\u306e\u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\nfor x in A:\n S -= x # \u81ea\u5206\u3068\u81ea\u5206\u81ea\u8eab\u3092\u639b\u3051\u306a\u3044\u3088\u3046\u306b\u3001\u5148\u306b\u5f15\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\n S %= MOD # MOD\u306f\u3044\u3061\u3044\u3061\u53d6\u3063\u3066\u304a\u304f\u3068\u3044\u3044\u3067\u3059\n ans += S * x\n ans %= MOD\n\nans %= MOD # \u3053\u306e\u884c\u306f\u5b8c\u5168\u306b\u4e0d\u8981\u3067\u3059\u304c\u3001\u6700\u5f8c\u3060\u3051MOD\u3092\u53d6\u308a\u5fd8\u308c\u3066WA\u306b\u306a\u308b\u30df\u30b9\u306f\u975e\u5e38\u306b\u3088\u304f\u3042\u308b\u306e\u3067\u3001\u5fc5\u8981\u4ee5\u4e0a\u306b\u53d6\u3063\u3066\u304a\u304f\u3068\u5b89\u5fc3\u3067\u304d\u307e\u3059\nprint(ans)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "p = 10**9 + 7\nn = int(input())\naa = list(map(int, input().split()))\ns = 0\nfor a in aa:\n s += a**2\n\nsa = sum(aa)\nb = sa*sa\nans = (b-s)//2\n\nprint(ans % p)", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "mod = 1000000000+7\n\nn = int(input())\nAs = list(map(int, input().split()))\n\n\nsum_ = sum(As)\nret = 0\nfor i in range(n-1):\n sum_ -= As[n-1-i]\n ret += sum_ * As[n-1-i]\n ret %= mod\n\nprint(ret)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nmod = 10**9 + 7\nb = sum(a)\nc = sum([i*i for i in a])\nans = ((b**2 - c)//2)%mod\nprint(ans)", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nmysum = sum(A)\ntotal = 0\nfor i in range(N-1):\n mysum -= A[i]\n total += A[i] * mysum\nprint(total % 1000000007)", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "n = int(input())\nli = list(map(int, input().split()))\nmod = 10**9 + 7\nsm = sum(li)\nmul = sum([i**2 for i in li])\nans = ((sm ** 2 - mul) // 2) % mod\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\n\n# \u89e3\u8aac\u3092\u8aad\u3093\u3067\u89e3\u3044\u305f\n\n# \u7d2f\u7a4d\u548c\u306e\u8a08\u7b97\n\nsm = [0]\nfor i in range(N):\n sm.append(sm[i]+A[i])\n\n# \u7d2f\u7a4d\u548c\u3092\u4f7f\u3063\u305f\u89e3\u7b54\nans = 0\nfor j in range(N):\n ans += A[j]*(sm[N]-sm[j+1])\n \nprint(ans % (10**9+7))", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nMOD = 10 ** 9 + 7\n\nS = sum(A) % MOD\n\nans = 0\nfor i in range(N - 1):\n S -= A[i]\n S %= MOD\n ans += (A[i] % MOD) * S\n ans %= MOD\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "N=int(input())\nA=[0]*N\nS=[0]*(N+1)\nA=list(map(int,input().split()))\nmod=10**9+7\n\nfor i in range(N):\n S[i+1]=(S[i]+A[i])%mod\n\ncnt=0\nfor j in range(N-1):\n cnt+=A[j]*(S[N]-S[j+1])%mod\n\nprint(cnt%mod)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\nsys.setrecursionlimit(20000000)\n\nMOD = 10 ** 9 + 7\nINF = float(\"inf\")\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n for i in range(N):\n A[i] %= MOD\n S = sum(A)\n answer = 0\n for i in range(N):\n S = S - A[i]\n answer += A[i] * S\n answer %= MOD\n print(answer)\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14252.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nmod = 1000000007\nsum = 0\nans = 0\nfor i in range(n):\n\tans = (ans + a[i]*sum) % mod\n\tsum += a[i]\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\n\nans = 0\n\nMOD = 10 ** 9 + 7\n\nsum_A = sum(A)\n\nfor i in range(N):\n sum_A -= A[i]\n ans += (sum_A * A[i])\n\nprint((ans % MOD))\n", "passed": true, "time": 0.18, "memory": 14260.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\n\nMOD = 10**9 + 7\ns = 0\n\nfor i in range(N):\n s += A[i]\nans = 0\nfor i in range(N-1):\n s -= A[i]\n ans += A[i] * s\n ans %= MOD\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14364.0, "status": "done"}, {"code": "mod = 10 ** 9 + 7\nN = int(input())\nA = list(map(int,input().split()))\nsum_of_all = sum(A)**2\nsum_of_diagonal = 0\nfor i in range(N):\n sum_of_diagonal += A[i]**2\nprint((sum_of_all - sum_of_diagonal) // 2 % mod)", "passed": true, "time": 0.15, "memory": 14236.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\n\nM = 10**9 + 7\n\nAns = 0\n\nT = sum(A)\n\nfor i in range(N-1):\n T -= A[i]\n Ans += A[i] * T\n Ans %= M\n\nprint(Ans)\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n=int(input())\nli=list(map(int,input().split()))\ns=sum(li)\nc=0\nfor i in range(n-1):\n s-=li[i]\n c+=li[i]*s\nprint(c%(10**9+7))", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "import itertools\n\nn = int(input())\na = list(map(int,input().split()))\nans = 0\n\nlis = list(itertools.accumulate(reversed(a)))\n\nfor i in range(n-1):\n ans += a[i]*lis[n-2-i]\n \nprint(ans%(10**9 + 7))", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nlim = (10 ** 9) + 7\nans = 0\ntemp = a[-1]\nfor i in range(2,n+1):\n ans += a[-i] * temp\n temp += a[-i]\n# print(\"ans = {} temp = {}\".format(ans,temp))\n\nprint(ans%lim)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "n = int(input())\nli = list(map(int,input().split()))\ns = [li[0]]\nans = 0\nm = 10**9 +7\nfor i in range(n-1):\n s.append(li[i+1] + s[i])\n\nfor j in range(n-1):\n ans += (li[j] * (s[n-1]-s[j])) % m\n\nprint(ans%m)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "mod = 10**9 + 7\n\nn = int(input())\na = list(map(int, input().split()))\ns = sum(a) % mod\nans = 0\n\nfor x in a:\n s -= x\n s %= mod\n ans += s * x\n ans %= mod\n \nans %= mod\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "mod = 10**9 + 7\nn = int(input())\na = [int(i) for i in input().split()]\ns = sum(a)\nout = 0\nfor i in a:\n s -= i\n out += s * i\n out %= mod\nprint(out)", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "N = int(input())\nnum = list(map(int, input().split(' ')))\nans = 0\ntotal = sum(num)\nMOD = 10 ** 9 + 7\nfor a in num:\n total -= a\n ans += a * total \n ans %= MOD\nans %= MOD\nprint(ans)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\n\nmod = (10**9)+7\nans = 0\nsums = [0]*N\nsums[0] = A[0]\nfor i in range(1, N):\n sums[i] = sums[i-1] + A[i]\n\nfor j in range(N):\n ans += A[j]*(sums[-1]-sums[j])\n\nprint(ans%mod)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\na_sum = sum(a)\nans = 0\nmod = 10**9 + 7\n\nfor i in range(n-1):\n a_sum = a_sum - a[i]\n ans += a[i] * a_sum\n\nprint(ans%mod)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\nmod = 10 ** 9 + 7\nrr = [0 for i in range(n + 1)]\n\nfor i in range(n):\n rr[i + 1] = (A[i] + rr[i]) % mod\n\nans = 0\nfor i in range(n):\n ans += A[i] * (rr[n] - rr[i + 1]) % mod\n\nprint((ans % mod))\n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "import itertools\nn = int(input())\nA = list(map(int, input().split()))\nA2=[]\nfor i in range(n):\n A2.append(A[n-1-i])\n\nacc_A2 = list(itertools.accumulate(A2))\nmod = (10**9)+7\n\ngoukei = 0\n\nfor i in range(n-1):\n goukei += A[i]*acc_A2[n-2-i]\n\nprint(goukei%mod)", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "CONST = 10 ** 9 + 7\nN = int(input())\nnumbers = list(map(int, input().split()))\nr=0\n\ndef cumsum(xs):\n result = []\n for i in range(len(xs)):\n if i == 0:\n result.append(xs[0])\n else:\n result.append(result[-1] + xs[i])\n return result\nnumbers.reverse()\nnum_sum = cumsum(numbers)\nnum_sum.reverse()\nnumbers.reverse()\ndel num_sum[0]\nfor i in range(N-1):\n r+=(numbers[i]*num_sum[i])%CONST\nprint((r%CONST))\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int,input().split()))\npaA = [0 for _ in range(n-1)]\npaA[0] = A[n-1]\nmod = 10**9 + 7\nfor i in range(1,n-1):\n paA[i] = paA[i-1] + A[n-1-i]\nsuma = 0\nfor i in range(n-1):\n suma += A[i] * paA[n-i-2]\n suma = suma % mod\nprint(suma)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\na_list = list(map(int, input().split()))\n\nsum = 0\ns_list=[]\nans = 0\n\nfor i in range(n):\n sum += a_list[i]\n s_list.append(sum)\n\nfor i in range(n-1):\n ans += a_list[i] * (s_list[n-1]-s_list[i])\n\nprint((ans % (7+10**9)))\n", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\na.sort()\ns = sum(a)\nx = [i**2 for i in a]\nx = sum(x)\nans = (s**2-x)//2\nmod = 10**9+7\nprint(ans%mod)", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "import sys\n\nN = int(input())\nA = list(map(int, input().split()))\n\nsum = [A[N-1]]\nans = 0\nfor i in range(1, N):\n ans += A[N-i-1]*sum[-1]%(10**9+7)\n ans %= (10**9+7)\n sum.append((sum[-1]+A[N-i-1])%(10**9+7))\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "mod = 10**9+7\nn = int(input())\nl = list(map(int, input().split()))\nans = []\na = sum(l)\nfor i in range(len(l)):\n a = a - l[i]\n ans.append(l[i] * a)\n\nprint((sum(ans)%mod))\n\n\n", "passed": true, "time": 0.17, "memory": 14036.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nmod=10**9+7\nsm=sum(a)\nmul=sum(i**2 for i in a)\nans=((sm ** 2 - mul) // 2) % mod\nprint(ans)\n\n", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}]
[{"input": "3\n1 2 3\n", "output": "11\n"}, {"input": "4\n141421356 17320508 22360679 244949\n", "output": "437235829\n"}]
4,684
AtCoDeer has three cards, one red, one green and one blue. An integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card. We will arrange the cards in the order red, green and blue from left to right, and read them as a three-digit integer. Is this integer a multiple of 4? -----Constraints----- - 1 ≤ r, g, b ≤ 9 -----Input----- Input is given from Standard Input in the following format: r g b -----Output----- If the three-digit integer is a multiple of 4, print YES (case-sensitive); otherwise, print NO. -----Sample Input----- 4 3 2 -----Sample Output----- YES 432 is a multiple of 4, and thus YES should be printed.
introductory
[{"code": "rgb = list(map(int, input().split()))\n\nl = ''.join(str(n) for n in rgb)\nif int(l)%4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.26, "memory": 14012.0, "status": "done"}, {"code": "r, g, b = list(map(int, input().split()))\nprint((\"YES\" if (r * 100 + g * 10 + b) % 4 == 0 else \"NO\"))\n", "passed": true, "time": 0.16, "memory": 14096.0, "status": "done"}, {"code": "# A - RGB Cards\n# https://atcoder.jp/contests/abc064/tasks/abc064_a\n\nr, g, b = list(map(str, input().split()))\n\ni = int(r + g + b)\nresult = 'NO'\n\nif i % 4 == 0:\n result = 'YES'\n\nprint(result)\n", "passed": true, "time": 0.19, "memory": 14200.0, "status": "done"}, {"code": "r, g, b = input().split()\nn = r + g + b\nif int(n) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "r, g, b = map(int, input().split())\n\nif (r * 100 + g * 10 + b) % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.16, "memory": 14172.0, "status": "done"}, {"code": "if int(''.join(input().split()[1:])) % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.26, "memory": 14224.0, "status": "done"}, {"code": "r, g, b = map(int, input().split())\n\nanswer = r * 100 + g * 10 + b\n\nif answer % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "r, g, b = map(str, input().split())\n\nrgb = str(r) + str(g) + str(b)\n\nif int(rgb) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "a, b, c = input().split()\nn = int(a+b+c)\n\nprint('NO') if n % 4 else print('YES')", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a = int(input().replace(\" \",\"\"))\nprint(\"YES\" if a % 4 == 0 else \"NO\")", "passed": true, "time": 0.26, "memory": 14280.0, "status": "done"}, {"code": "# 064_a\nr,g,b=map(int,input().split())\nnum=int(str(r)+str(g)+str(b))\nif (1<=r and r<=9) and (1<=g and g<=9) and(1<=b and b<=9):\n if num % 4 == 0:\n print('YES')\n else:\n print('NO')", "passed": true, "time": 0.23, "memory": 14084.0, "status": "done"}, {"code": "r, g, b = list(map(int, input().split()))\nrgb = int(r * 100 + g * 10 + b)\nif rgb % 4 == 0:\n print('YES')\nelse:\n print('NO')\n", "passed": true, "time": 0.24, "memory": 14156.0, "status": "done"}, {"code": "r,g,b = input().split()\nnum = r + g + b\nprint(\"YES\" if int(num) % 4 == 0 else \"NO\")", "passed": true, "time": 0.23, "memory": 14272.0, "status": "done"}, {"code": "# A - RGB Cards\n\n# \u6574\u6570r,g,b\u3092\u5165\u529b\u3057\u3001\u5de6\u304b\u3089\u4e26\u3079\u3066\u3067\u304d\u305f3\u6841\u306e\u6574\u6570\u304c4\u306e\u500d\u6570\u3067\u3042\u308b\u304b\u5224\u5b9a\u3059\u308b\n\n\nr,g,b = list(map(str,input().split()))\n\nanswer = int(r + g + b)\n\nif answer % 4 == 0:\n print('YES')\nelse:\n print('NO')\n", "passed": true, "time": 0.17, "memory": 14284.0, "status": "done"}, {"code": "r, g, b = input().split()\nif int(r+g+b)%4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.15, "memory": 14076.0, "status": "done"}, {"code": "# AtCoDeer\u541b\u306f\u3001\u8d64\u3001\u7dd1\u3001\u9752\u8272\u306e\u30ab\u30fc\u30c9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\n# \u305d\u308c\u305e\u308c\u306e\u30ab\u30fc\u30c9\u306b\u306f1\u4ee5\u4e0a9\u4ee5\u4e0b\u306e\u6574\u6570\u304c\u66f8\u304b\u308c\u3066\u304a\u308a\u3001\u8d64\u8272\u306e\u30ab\u30fc\u30c9\u306b\u306fr\u3001\u7dd1\u8272\u306e\u30ab\u30fc\u30c9\u306b\u306fg\u3001\u9752\u8272\u306e\u30ab\u30fc\u30c9\u306b\u306fb\u304c\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002\n# 3\u3064\u306e\u30ab\u30fc\u30c9\u3092\u5de6\u304b\u3089\u9806\u306b\u8d64\u3001\u7dd1\u3001\u9752\u8272\u306e\u9806\u306b\u4e26\u3079\u3001\u5de6\u304b\u3089\u6574\u6570\u3092\u8aad\u3093\u3060\u3068\u304d\u306b\u3053\u308c\u304c4\u306e\u500d\u6570\u3067\u3042\u308b\u304b\u5224\u5b9a\u3057\u306a\u3055\u3044\u3002\n\nr,g,b = map(int,input().split())\n\nif 1 <= r <=9 and 1 <= g <=9 and 1 <= b <=9 and (100 * r + 10 * g + b) % 4 == 0: # r\u3092100\u500d\u3001g\u309210\u500d\u306b\u3057\u3066\u3001\u305d\u308c\u305e\u308c100\u306e\u4f4d\u300110\u306e\u4f4d\u3068\u3059\u308b\u3002\n print('YES')\n\nelse:\n print('NO')", "passed": true, "time": 0.16, "memory": 14336.0, "status": "done"}, {"code": "if int(input().replace(\" \", \"\"))%4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.26, "memory": 14172.0, "status": "done"}, {"code": "r, g, b = map(int, input().split())\njudged = int(str(g) + str(b))\nif judged % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "r,g,b = list(map(int,input().split()))\nprint((\"YES\" if (r*100+g*10+b)%4 == 0 else \"NO\"))\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "r, g, b = map(str, input().split())\n\nsumstr = r + g + b\nsumint = int(sumstr)\n\nif sumint % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "r,g,b=list(map(int,input().split()))\nprint(('YES' if int(r*100+10*g+b)%4==0 else 'NO'))\n", "passed": true, "time": 0.2, "memory": 14072.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nif (a*100+b*10+c)%4==0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "a,b,c = input().split()\nn = int(a+b+c)\nif n % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "# \u6587\u5b57\u5217\u3068\u3057\u3066\u5165\u529b\nr, g, b = map(str, input().split())\n\n# \u9023\u7d50\nRGB = r + g + b\n\n# \u6574\u6570\u306b\u623b\u3057\u30664\u3067\u5272\u308b\nif int(RGB) % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "r,g,b=map(int, input().split())\nprint(\"YES\" if (10*g+b)%4==0 else \"NO\")", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "N = int(\"\".join(map(str,input().split())))\nprint((\"NO\",\"YES\")[N % 4 == 0])", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "r, g, b = map(int, input().split())\nif (r*100+g*10+b)%4==0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "a,b,c=[int(s) for s in input().split()]\nif (10*b+c)%4==0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "r,g,b = map(int,input().split())\na = r*100+g*10+b\nprint(\"YES\" if a % 4 == 0 else \"NO\")", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "if int(''.join(input().split())) % 4==0:\n print(\"YES\")\nelse:\n print(\"NO\")\n \n", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "r, g, b=input().split()\nif int(g+b)%4==0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "a = list(map(int,input().split()))\nif((a[0]*100+a[1]*10+a[2])%4 == 0 ): print(\"YES\")\nelse: print(\"NO\")", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "# \u5165\u529b\nr, g, b = list(map(int, input().split()))\n\n# \u51fa\u529b\nif 1 <= r and g and b <= 9:\n if ((r * 100) + (g * 10) + b) % 4 == 0:\n print('YES')\n else:\n print('NO')\n", "passed": true, "time": 0.21, "memory": 14056.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nx = str(a) + str(b) + str(c)\nif int(x) % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "print(\"YES\" if int(input().replace(\" \",\"\"))%4==0 else \"NO\")", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "r,g,b = map(int,input().split())\nprint(\"YES\" if (g*10+b) % 4 == 0 else \"NO\")", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "r, g, b = map(str, input().split())\n\nnumber = r + g + b\nprint(\"YES\" if int(number) % 4 == 0 else \"NO\")", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "# 3\u679a\u306e\u30ab\u30fc\u30c9\u3092\u4e26\u3079\u305f3\u6841\u306e\u6574\u6570\u304c4\u306e\u500d\u6570\u304b\n\nr, g, b = map(int, input().split())\nanswer = 100 * r + 10 * g + b\n\nif answer % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "num = input().replace(' ', '')\n\nif int(num) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\nINF = float('inf')\nMOD = 10**9 + 7\n#MOD = 998244353\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lintdec(): return list([int(x) - 1 for x in input().split()])\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nprint(('NO' if int(''.join(lstr())) % 4 else 'YES'))\n", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "r, g, b = input().split()\n\nprint(\"YES\" if int(r + g + b) % 4 == 0 else \"NO\")", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "r, g, b = list(map(int, input().split()))\na = 100 * r + 10 * g + b\nif a % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "passed": true, "time": 0.28, "memory": 14080.0, "status": "done"}, {"code": "a,b,c = input().split()\nif int(b+c)%4==0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "passed": true, "time": 0.21, "memory": 14284.0, "status": "done"}, {"code": "r, g, b = map(int,input().split())\n\nif (r * 100 + g * 10 + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.17, "memory": 14064.0, "status": "done"}, {"code": "r, g, b = map(int, input().split())\nx = 2 * g + b\nprint(\"YES\" if x % 4 == 0 else \"NO\")", "passed": true, "time": 0.15, "memory": 14200.0, "status": "done"}, {"code": "r, g, b = map(int, input().split())\nif (g*10+b)%4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.21, "memory": 14108.0, "status": "done"}, {"code": "r, g, b = list(map(int, input().split()))\nif (10 * g + b ) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "passed": true, "time": 0.15, "memory": 14268.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nif (10*b+c)%4==0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "r, g, b = map(str, input().split())\n\nnumber = int(r + g + b)\n\nif number % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "r, g, b = map(int, input().split())\n\nresult = int(\"{}{}{}\".format(r,g,b))\nif result % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "n = list(input().split())\nn = int(\"\".join(n))\nif n % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "r, g, b = map(int, input().split())\nN = 10*g + b\n\nif N % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "r, g, b = map(str, input().split())\n\nans = int(r+g+b)\n\nif ans %4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nif (10*b+c)%4==0:print('YES')\nelse:print('NO')", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "r,g,b = map(int,input().split())\n\nif (g*10+b) % 4 == 0:\n print('YES')\n \nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "number=int(\"\".join(input().split()))\nif number % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "r, g, b = (int(x) for x in input().split())\n\n\ns = 100*r+10*g+b\n\nif s%4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "rgb=list(input().split())\nl=int(''.join(rgb))\nprint(\"NO\" if l%4 else \"YES\")", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nif (10*b+c)%4==0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nif (a*100+b*10+c)%4==0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14004.0, "status": "done"}, {"code": "r, g, b = input().split()\n\nans = int(r) * 100 + int(g) *10 + int(b)\n\nif ans % 4 == 0:\n print(\"YES\")\nelif ans % 4 != 0:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "r,g,b = map(int,input().split())\nif((10*g + b) % 4 == 0):\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.28, "memory": 14028.0, "status": "done"}, {"code": "def iroha():\n a, b, c = input().split()\n num = int(a+b+c)\n print((\"YES\" if num % 4 == 0 else \"NO\"))\n\ndef __starting_point():\n iroha()\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "r,g,b=input().split()\na=int(r+g+b)\nif a%4==0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.22, "memory": 14164.0, "status": "done"}, {"code": "r, g, b = map(int,input().split())\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.53, "memory": 14200.0, "status": "done"}, {"code": "r, g, b = map(int, input().split())\nx = 10 * g + b\nif x % 4 == 0: print('YES')\nelse: print('NO')", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "r,g,b=input().split()\nif int(r+g+b)%4==0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.95, "memory": 14172.0, "status": "done"}, {"code": "n = ''\n\nfor s in input().split():\n n += s\n\nif int(n) % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.2, "memory": 14152.0, "status": "done"}, {"code": "r, g, b = list(map(int, input().split()))\nnum = r * 100 + g * 10 + b * 1\nif num%4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "passed": true, "time": 0.16, "memory": 14100.0, "status": "done"}, {"code": "if int(\"\".join(input().split())) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "passed": true, "time": 0.17, "memory": 14340.0, "status": "done"}, {"code": "print('YES' if int(''.join(input().split()))%4 == 0 else 'NO')", "passed": true, "time": 0.22, "memory": 14088.0, "status": "done"}, {"code": "l=input().split()\ns=''.join(l)\ns=int(s)\nprint('YES' if s%4==0 else 'NO')", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "# \u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u306e\u6574\u6570\u306e\u5165\u529b\na, b, c = input().split()\nnumber = int(a + b + c)\nif number % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "r, g, b = list(map(str, input().split()))\nli = r + g + b\n\nif int(li)%4==0:\n\tprint(\"YES\")\nelse:\n\tprint(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "r, g, b = list(map(str, input().split()))\nif int(r + g + b) % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "a=input().split()\nb=''.join(a)\n\nif int(b)%4==0:\n print('YES')\n \nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "r, g, b = input().split()\n\nif int(g + b) % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\n\nif (a*100 + b*10 + c) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "# \u5165\u529b\nr, g, b = map(int,input().split())\n\n# \u51e6\u7406\nanswer = (r * 100 + g * 10 + b) % 4\nif answer == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a,b,c=input().split()\nif int(b+c)%4==0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "r,g,b = input().split()\n\nans = int(r+g+b)\n\nif ans % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "r,g,b = list(map(int,input().split()))\n\nN = (r * 100) + (g * 10) + b\nif N % 4 == 0:\n print('YES')\nelse:\n print('NO')\n", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "#n = int(input())\nr, g, b = list(map(str, input().split()))\n#al = list(map(int, input().split()))\n#al=[list(input()) for i in range(n)]\n\nv = int(r+g+b)\nif v % 4 == 0:\n print('YES')\nelse:\n print('NO')\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "if int(input().replace(' ',''))%4==0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "print(\"NO\") if int(input().replace(\" \",\"\"))%4 else print(\"YES\")", "passed": true, "time": 0.13, "memory": 14180.0, "status": "done"}, {"code": "if int(input().replace(\" \",\"\"))%4==0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "\nr,g,b = map(int,input().split())\na = r *100+g*10+b\nif a % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "r, g, b = list(map(int, input().split()))\nnum = 10*g + b\nif num % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "# AtCoDeer\u541b\u306f\u3001\u8d64\u3001\u7dd1\u3001\u9752\u8272\u306e\u30ab\u30fc\u30c9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\n# \u305d\u308c\u305e\u308c\u306e\u30ab\u30fc\u30c9\u306b\u306f 1 \u4ee5\u4e0a 9 \u4ee5\u4e0b\u306e\u6574\u6570\u304c\u66f8\u304b\u308c\u3066\u304a\u308a\u3001\n# \u8d64\u8272\u306e\u30ab\u30fc\u30c9\u306b\u306f r\u3001\u7dd1\u8272\u306e\u30ab\u30fc\u30c9\u306b\u306f g\u3001\n# \u9752\u8272\u306e\u30ab\u30fc\u30c9\u306b\u306f b \u304c\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002\n# 3\u3064\u306e\u30ab\u30fc\u30c9\u3092\u5de6\u304b\u3089\u9806\u306b\u8d64\u3001\u7dd1\u3001\u9752\u8272\u306e\u9806\u306b\u4e26\u3079\u3001\n# \u5de6\u304b\u3089\u6574\u6570\u3092\u8aad\u3093\u3060\u3068\u304d\u306b\u3053\u308c\u304c 4\u306e\u500d\u6570\u3067\u3042\u308b\u304b\u5224\u5b9a\u3057\u306a\u3055\u3044\u3002\n\n# \u5236\u7d04\n# 1 \u2266 r, g, b \u2266 9\n\n# \u6a19\u6e96\u5165\u529b\u304b\u3089 r, g , b \u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\nr, g, b = list(map(int, input().split()))\n\n# 3\u6841\u306e\u6570\u5024\uff08agb\u3068\u4e26\u3079\u305f\u6570\u5024\uff09\u304c 4\u306e\u500d\u6570\u304b\u3092\u5224\u5b9a\u3057\u3001\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\ninput_rgb = r * 100 + g * 10 + b\nresult = \"ret\"\n\nif input_rgb % 4 == 0:\n result = \"YES\"\nelse:\n result = \"NO\"\n\nprint(result)\n", "passed": true, "time": 0.4, "memory": 14248.0, "status": "done"}, {"code": "'''\nabc064 A - RGB Cards\nhttps://atcoder.jp/contests/abc064/tasks/abc064_a\n'''\n\nr, g, b = list(map(int, input().split()))\ni = r*100+g*10+b\nif i%4 == 0:\n ans = 'YES'\nelse:\n ans = 'NO'\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "r,g,b=map(int,input().split())\n\nrgb=r*100+g*10+b\nif rgb%4==0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "r,g,b=map(int,input().split())\nif (10*g+b)%4==0 :\n print(\"YES\")\nelse :\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "# AtCoder abc064 a\n# \u30b9\u30c8\u30ec\u30c3\u30c1\u8ab2\u984c\n\n# \u5165\u529b\nr, g, b = list(map(int, input().split()))\n\n# \u51e6\u7406\nanswer = r * 100 + g *10 + b\n\n# \u5224\u5b9a\nif (answer % 4) == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "a, b, c = map(str, input().split())\nnum = int(a + b + c)\n \nif num % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "r,g,b = input().split()\n\na = r + g + b\n\nif int(a) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "r,g,b = input().split()\nif int(r + g + b) % 4 == 0:\n print('YES')\nelse:\n print('NO')", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "r, g, b = map(int,input().split())\nans = 100*r + 10 *g + b\nif ans % 4 == 0:\n print('YES')\nelse :\n print('NO')", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "r,g,b = list(map(int,input().split()))\nif (g*10+b)%4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "r,g,b=input().split()\nif int(r+g+b)%4==0:\n print(\"YES\")\nelse:\n print(\"NO\")", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}]
[{"input": "4 3 2\n", "output": "YES\n"}, {"input": "2 3 4\n", "output": "NO\n"}]
4,685
There are three positive integers A, B and C written on a blackboard. E869120 performs the following operation K times: - Choose one integer written on the blackboard and let the chosen integer be n. Replace the chosen integer with 2n. What is the largest possible sum of the integers written on the blackboard after K operations? -----Constraints----- - A, B and C are integers between 1 and 50 (inclusive). - K is an integer between 1 and 10 (inclusive). -----Input----- Input is given from Standard Input in the following format: A B C K -----Output----- Print the largest possible sum of the integers written on the blackboard after K operations by E869220. -----Sample Input----- 5 3 11 1 -----Sample Output----- 30 In this sample, 5, 3, 11 are initially written on the blackboard, and E869120 can perform the operation once. There are three choices: - Double 5: The integers written on the board after the operation are 10, 3, 11. - Double 3: The integers written on the board after the operation are 5, 6, 11. - Double 11: The integers written on the board after the operation are 5, 3, 22. If he chooses 3., the sum of the integers written on the board afterwards is 5 + 3 + 22 = 30, which is the largest among 1. through 3.
introductory
[{"code": "a,b,c=list(map(int,input().split()))\nk=int(input())\n\nx=max(a,b,c)\n\nprint(((a+b+c)-x+x*(2**k)))\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nk=int(input())\nprint(a+b+c+max(a,b,c)*(2**k-1))", "passed": true, "time": 0.24, "memory": 14244.0, "status": "done"}, {"code": "A, B, C = map(int, input().split())\nK = int(input())\n\nX = sorted([A, B, C])\nfor _ in range(K):\n X[-1] *= 2\n \nprint(sum(X))", "passed": true, "time": 0.17, "memory": 14324.0, "status": "done"}, {"code": "def ans096(A: int, B: int, C: int, K: int):\n int_list = [A, B, C]\n int_list.sort()\n third=int_list[-1]\n for i in range(K):\n third*=2\n return int_list[0]+int_list[1]+third\n\nA,B,C=map(int,input().split())\nK=int(input())\nprint(ans096(A,B,C,K))", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "abc = list(map(int, input().split()))\nk = int(input())\n\nfor i in range(k):\n abc.sort()\n abc[2] *= 2\n \nprint(sum(abc))", "passed": true, "time": 0.24, "memory": 14176.0, "status": "done"}, {"code": "a = sorted(map(int, input().split()))\nk = int(input())\nprint(a[0] + a[1] + a[2] * (2**k))", "passed": true, "time": 0.23, "memory": 14268.0, "status": "done"}, {"code": "import sys\nlines = [s.rstrip(\"\\n\") for s in sys.stdin.readlines()]\nnum_list = [int(num) for num in lines.pop(0).split(\" \")]\nk, = [int(num) for num in lines.pop(0).split(\" \")]\n\nm = max(num_list)\nans = sum(num_list) - m + (m * (2 ** k))\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "import math\n# b=input()\n# c=[]\n# for i in range(b):\n# c.append(a[i])\na = list(map(int,input().split()))\n#b = list(map(int,input().split()))\ns=int(input())\n\nfor i in range(s):\n\ta[a.index(max(a))]=\ta[a.index(max(a))]*2\n\t\nprint(sum(a))", "passed": true, "time": 0.24, "memory": 14092.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nk = int(input())\nnum = max(l)\nl.remove(num)\nfor i in range(k):\n num = num * 2\nprint(sum(l) + num)", "passed": true, "time": 0.24, "memory": 14148.0, "status": "done"}, {"code": "A,B,C=map(int, input().split())\nK=int(input())\n\nM=sorted([A,B,C])\nm=M[-1]\n\nm=m*2**K\n\nprint(m+M[0]+M[1])", "passed": true, "time": 0.19, "memory": 14200.0, "status": "done"}, {"code": "L = sorted(map(int, input().split()))\nk = int(input())\nprint(L[0]+L[1]+L[2]*2**k)", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "a, b, c = list(map(int, input().split()))\nK = int(input())\nm = max(a, b, c)\nprint((a + b + c + (2**K - 1) * m))\n", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nk = int(input())\nprint(a + b + c + max(a, b, c) * (2 ** k - 1))", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\nk = int(input())\na.sort()\nprint(a[0] + a[1] + a[2] + (a[2] * (2 ** k - 1)))", "passed": true, "time": 0.23, "memory": 14096.0, "status": "done"}, {"code": "def main():\n A = list(map(int, input().split()))\n K = int(input())\n A.sort()\n A.append(A.pop()*(2**K))\n print((sum(A)))\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "A,B,C = map (int, input ().split ())\nS = int (input ())\nif A>B>C or A>C>B:\n for i in range (S):\n A = A*2\n print (A+B+C)\nelif B>A>C or B>C>A:\n for i in range (S):\n B = B*2\n print (A+B+C)\nelse:\n for i in range (S):\n C = C*2\n print (A+B+C)", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "a,b,c = map(int, input().split())\nk = int(input())\n\nans = a+b+c + (max(a,b,c))*(2**k-1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14380.0, "status": "done"}, {"code": "l=[int(x) for x in input().split()]\nk=int(input())\nm=max(l)\nl.remove(max(l))\nfor i in range(k):\n m *= 2 \nprint(sum(l)+m)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "x = list(map(int, input().split()))\nfor i in range(int(input())):\n x.sort()\n x[-1]=x[-1]*2\nprint(sum(x))", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "X=list(map(int,input().split()))\nK=int(input())\nX.sort()\nfor i in range(K):\n X[-1]=X[-1]*2\nprint(sum(X))", "passed": true, "time": 0.15, "memory": 14316.0, "status": "done"}, {"code": "a,b,c=list(map(int,input().split()))\nn=int(input())\n\na,b,c= sorted([a,b,c])\nprint((a+b+c*2**n))\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "A = list(map(int,input().split()))\nK = int(input())\n\nfor i in range(K):\n max_A = max(A)\n A.append(max_A * 2)\n A.remove(max_A)\n\nprint(sum(A))", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nk = int(input())\n\nif max([a,b,c]) == c:\n ans = c*(2**k) + b + a\nelif max([a,b,c]) == b:\n ans = b*(2**k) + a + c\nelse:\n ans = a*(2**k) + b + c\nprint(ans)", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "lis = list(map(int,input().split()))\na = int(input())\nlis.sort(reverse = True)\nfor i in range(a):\n lis[0] *= 2\nprint(sum(lis))", "passed": true, "time": 0.16, "memory": 14016.0, "status": "done"}, {"code": "n = list(map(int,input().split()))\nk = int(input())\nfor _ in range(k):\n n[n.index(max(n))] *= 2\nprint(sum(n)) ", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nk = int(input())\nl.sort()\nprint(l[2]*(2**k)+l[0]+l[1])", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "A = list(map(int,input().split()))\nK = int(input())\nfor _ in range(K):\n A[A.index(max(A))]*=2\n\nprint(sum(A))", "passed": true, "time": 0.19, "memory": 14108.0, "status": "done"}, {"code": "a=list(map(int,input().split()))\nk=int(input())\nb=max(a)\nfor i in range(k):\n b*=2\n \nprint((sum(a)-max(a)+b))\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "A, B, C = map(int,input().split())\nK = int(input())\n\nn_list = [A, B, C]\nx = max(n_list)\nn_list.append(x * 2 ** K)\nn_list.remove(x)\nprint(sum(n_list))", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "def answer(a: int, b: int, c: int, k: int) -> int:\n nums = sorted((a, b, c))\n nums[-1] = nums[-1] * 2 ** k\n\n return sum(nums)\n\n\ndef main():\n a, b, c = list(map(int, input().split()))\n k = int(input())\n print((answer(a, b, c, k)))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "display = sorted(list(map(int, input().split())))\nK = int(input())\n\nmaximum = display[-1]\nfor i in range(K):\n maximum = maximum*2\n# print(maximum)\n# print(display[:-1])\n# print(sum(display[:-1]))\nprint(sum(display[:-1])+maximum)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "A, B, C = sorted([int(i) for i in input().split()])\nK = int(input())\nprint((A + B + (C * (2**K))))\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "l=list(map(int,input().split()))\nk=int(input())\n\nd=max(l)\ne=d*(2**k)\n\nl.remove(max(l))\nl.append(e)\n\nprint((sum(l)))\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "argList = list(map(int, input().split()))\nk = int(input())\nprint((sum(argList)-max(argList)) + max(argList)*2**k)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "A,B,C = map(int,input().split())\nMax = max(A,B,C)\nK = int(input())\nMax *= 2**K\nprint(min((A+B+Max),(A+Max+C),(Max+B+C)))", "passed": true, "time": 1.59, "memory": 14108.0, "status": "done"}, {"code": "l = list(map(int,input().split()))\nn = int(input())\nls = sorted(l)\nprint(ls[0]+ls[1]+ls[2]*(2**n))", "passed": true, "time": 0.15, "memory": 14144.0, "status": "done"}, {"code": "lst = input().split()\nK = int(input())\nfor i in range(3):\n lst[i] = int(lst[i])\n\nprint(sum(lst) + (max(lst) * ((2 ** K) - 1)))", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nk = int(input())\nfor i in range(k):\n a = max(l)\n i = l.index(a)\n l[i] = l[i] * 2\n \nprint(sum(l))", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "def mapt(fn, *args):\n return tuple(map(fn, *args))\n\n\ndef Input():\n return mapt(int, input().split(\" \"))\n\n\ndef main():\n a, b, c = sorted(Input())\n k = int(input())\n\n for i in range(k):\n c *= 2\n print(a+b+c)\n\n\nmain()", "passed": true, "time": 0.28, "memory": 14304.0, "status": "done"}, {"code": "a,b,c=list(map(int,input().split()))\nk=int(input())\nprint(max([a,b,c])*2**k+sum([a,b,c])-max([a,b,c]))", "passed": true, "time": 0.28, "memory": 14108.0, "status": "done"}, {"code": "A,B,C = map(int,input().split())\nK = int(input())\n\nmax_num = max(A,B,C)\nif A == max_num:\n print(A * (2 ** K) + B + C)\nelif B == max_num:\n print(B * (2 ** K) + A + C)\nelse:\n print(C * (2 ** K) + B + A)", "passed": true, "time": 0.22, "memory": 14324.0, "status": "done"}, {"code": "abc = list(map(int, input().split()))\nk = int(input())\nabc.sort()\nprint(sum(abc[:2] ,abc[-1] * (2 ** k)))", "passed": true, "time": 0.18, "memory": 14148.0, "status": "done"}, {"code": "N_List = list(map(int,input().split()))\nN = int(input())\nmaxN = max(N_List)\nprint(sum(N_List)-maxN+maxN*(2**N))", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "s=list(map(int,input().split()))\nk=int(input())\ns.sort()\nm=1\nm *= (s[2]*(2**k))\nprint(m+s[0]+s[1])", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "a,b,c = map(int, input().split())\nk = int(input())\n\nm = max(a,b,c)\nre = sum([a,b,c]) - m\nprint(re + m*2**(k))", "passed": true, "time": 0.17, "memory": 14288.0, "status": "done"}, {"code": "ABC = [int(_) for _ in input().split()]\nK = int(input())\n\nABC = sorted(ABC)\n\nret = ABC[2]\nfor i in range(K):\n ret = ret * 2\n\nret += sum(ABC[:2])\n\nprint(ret)", "passed": true, "time": 0.17, "memory": 14072.0, "status": "done"}, {"code": "a=list(map(int,input().split()))\nk=int(input())\nc=max(a[0],a[1],a[2])\nb=a[0]+a[1]+a[2]\nb=b-c\nfor i in range(0,k):\n c=c*2\nprint(b+c) ", "passed": true, "time": 0.21, "memory": 14180.0, "status": "done"}, {"code": "A, B, C = [int(i) for i in input().split()]\nK = int(input())\n\nm = max(A, B, C)\nprint((sum([A, B, C]) - m + m * 2 ** K))\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "num1, num2, num3 = map(int, input().split())\ncount = int(input())\n\nmax_num = max(num1, max(num2, num3))\n\nsum_num = num1 + num2 + num3 - max_num\nend_num = max_num\nfor i in range(count):\n end_num *= 2\n\nprint(sum_num + end_num)", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "num_list = list(map(int, input().split()))\nk = int(input())\n\nmax = 0\nindex = -1\nfor i in num_list:\n if max < i:\n max = i\n index = num_list.index(i)\n\nchange = max*(2**k)\nnum_list[index] = change\nans = 0\nfor j in num_list:\n ans += j\n\nprint(ans)", "passed": true, "time": 0.17, "memory": 14244.0, "status": "done"}, {"code": "A, B, C = list(map(int,input().split()))\nK = int(input())\nNumbers = [A,B,C]\n\nNumbers.sort(reverse=True)\n\nfor i in range(K):\n twice = Numbers[0] * 2\n Numbers[0] = twice\n\nprint((sum(Numbers)))\n\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "mylists = list(map(int, input().split()))\nk = int(input())\n\nmylists.sort(reverse=True)\nprint((mylists[0] * 2 ** k - mylists[0] + sum(mylists)))\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nk = int(input())\nprint(max(a,b,c)*(2**k-1)+a+b+c)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "a = list(map(int,input().split()))\nk = int(input())\na.sort()\na[2] = a[2] *(2**k)\nprint(sum(a))", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nk = int(input())\ni = l.index(max(l))\nm = l[i]\ndel l[i]\nl.append(m * 2 ** k)\nprint((sum(l)))\n", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "n = [int(s) for s in input().split()]\nk = int(input())\n\nfor i in range(k):\n max_id = n.index(max(n))\n n[max_id] *= 2\nprint(sum(n)) ", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "a,b,c=list(map(int,input().split()))\nk=int(input())\nd=max(a,b,c)\nprint((a+b+c-d+d*2**k))\n", "passed": true, "time": 0.24, "memory": 14148.0, "status": "done"}, {"code": "a=[int(i) for i in input().split()]\nk=int(input())\n\nsum_a=sum(a)\n\nans=sum_a-max(a)+max(a)*2**k\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "abc = list(map(int, input().split()))\nk = int(input())\nfor i in range(k):\n abc.sort()\n abc[2] *= 2\nprint(sum(abc))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "A=list(map(int,input().split()))\nK=int(input())\nA.sort()\nA[2]=A[2]*2**K\nprint((sum(A)))\n", "passed": true, "time": 0.24, "memory": 14124.0, "status": "done"}, {"code": "ABC = sorted(map(int, input().split()))\nK = int(input())\n\nprint((ABC[0] + ABC[1] + ABC[2] * 2**K))\n", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "a = [int(x) for x in input().split()]\nk = int(input())\nprint(sum(a) - max(a) + max(a) * (2 ** k))", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "abc = list(map(int, input().split()))\nk = int(input())\nmx = abc.pop(abc.index(max(abc)))\nprint((mx * pow(2, k) + sum(abc)))\n", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "l = list(map(int,input().split()))\nk = int(input())\nl.sort(reverse=True)\nfor i in range(k):\n l[0] *= 2\nprint(sum(l))", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\n\nabc = list(map(int, input().split()))\nk = int(input())\n\n\nabc.sort()\n\nprint((abc[0]+abc[1]+abc[2]*2**(k)))\n", "passed": true, "time": 0.23, "memory": 14376.0, "status": "done"}, {"code": "#\n# abc096 b\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"5 3 11\n1\"\"\"\n output = \"\"\"30\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"3 3 4\n2\"\"\"\n output = \"\"\"22\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n I = list(map(int, input().split()))\n K = int(input())\n\n for i in range(K):\n t = max(I)\n I.remove(t)\n I.append(t*2)\n\n print((sum(I)))\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14636.0, "status": "done"}, {"code": "A,B,C = sorted(map(int,input().split()))\nK=int(input())\n\nfor i in range(K):\n\tC*=2\n\nprint((A+B+C))\n", "passed": true, "time": 0.22, "memory": 14220.0, "status": "done"}, {"code": "nums = list(map(int, input().split()))\nk = int(input())\nx = max(nums)\nmulx = x*(2**k)\nprint((mulx + sum(nums)-x))\n", "passed": true, "time": 0.22, "memory": 14340.0, "status": "done"}, {"code": "a,b,c = map(int, input().split())\nk = int(input())\nans = a+b+c+max(a,b,c)*(2**k-1)\nprint(ans)", "passed": true, "time": 0.22, "memory": 14360.0, "status": "done"}, {"code": "def resolve():\n a = list(map(int, input().split()))\n k = int(input())\n a.sort()\n for i in range(k):\n a[2] = a[2] * 2\n print(sum(a))\nresolve()", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "ABC = list(map(int, input().split()))\nK = int(input())\n\nprint(max(ABC)*(2**K - 1) + sum(ABC))", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "A, B, C = map(int, input().split())\nK = int(input())\nif max(A, B, C) == A:\n A *= 2**K\nelif max(A, B, C) == B:\n B *= 2**K\nelse:\n C *= 2**K\nprint(A+B+C)", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "List = list(map(int, input().split()))\nK = int(input())\nsort = sorted(List)\nfor i in range(K):\n sort[-1] = sort[-1]*2\nprint((sum(sort))) \n", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\nk = int(input())\na.sort(reverse=True)\na[0] *= 2**k\nprint(sum(a))", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nk = int(input())\nprint(max(a,b,c)*(2**k-1)+a+b+c)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "a,b,c=sorted(map(int,input().split()))\nprint(a+b+pow(2,int(input()) )*c )", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "A=list(map(int,input().split()))\nK=int(input())\n\nans=sum(A)\nans+=max(A)*(2**K-1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nk = int(input())\nprint(max(a,b,c)*(2**k-1)+a+b+c)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "import heapq\n\nval = list(map(lambda x: -int(x), input().split()))\nK = int(input())\n\nheapq.heapify(val)\n\nfor i in range(K):\n v = heapq.heappop(val)\n heapq.heappush(val, v * 2)\n\nprint(-sum(val))", "passed": true, "time": 0.16, "memory": 14308.0, "status": "done"}, {"code": "A=list(map(int,input().split()))\n\nK=int(input())\n\nA.sort(reverse=True)\n\nprint((A[0]*2**K+A[1]+A[2]))\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "l = list(map(int,input().split()))\nn = int(input())\nls = sorted(l)\nprint(ls[0]+ls[1]+ls[2]*(2**n))", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "A = list(map(int,input().split()))\nK = int(input())\n\nfor i in range(K):\n max_A = max(A)\n A.append(max_A * 2)\n A.remove(max_A)\n\nprint(sum(A))", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "nums = sorted(list(map(int, input().split())), reverse=True)\nK = int(input())\n\nprint(nums[0]*(2**K) + nums[1] + nums[2])", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "a,b,c=list(map(int,input().split()))\nk=int(input())\nprint((a+b+c-max(a,b,c)+max(a,b,c)*pow(2,k)))\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "import bisect, collections, copy, heapq, itertools, math, string, sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = float('inf')\ndef I(): return int(input())\ndef F(): return float(input())\ndef SS(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LSS(): return input().split()\n\ndef resolve():\n ABC = LI()\n K = I()\n ABC.sort()\n\n ans = sum(ABC[:2]) + ABC[2] * 2 ** K\n print(ans)\n\ndef __starting_point():\n resolve()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14124.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\nk = int(input())\n\na.sort()\n\nprint(sum(a[:-1]) + a[-1] * 2 ** k)", "passed": true, "time": 0.22, "memory": 14056.0, "status": "done"}, {"code": "m, *A = sorted([int(x) for x in input().split()], reverse=True)\nK = int(input())\n \nprint((m * 2**K) + sum(A))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a,b,c = map(int, input().split())\nk = int(input())\nl = [a,b,c]\nl.sort()\nprint(l[-1]*2**k + sum(l[:-1]))", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nk = int(input())\nx = max(a, b, c)\nif x == a:\n print(a*2**k + b + c)\nelif x == b:\n print(a + b*2**k + c)\nelse:\n print(a + b + c*2**k)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nk = int(input())\nm = max(a, b, c)\n\nfor i in range(k):\n m *= 2\n \nprint(sum([a, b, c]) - max(a, b, c) + m)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "A, B, C = map(int, input().split())\nK = int(input())\nprint(sum([A, B, C])+max(A, B, C)*2**K-max(A, B, C))", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "a=list(map(int,input().split()))\nb=int(input())\na.sort()\nprint(a[0]+a[1]+(a[2]*(2**b)))", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nk = int(input())\nl.sort()\nprint(l[0] + l[1] + l[2] * (2 ** k))", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "a = sorted(list(map(int, input().split())))\nm = a.pop()\nfor i in range(int(input())):\n m *= 2\nprint(sum(a) + m)", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "list_abc = sorted([int(i) for i in input().split()])\nk = int(input())\nprint(list_abc[2] * 2 ** k + sum(list_abc[:2]))", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nk=int(input())\nprint((2**k-1)*max([a,b,c])+sum([a,b,c]))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\na.sort()\nk = int(input())\nres = a[0] + a[1] + a[2] * (2 ** k)\nprint(res)\n", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "a,b,c = map(int, input().split())\nk = int(input())\nprint(a+b+c+max(a,b,c)*((2**k)-1))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\nk = int(input())\n\na.sort()\na[-1] *= 2 ** k\n\nprint((sum(a)))\n", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}]
[{"input": "5 3 11\n1\n", "output": "30\n"}, {"input": "3 3 4\n2\n", "output": "22\n"}]
4,686
Let w be a string consisting of lowercase letters. We will call w beautiful if the following condition is satisfied: - Each lowercase letter of the English alphabet occurs even number of times in w. You are given the string w. Determine if w is beautiful. -----Constraints----- - 1 \leq |w| \leq 100 - w consists of lowercase letters (a-z). -----Input----- The input is given from Standard Input in the following format: w -----Output----- Print Yes if w is beautiful. Print No otherwise. -----Sample Input----- abaccaba -----Sample Output----- Yes a occurs four times, b occurs twice, c occurs twice and the other letters occur zero times.
introductory
[{"code": "import sys\nimport string\nw = input()\na_z = string.ascii_letters\nfor i in a_z:\n if w.count(i) & 1:\n print('No')\n return\nprint('Yes')", "passed": true, "time": 0.16, "memory": 14352.0, "status": "done"}, {"code": "# import math\n# import statistics\na=input()\n#b,c=int(input()),int(input())\nc=[]\nfor i in a:\n c.append(i)\n#e1,e2 = map(int,input().split())\n# f = list(map(int,input().split()))\n#g = [input() for _ in range(a)]\n# h = []\n# for i in range(e1):\n# h.append(list(map(int,input().split())))\nse=set(c)\nc.sort()\ncount=1\nres=[]\nfor i in range(len(c)-1):\n if c[i]==c[i+1]:\n count+=1\n else:\n if count%2==0:\n res.append(c[i])\n count=1\nif count%2==0:\n res.append(c[-1])\nif len(res)==len(se):\n print(\"Yes\")\nelse:\n print(\"No\")\n", "passed": true, "time": 0.16, "memory": 14216.0, "status": "done"}, {"code": "w=input()\nS=\"abcdefghijklmnopqrstuvwxyz\"\n\nflag=True\nfor c in S:\n if w.count(c)%2==1:\n flag=False\nif flag:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "import collections\nw = input()\nc = collections.Counter(w)\nfor i in c.values():\n if i%2==1:\n print('No')\n break\nelse:\n print('Yes')", "passed": true, "time": 0.18, "memory": 14160.0, "status": "done"}, {"code": "a = input()\ndic = {}\nfor i in a:\n if i in dic:\n dic[i] += 1\n else:\n dic[i] = 1\nfor i in dic:\n if dic[i] % 2 != 0:\n print(\"No\")\n return\nprint(\"Yes\")", "passed": true, "time": 0.16, "memory": 14232.0, "status": "done"}, {"code": "w = input()\nd = {}\nfor i in range(len(w)):\n if w[i] not in list(d.keys()):\n d[w[i]] = 1\n else:\n d[w[i]] += 1\n\nfor v in list(d.values()):\n if v%2 != 0:\n print(\"No\")\n return\nprint(\"Yes\")\n", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "w = input()\n\na = ord('a')\nz = ord('z')\n\nfor i in range(a,z+1):\n x = w.count(chr(i))\n if x%2 == 1:\n print('No')\n return\n \nprint('Yes')\n", "passed": true, "time": 0.24, "memory": 14224.0, "status": "done"}, {"code": "S = input()\n\nP = set()\nfor s in S:\n if s not in P and S.count(s)%2 != 0:\n print(\"No\")\n return\n P.add(s)\nprint(\"Yes\")", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "from sys import stdin\ninput = stdin.readline\n\nD = {'a':0, 'b':1, 'c':2, 'd':3, 'e':4,\n 'f':5, 'g':6, 'h':7, 'i':8, 'j':9,\n 'k':10,'l':11,'m':12,'n':13,'o':14,\n 'p':15,'q':16,'r':17,'s':18,'t':19,\n 'u':20,'v':21,'w':22,'x':23,'y':24,'z':25}\n\nW = list(input().strip())\n\nT = [0] * 26\n\nfor w in W:\n T[D[w]] += 1\n\nb = True\nfor i in range(26):\n if T[i]%2 == 1:\n b = False\n break\nif b == True:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "w = list(input())\nx = list(set(w))\nfor i in x:\n y = w.count(i)\n if y % 2 != 0:\n print('No')\n return\nprint('Yes')", "passed": true, "time": 0.14, "memory": 14012.0, "status": "done"}, {"code": "s = str(input())\ntemp = 'a'\nflag = 0\nfor i in range(1,27):\n if s.count(temp)%2==1:\n flag=1\n break\n temp = chr(ord(temp) + 1)\nif flag==0:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.19, "memory": 14320.0, "status": "done"}, {"code": "n = input()\ndic = 'abcdefghijklmnopqrstuvwxyz'\nfor i in range(26):\n if n.count(str(dic[i]))%2!=0:\n print(\"No\")\n return\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "w=input()\na=\"abcdefghijklmnopqrstuvwxyz\"\nb=0\nfor i in range(26):\n if w.count(a[i])%2==0:\n b+=0\n else:\n b+=1\nprint(\"Yes\" if b==0 else \"No\")", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "import collections \n\nw = str(input())\nx = collections.Counter(w)\nn = 0\n\n \nfor i in list(x.values()):\n if i % 2 ==0:\n n += 1\n continue\n \n\nif n == len(list(x.values())):\n print('Yes')\n\nelse:\n print('No')\n\n \n", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "w = input()\nalpha = \"abcdefghijklmnopqrstuvwxyz\"\n\ncheck = True\nfor a in alpha:\n if w.count(a) % 2 == 1:\n check = False\n \nprint(\"Yes\" if check else \"No\")", "passed": true, "time": 0.17, "memory": 14240.0, "status": "done"}, {"code": "w = input()\nwhile len(w) > 0:\n a = w[0]\n if w.count(a)%2 != 0:\n print(\"No\")\n return\n w = w.replace(a,\"\")\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "w = list(input())\ns = set(w)\nfor i in s:\n if w.count(i)%2 != 0:\n print(\"No\")\n break\nelse:\n print(\"Yes\")\n", "passed": true, "time": 0.15, "memory": 14212.0, "status": "done"}, {"code": "w = list(input())\n\nw.sort()\n\ncnt = 1\n\nfor i in range(len(w)-1):\n if w[i] != w[i+1]:\n if cnt % 2 == 1:\n print('No')\n return\n else:\n cnt = 1\n else:\n cnt += 1\n\nif cnt % 2 == 1:\n print('No')\nelse:\n print('Yes')", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "w=input()\nre=[w.count(i) for i in w]\nprint(\"Yes\" if all(i%2==0 for i in re) else \"No\")", "passed": true, "time": 0.18, "memory": 14192.0, "status": "done"}, {"code": "import collections\nw = list(input())\nwc = collections.Counter(w)\nnum = 0\nfor i, x in enumerate(wc):\n if(wc[x]%2==0):\n num += 1\nif(num==len(wc)):\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "w = input()\nfor i in range(len(w)):\n if w.count(w[i]) % 2 == 1:\n print('No')\n return\nprint('Yes')", "passed": true, "time": 0.19, "memory": 14264.0, "status": "done"}, {"code": "s = input()\nd = {}\nfor i in range(len(s)):\n if s[i] in d:\n d[s[i]] += 1\n else:\n d[s[i]] = 1\nfor v in d.values():\n if v % 2:\n print('No')\n return\nprint('Yes')", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "w = input()\nchar_map = { c: 0 for c in w }\nfor c in w:\n char_map[c] += 1\n\nflag = True\nfor val in list(char_map.values()):\n if val % 2 != 0:\n flag = False\n break\n\nprint(('Yes' if flag else 'No'))\n", "passed": true, "time": 0.19, "memory": 14200.0, "status": "done"}, {"code": "import collections\nimport sys\na=input()\nb=[]\n\nfor i in a:\n b.append(i)\n \nb.sort()\nc=collections.Counter(b)\nc=list(c.values())\n\nfor i in range(len(c)):\n if int(c[i])%2==0:\n q=0\n else:\n q=1\n print('No')\n return\n \nprint('Yes')\n", "passed": true, "time": 0.25, "memory": 14116.0, "status": "done"}, {"code": "import string\n\nw = list(map(str, input()))\nans = \"\"\n\nalp = list(map(str, string.ascii_lowercase))\nfor char in alp:\n if w.count(char) % 2 == 0:\n ans = \"Yes\"\n else:\n ans = \"No\"\n break\nprint(ans)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "a = input()\n\nfor i in a:\n\tif a.count(i)%2==1:\n\t\tprint(\"No\")\n\t\t\n\t\treturn\n\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "import collections\nw = list(input())\nc = collections.Counter(w)\ntmp = list(c.values())\nfor i in tmp:\n if i % 2 == 1:\n print(\"No\")\n return\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "from collections import Counter\nw = input()\nc = Counter(w)\nans = True\nfor v in c.values():\n if v%2==1:\n ans = False\nprint(\"Yes\" if ans == True else \"No\")", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "from collections import Counter\n\n\ndef answer(w: str) -> str:\n counts = list(Counter(w).values())\n for count in counts:\n if count % 2 == 1:\n return 'No'\n\n return 'Yes'\n\ndef main():\n w = input()\n print((answer(w)))\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "import collections\nw = list(input())\n\ncnt = collections.Counter(w)\nans = \"Yes\"\nfor v in list(cnt.values()):\n if v%2!=0:\n ans = \"No\"\n break\n \nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "s = list(input())\nif all(s.count(x) % 2 == 0 for x in set(s)):\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.31, "memory": 13988.0, "status": "done"}, {"code": "w=sorted(input())\ntotal=False\nif len(w)==1:\n total=True\n print(\"No\")\nelse:\n for i in range(0,len(w),2):\n if w[i]!=w[i+1]:\n print(\"No\")\n total=True\n break\nif total==False:\n print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "w = input()\nfrom collections import Counter\nwc = Counter(w)\n\nfor c in wc.values():\n if c%2 == 1:\n print('No')\n break\nelse:\n print('Yes')", "passed": true, "time": 1.08, "memory": 14144.0, "status": "done"}, {"code": "w = str(input())\nL = []\nfor i in w:\n L.append(i)\nif len(L) % 2 == 1:\n print('No')\n return\nL.sort()\nfor j in range(0,len(L),2):\n if L[j] != L[j + 1]:\n print('No')\n return\nprint('Yes')\n \n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "from collections import Counter\n\nw = input()\nc = Counter(w)\nfor i in c.values():\n if i % 2 != 0:\n print('No')\n return\nprint('Yes')", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "w=input()\na=list('abcdefghijklmnopqrstuvwxyz')\nfor A in a:\n if w.count(A) % 2 == 1:\n print('No')\n return\nprint('Yes')", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "li = [0]*26\nw = input()\nfor i in range(len(w)):\n li[ord(w[i])-97] += 1\nfor i in range(26):\n if li[i] % 2 == 1:\n print(\"No\")\n return\nprint(\"Yes\")", "passed": true, "time": 0.17, "memory": 14228.0, "status": "done"}, {"code": "W = input()\nexist_list = []\nans = \"No\"\nfor w in W:\n if w in exist_list:\n continue\n\n if W.count(w) % 2 != 0:\n break\n\n exist_list.append(w)\nelse:\n ans = \"Yes\"\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "w = input()\n\nw_list = [a for a in w]\nw_set = set(w_list)\n\nans = 'Yes'\nfor i in w_set:\n if w_list.count(i)%2 != 0:\n ans = 'No'\n break\n\nprint(ans)", "passed": true, "time": 0.17, "memory": 14040.0, "status": "done"}, {"code": "a=input();b=set(a)\n\nfor i in b:\n if a.count(i) % 2 != 0:\n print('No')\n return\n \nprint('Yes')\n", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "from collections import Counter\n\nW = input()\nC = Counter(W)\n\nfor v in list(C.values()):\n if v % 2:\n print(\"No\")\n return\nprint(\"Yes\")\n", "passed": true, "time": 0.26, "memory": 14088.0, "status": "done"}, {"code": "w = str(input())\ndata1 = []\nfor i in range(len(w)):\n data1.append(w[i])\n \ndata2 = []\nfor i in range(len(w)):\n if not w[i] in data2:\n data2.append(w[i])\n\nerror = 0\nfor x in data2:\n if data1.count(x) % 2 != 0:\n error += 1\n break\n\nif error == 0:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.16, "memory": 14320.0, "status": "done"}, {"code": "w = list(input())\ns = set(w)\nfor i in s:\n if w.count(i)%2 != 0:\n print(\"No\")\n break\nelse:\n print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "W = input()\ns = list(set(W))\nl = len(s)\n\n\nfor i in range(l):\n for a in s[i]:\n if W.count(a)%2 == 1:\n print(\"No\")\n return\n else:\n break\nprint(\"Yes\")\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "l = input()\n\nfor i in l:\n if l.count(i) % 2 == 1:\n print(\"No\")\n return\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "w = input()\nans = 'Yes'\nif len(w) % 2 == 1:\n ans = 'No'\nelse:\n s = sorted(w)\n count = 1\n for i in range(1, len(s)):\n if s[i] == s[i - 1]:\n count += 1\n else:\n if count % 2 == 1:\n ans = 'No'\n break\n count = 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "from collections import Counter as CC\nw = list(input())\nD = CC(w)\nfor i in D:\n if D[i] % 2 != 0:\n print('No')\n break\nelse:\n print('Yes')", "passed": true, "time": 0.23, "memory": 14332.0, "status": "done"}, {"code": "w = input()\nD = {}\nfor i in w:\n if i not in D:\n D[i] = 0\n D[i] += 1\nfor i in D:\n if D[i] % 2 == 1:\n print('No')\n break\nelse:\n print('Yes')", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "w = input()\nl = [chr(ord(\"a\")+i) for i in range(26)]\nfor i in l:\n if w.count(i) % 2 != 0:\n print('No')\n return\nprint('Yes')", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "w = input()\nans = True\n\nfor i in w:\n cnt = 0\n for j in w:\n if i == j:\n cnt += 1\n if cnt%2 != 0:\n ans = False\n break\n \nif ans:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.15, "memory": 14168.0, "status": "done"}, {"code": "#-*-coding:utf-8-*-\nimport sys\ninput=sys.stdin.readline\n\ndef main():\n S = input().rstrip()\n s_dict={}\n\n for s in S:\n if s not in s_dict:\n tmp={s:1}\n s_dict.update(tmp)\n else:\n count=s_dict[s]\n count+=1\n s_dict[s]=count\n \n for i,v in s_dict.items():\n if v % 2 !=0:\n print(\"No\")\n return\n else:\n continue \n print(\"Yes\")\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "w = input()\nx = set(w)\ny = []\nfor i in x:\n y.append(w.count(i))\nfor j in y:\n if j%2 == 0:\n continue\n else:\n print(\"No\")\n return\nprint(\"Yes\")\n", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "s = input()\nal = \"abcdefghijklmnopqrstuvwxyz\"\nf = True\nfor e in al:\n if s.count(e)%2 != 0:\n f = False\n break\nprint(\"Yes\" if f else \"No\")", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "w = input()\n\nimport collections as c\n\ncounts = c.Counter(w)\nif all(elem % 2 == 0 for elem in counts.values()):\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "data = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\nw = input()\n\n\nfor i in range(26):\n if w.count(data[i]) % 2 != 0:\n print('No')\n return\nprint('Yes')", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "a = list(input())\na.sort()\nb = list(set(a))\nfor i in range(len(b)):\n if a.count(b[i]) % 2 == 0:\n continue\n else:\n print(\"No\")\n return\nprint(\"Yes\")", "passed": true, "time": 0.15, "memory": 14040.0, "status": "done"}, {"code": "from collections import deque\nd = deque()\nfor w in input():\n d.remove(w) if w in d else d.append(w) \nprint(['Yes','No'][len(d)!=0])", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "s = input()\ndi = {}\nfor c in s:\n di[c] = 0\nfor c in s:\n di[c] +=1\n \nis_beautiful = True\nfor c in s:\n if di[c] %2 ==1:\n is_beautiful = False\n\nprint(('Yes' if is_beautiful else 'No'))\n", "passed": true, "time": 0.31, "memory": 14072.0, "status": "done"}, {"code": "import sys\nw=input()\ncount={}\nfor i in w:\n count.setdefault(i,0)\n count[i]+=1\nfor j in list(count.values()):\n if j%2!=0:\n print('No')\n return\nprint('Yes')\n", "passed": true, "time": 0.21, "memory": 14308.0, "status": "done"}, {"code": "a = input()\n \nfor i in a:\n\tif a.count(i)%2==1:\n\t\tprint(\"No\")\n\t\t\n\t\treturn\n \nprint(\"Yes\")", "passed": true, "time": 1.57, "memory": 14060.0, "status": "done"}, {"code": "import collections\nw = list(input())\n\ncnt = collections.Counter(w)\nans = \"Yes\"\nfor v in cnt.values():\n if v%2!=0:\n ans = \"No\"\n break\n \nprint(ans)", "passed": true, "time": 0.22, "memory": 14108.0, "status": "done"}, {"code": "w = input()\nw_set = set(w)\nd = {}\nfor i in w_set:\n d[i] = 0\nfor i in w:\n d[i] += 1\n\nfor i in d.values():\n if i % 2 != 0:\n print(\"No\")\n break\nelse:\n print(\"Yes\")", "passed": true, "time": 0.21, "memory": 14192.0, "status": "done"}, {"code": "w = input()\n\ndic = {}\nfor c in w:\n if c not in dic:\n dic[c] = 1\n else:\n dic[c] += 1\n \nfor key in dic:\n if dic[key] % 2 != 0:\n print(\"No\")\n return\nprint(\"Yes\")\n", "passed": true, "time": 0.2, "memory": 14064.0, "status": "done"}, {"code": "w=input()\nl=[0 for _ in range(26)]\nFlag=True\nfor i in w:\n num=ord(i)-97\n #print(num)\n l[num]+=1\nfor i in l:\n if i%2==1:\n Flag=False\nif Flag:\n print('Yes')\nelse:\n print('No')\n", "passed": true, "time": 0.2, "memory": 14064.0, "status": "done"}, {"code": "import collections\nw = list(str(input()))\nl = collections.Counter(w)\ns = set(w)\n\nfor i in s:\n if int(l[i])%2 != 0:\n print('No')\n break\nelse:\n print('Yes')\n", "passed": true, "time": 0.21, "memory": 14232.0, "status": "done"}, {"code": "w = input()\nwl = []\n\nfor i in range(len(w)):\n wl.append(w[i])\n \nwl.sort()\n\na = 1\njudge = 1\nif len(w)%2 == 0:\n for n in range(len(w)-1):\n if wl[a+n] == wl[a+n-1]:\n judge += 1\n else:\n if judge%2 != 0:\n print(\"No\")\n return\n else:\n judge = 1\n if n == len(w)-2:\n if judge%2 == 0:\n print(\"Yes\")\n else:\n print(\"No\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "S = input()\nfor i in range(len(S)):\n if S.count(S[i])%2 == 1:\n print(\"No\")\n return\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "import collections\n\nw = list(input())\nc = collections.Counter(w)\nif all(x % 2 == 0 for x in c.values()):\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "s = input()\nflag = [0] * 26\n\nfor i in range(len(s)):\n flag[ord(s[i])-97] += 1\n\nres = \"Yes\"\n\nfor i in range(26):\n if flag[i] % 2 == 1:\n res = \"No\"\n\nprint(res)", "passed": true, "time": 0.22, "memory": 14020.0, "status": "done"}, {"code": "w = input()\nf = True\nfor i in w:\n c = 0\n for k in w:\n if i == k:\n c += 1\n\n if c % 2 != 0:\n f = False\nif not f:\n print(\"No\")\nelse:\n print(\"Yes\")\n", "passed": true, "time": 0.21, "memory": 14172.0, "status": "done"}, {"code": "def main():\n w = str(input())\n wl = []\n for ww in w :\n wl.append(ww)\n if len(w) % 2 != 0 :\n ans = \"No\"\n else :\n ans = \"Yes\"\n for val in wl :\n if wl.count(val) % 2 == 0 :\n pass\n else :\n ans = \"No\"\n break\n print(ans)\n\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "w = input()\nbea = True\n\nelements = set(list(w))\nfor element in elements:\n if w.count(element) % 2 != 0:\n print(\"No\")\n bea = False\n break\n\nif bea:\n print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "import math\nfrom datetime import date\n\ndef main():\n\t\n\ts = input()\n\ta = [0 for i in range(26)]\n\n\tfor c in s:\n\t\ta[ord(c) - ord('a')] += 1\n\n\tok = 'True'\n\tfor i in range(26):\n\t\tif a[i] % 2 == 1:\n\t\t\tok = 'False'\n\n\tif ok == 'True':\n\t\tprint(\"Yes\")\n\telse:\n\t\tprint(\"No\")\n\nmain()\n", "passed": true, "time": 0.15, "memory": 16464.0, "status": "done"}, {"code": "w = input()\ncnt = [0] * 26\nfor c in w:\n n = ord(c) - ord('a')\n cnt[n] += 1\nfor temp in cnt:\n if temp % 2 != 0:\n print(\"No\")\n return\nelse:\n print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "w = input()\n\nfor i in w:\n count = 0\n for j in w:\n if i == j:\n count += 1\n if count % 2 != 0:\n ans = 'No'\n break\n else:\n ans = 'Yes'\nprint(ans)\n", "passed": true, "time": 0.22, "memory": 14312.0, "status": "done"}, {"code": "w = input()\n\nd = {}\n\nfor i in list(w):\n if i not in list(d.keys()):\n d[i] = 1\n else:\n d[i] += 1\n\nans = 'Yes'\nfor _, v in list(d.items()):\n if v%2 != 0:\n ans = 'No'\n break\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "import collections\nS = list(input())\nD = collections.Counter(S)\nans = 'Yes'\n\nfor v in D.values():\n if v % 2 != 0:\n ans = 'No'\n break\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "from collections import Counter\nw = input()\nd = Counter(w)\nif (sum(d.values())) % 2 == 0 and len([c for c in d.values() if c %2 ==0]) == len(d):\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "W = input()\nans = 'Yes'\n\nif len(W)%2 == 0:\n W_ele = set([w for w in W])\n for w in W_ele:\n if W.count(w) % 2 == 1:\n ans = 'No'\nelse:\n ans = 'No'\nprint(ans)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "from collections import Counter\n\nw = input()\n\nw = Counter(w)\n\nresult = 'Yes'\nfor v in w.values():\n if v % 2 == 0:\n continue\n else:\n result = 'No'\n break\nprint(result)", "passed": true, "time": 0.23, "memory": 14256.0, "status": "done"}, {"code": "\nw = input()\ns = set(list(w))\n\nfor item in s:\n if w.count(item) % 2 != 0:\n print('No')\n return\nprint('Yes')", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "w=input()\nans=\"Yes\"\nfor i in w:\n if w.count(i)%2!=0:\n ans=\"No\"\n break\nprint(ans)", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "w = input()\nans = \"Yes\"\n\nfor i in range(26):\n if w.count(chr(ord(\"a\")+i)) % 2 == 1:\n ans = \"No\"\n break\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "w = input()\nw_set = set(w)\nd = {}\nfor i in w_set:\n d[i] = 0\nfor i in w:\n d[i] += 1\n\nfor i in d.values():\n if i % 2 != 0:\n print(\"No\")\n return\nprint(\"Yes\")", "passed": true, "time": 0.23, "memory": 14252.0, "status": "done"}, {"code": "import collections\ns = input()\nl = collections.Counter(s)\nfor i in l.values():\n if i % 2 != 0:\n print(\"No\")\n return\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "s = input()\nprint(\"Yes\" if all(s.count(i)%2==0 for i in set(s)) else \"No\")", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "w=input()\ndi={}\nfor i in w:\n if i in di:\n di[i]+=1\n else:\n di[i]=1\nfor i in di.values():\n if i&1:\n print(\"No\")\n return\nprint(\"Yes\")", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "w = input()\nans = True\nfor i in w:\n cnt = 0\n for j in w:\n if i == j:\n cnt += 1\n if cnt % 2 != 0:\n ans = False\n break\n \nif ans:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\nS = list(input())\ncun = 0\nss = set()\n\nfor i in S:\n ss.add(i)\n\nfor i in ss:\n cun = 0\n\n for p in range(len(S)):\n if i == S[p]:\n cun += 1\n if cun % 2 != 0:\n print(\"No\")\n return\n\nprint(\"Yes\")\n\n\n", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "from collections import Counter\n\nw = Counter([c for c in input()])\nif all([v % 2 == 0 for k, v in w.items()]):\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "w = input()\nfor c in set(w):\n if w.count(c) % 2:\n print('No')\n break\nelse:\n print('Yes')", "passed": true, "time": 0.15, "memory": 14028.0, "status": "done"}, {"code": "w = input()\na = 0\nfor i in range(97, 124):\n cnt = 0\n for j in w:\n if j == chr(i):\n cnt += 1\n if cnt%2 != 0:\n print(\"No\")\n break\n else:\n a += 1\n if a == 27:\n print(\"Yes\")\n break", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "s = input()\nfor i in range(len(s)):\n if s.count(s[i]) % 2 != 0:\n print('No')\n return\nprint('Yes')", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}]
[{"input": "abaccaba\n", "output": "Yes\n"}, {"input": "hthth\n", "output": "No\n"}]
4,687
There is an empty array. The following N operations will be performed to insert integers into the array. In the i-th operation (1≤i≤N), b_i copies of an integer a_i are inserted into the array. Find the K-th smallest integer in the array after the N operations. For example, the 4-th smallest integer in the array \{1,2,2,3,3,3\} is 3. -----Constraints----- - 1≤N≤10^5 - 1≤a_i,b_i≤10^5 - 1≤K≤b_1…+…b_n - All input values are integers. -----Input----- Input is given from Standard Input in the following format: N K a_1 b_1 : a_N b_N -----Output----- Print the K-th smallest integer in the array after the N operations. -----Sample Input----- 3 4 1 1 2 2 3 3 -----Sample Output----- 3 The resulting array is the same as the one in the problem statement.
introductory
[{"code": "n, k = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(n)]\n\nab.sort()\n\nnum_sum = 0\n\nfor a, b in ab:\n num_sum += b\n if num_sum >= k:\n print(a)\n return\n", "passed": true, "time": 0.15, "memory": 14360.0, "status": "done"}, {"code": "N, K = map(int, input().split())\narr = [0]*(10**5+1)\n\nfor i in range(N):\n a,b = map(int, input().split())\n arr[a] += b\n\ns = 0\nfor i in range(10**5+1):\n s += arr[i]\n if s >= K:\n print(i)\n break", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "N, K = map(int, input().split())\ns = 0\nab = [[0, 0] for i in range(N)]\nfor i in range(N):\n ab[i][0], ab[i][1] = map(int, input().split())\nab = sorted(ab)\n\n#print(ab)\nfor i in range(N):\n s += ab[i][1]\n if s >= K:\n print(ab[i][0])\n break", "passed": true, "time": 0.17, "memory": 14184.0, "status": "done"}, {"code": "from sys import stdin\ninput = stdin.readline\n \nfrom itertools import accumulate\nfrom bisect import bisect_left\n \nN, K = map(int, input().split())\n \nmemo = [0] * 100010\nfor _ in range(N):\n a, b = map(int, input().split())\n memo[a] += b\n \nprint(bisect_left(list(accumulate(memo)), K))", "passed": true, "time": 0.14, "memory": 17752.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nbucket = [0] * 10 ** 5\nfor i in range(n):\n a, b = list(map(int, input().split()))\n bucket[a - 1] += b\n\nsum_b = 0\nfor i in range(len(bucket)):\n sum_b += bucket[i]\n if sum_b >= k:\n print((i + 1))\n break\n", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "N,K = map(int,input().split())\nls = [list(map(int,input().split())) for _ in range(N)]\n\nls.sort(key=lambda x: x[0])\ns = 0\n\nfor i in range(N):\n s += ls[i][1]\n if s >= K: break\n \nprint(ls[i][0])", "passed": true, "time": 0.19, "memory": 14324.0, "status": "done"}, {"code": "f=lambda l:map(int,l.split())\nN,K=f((p:=input)());c=[0]*(l:=10**5+1);s=0\nfor i in (r:=range)(N):a,b=f(p());c[a]+=b\nfor i in r(l):\n s+=c[i]\n if s>=K: print(i);break", "passed": true, "time": 0.23, "memory": 14116.0, "status": "done"}, {"code": "n,k = map(int, input().split())\na = []\nfor i in range(n):\n\ta.append(list(map(int, input().split())))\n\na = sorted(a, key = lambda x:x[0])\n\nx = 0\nfor i in a:\n\tx += i[1]\n\tif x >= k:\n\t\tbreak\nprint(i[0])", "passed": true, "time": 0.22, "memory": 14284.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nal = [0]*(10**5+1)\n\nfor _ in range(n):\n a, b = map(int, input().split())\n al[a] += b\n\ncnt = 0\ni = 0\nwhile cnt < k:\n cnt += al[i]\n i += 1\n\nprint(i-1)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n,k=map(int,input().split())\ns=[0]*10**5\nfor i in range(n):\n a,b=map(int,input().split())\n s[a-1]+=b\ni=0\nwhile k>0:\n k-=s[i]\n i+=1\nprint(i)", "passed": true, "time": 0.22, "memory": 14560.0, "status": "done"}, {"code": "N,K = list(map(int,input().split()))\nA = []\nfor i in range(N):\n a,b = list(map(int,input().split()))\n A.append([a,b])\nA.sort()\n\nfor i in range(N):\n K = K - A[i][1]\n if K <= 0:\n print((A[i][0]))\n return\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "def main():\n N, K = list(map(int, input().split()))\n lis = []\n for i in range(N):\n a, b = list(map(int, input().split()))\n lis.append((a, b))\n\n lis = sorted(lis)\n\n for i in range(N):\n K -= lis[i][1]\n if K <= 0:\n print((lis[i][0]))\n break\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.24, "memory": 14156.0, "status": "done"}, {"code": "from collections import defaultdict\nn,k = map(int, input().split())\nans = 0\nal = []\nd = defaultdict(int)\nfor i in range(n):\n a,b = map(int, input().split())\n al.append(a)\n d[a] += b\nal = list(set(al)) \nal.sort()\nfor i in al:\n if k > d[i]:\n k -= d[i]\n else:\n print(i)\n break", "passed": true, "time": 0.15, "memory": 14048.0, "status": "done"}, {"code": "# ABC 061: C \u2013 Big Array\nN, K = [int(i) for i in input().split()]\na, b = [], []\nfor _ in range(N):\n tmp = input().split()\n a.append(int(tmp[0]))\n b.append(int(tmp[1]))\n\ncnt = [0] * (100000 + 1)\n\nfor i in range(N):\n cnt[a[i]] += b[i]\n\nfor j in range(100000 + 1):\n if K <= cnt[j]:\n print(j)\n break\n K -= cnt[j]", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nl=sorted([list(map(int,input().split()))for i in range(n)])\nfor a,b in l:\n k-=b\n if k<1:\n print(a);break", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "\n\ndef main():\n N, K = list(map(int, input().split()))\n box = []\n for _ in range(N):\n ab = list(map(int, input().split()))\n box.append(ab)\n\n box.sort(key= lambda x: x[0])\n ans = 0\n for b in box:\n if ans + b[1] < K:\n ans += b[1]\n else:\n print((b[0]))\n return\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14272.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nans=[0]*(10**5+1)\nfor i in range(n):\n a,b=map(int,input().split())\n ans[a]+=b\n \nfor i in range(len(ans)):\n k-=ans[i]\n if k<=0:\n print(i)\n break", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "N, K = map(int, input().split())\na = []\nb = []\nSum = 0\nfor i in range(N):\n x, y = map(int, input().split())\n a.append(x)\n b.append(y)\ns = [*range(len(a))]\nsort_s = sorted(s, key = lambda i: a[i])\nsort_a = [a[i] for i in sort_s]\nsort_b = [b[i] for i in sort_s]\nfor i in range(N):\n Sum += sort_b[i]\n if Sum >= K:\n print(sort_a[i])\n break", "passed": true, "time": 0.23, "memory": 14216.0, "status": "done"}, {"code": "from xml.dom import minidom\n\n\nn, k = list(map(int, input().split()))\n\nAB = [list(map(int, input().split())) for _ in range(n)]\nAB.sort()\n\nnow = -1\nidx = 0\nwhile k > 0:\n if idx >= n:\n break\n a, b = AB[idx]\n k -= b\n now = a\n idx += 1\nprint(now)\n", "passed": true, "time": 0.16, "memory": 16012.0, "status": "done"}, {"code": "n,k=map(int,input().split())\ncount=0\nba=[0]*(10**5+1)\nfor i in range(n):\n a,b=map(int,input().split())\n ba[a]+=b\n \nfor i in range(len(ba)):\n k-=ba[i]\n if k<=0:\n print(i)\n break", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "n,k=[int(i) for i in input().split()]\n\nclass Number:\n def __init__(self,number,times):\n self.number=number\n self.times=times\n\n def __eq__(self, other):\n if self.number==other.number:\n return True\n return False\n def __le__(self, other):\n if self.number<=other.number:\n return True\n return False\n def __lt__(self, other):\n if self.number<other.number:\n return True\n return False\n def __ge__(self, other):\n if self.number>=other.number:\n return True\n return False\n def __gt__(self, other):\n if self.number>other.number:\n return True\n return False\n\nnumber_list=[]\nfor i in range(n):\n number,times=[int(i) for i in input().split()]\n number_list.append(Number(number,times))\n\nnumber_list.sort()\n\n\ndef get(number_list,k):\n i=0\n while True:\n taishou=number_list[i]\n k=k-taishou.times\n if k<=0:\n return taishou.number\n else:\n i+=1\nprint(get(number_list,k))", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\na = [0] * n\nb = [0] * n\nfor i in range(n):\n a[i], b[i] = list(map(int ,input().split()))\n\n\njudge = 0\ndic = {}\n\n\nfor i in range(n):\n if a[i] in dic:\n dic[a[i]] += b[i]\n else:\n dic[a[i]] = b[i]\n#print(dic)\ndic = list(dic.items())\ndic.sort()\n#print(dic)\n\n\nfor i in range(10**9):\n if judge >= k:\n print((dic[i-1][0]))\n break\n else:\n judge += int(dic[i][1])\n #print(judge)\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nsum_b = 0\nab_list = []\n\nfor i in range(n):\n ab_list.append(list(map(int, input().split())))\n\nab_list.sort()\nfor i in range(n):\n a, b = ab_list[i]\n sum_b += b\n if sum_b >= k:\n print(a)\n break\n", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nab=[list(map(int,input().split())) for i in range(n)]\nres=k\nab.sort()\nfor i in range(n):\n res-=ab[i][1]\n if res<=0:\n print(ab[i][0])\n return", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nd = {}\nkey = set([])\nfor _ in range(N):\n a, b = map(int, input().split())\n if a in key:\n d[str(a)] += b\n else:\n key.add(a)\n d[str(a)] = b\nkey = sorted(list(key))\nfor k in key:\n if d[str(k)] < K:\n K -= d[str(k)]\n else:\n print(k)\n break", "passed": true, "time": 0.22, "memory": 14176.0, "status": "done"}, {"code": "#!/usr/bin/env python\n\nn, k = list(map(int, input().split()))\na = [0 for _ in range(n)]\nb = [0 for _ in range(n)]\nfor i in range(n):\n a[i], b[i] = list(map(int, input().split()))\n\nd = {}\nfor i in range(n):\n if a[i] not in d:\n d[a[i]] = b[i]\n else:\n d[a[i]] += b[i]\n\nd = sorted(list(d.items()), key=lambda x: x[0])\n\ntmp = 0 \nfor i in range(len(d)):\n tmp += d[i][1]\n if tmp >= k:\n print((d[i][0]))\n return\n", "passed": true, "time": 0.14, "memory": 14356.0, "status": "done"}, {"code": "n, k = map(int,input().split())\n\nq = []\nfor i in range(n):\n q.append(list(map(int, input().split())))\n\nq = sorted(q, key=lambda x:x[0])\ncnt = 0\ni = 0\nwhile cnt < k:\n a, b = q[i]\n cnt += b\n i += 1\nprint(a)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "n, k = map(int, input().split(\" \"))\na = sorted([list(map(int, input().split(\" \"))) for i in range(n)])\ncount = 0\nfor x, y in a:\n count += y\n if k <= count:\n print(x)\n break\nelse:\n print(\"None\")", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "f=lambda:map(int,input().split());N,K=f()\nfor a,b in sorted([*f()]for _ in[0]*N):\n K-=b\n if K<1:print(a);return", "passed": true, "time": 0.22, "memory": 14264.0, "status": "done"}, {"code": "N,K = map(int,input().split())\nans = []\nfor i in range(N):\n ab = list(map(int,input().split()))\n ans.append(ab)\nans.sort()\nl = 0\nfor i in range(N):\n l += ans[i][1]\n if l >= K:\n s = i\n break\nprint(ans[s][0])", "passed": true, "time": 0.21, "memory": 14140.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\nmemory = {}\nS = []\n\nfor i in range(N):\n a, b = list(map(int, input().split()))\n try:\n memory[a] += b\n except KeyError:\n memory[a] = b\n\nA = sorted(list(memory.keys()))\nfor a in A:\n if not S:\n S.append(memory[a])\n else:\n S.append(S[-1] + memory[a])\n\nfor i in range(N):\n if S[i] >= K:\n print((A[i]))\n break\n", "passed": true, "time": 1.5, "memory": 14072.0, "status": "done"}, {"code": "N,K=list(map(int,input().split()))\nab=list(list(map(int,input().split())) for _ in range(N))\nab.sort()\n\ni=0\nwhile K>0:\n K-=ab[i][1]\n i+=1\nprint((ab[i-1][0]))\n", "passed": true, "time": 0.2, "memory": 14136.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nlst = [0]*10**5\nfor i in range(n):\n a,b=map(int,input().split())\n lst[a-1] += b\n ans = 0\nfor j in range(10**5):\n ans += lst[j]\n if ans >= k:\n print(j+1)\n return", "passed": true, "time": 0.21, "memory": 14176.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\n\ncnt = 0\n\nls = []\n\nfor i in range(N):\n ls.append(list(map(int, input().split())))\n\nls.sort(key=lambda x: x[0])\n\nfor a, b in ls:\n cnt += b\n if cnt >= K:\n break\n\nprint(a)\n", "passed": true, "time": 0.21, "memory": 14100.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nS = set()\nD = dict()\nfor _ in range(n):\n a, b = map(int, input().split())\n if a in S:\n D[a] += b\n else:\n S.add(a)\n D[a] = b\nL = sorted(S)\ncnt = 0\nfor l in L:\n cnt += D[l]\n if cnt >= k:\n print(l)\n break", "passed": true, "time": 0.21, "memory": 14264.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 28 01:21:16 2020\n\n@author: liang\n\"\"\"\n\n#\u30d0\u30b1\u30c4\u30bd\u30fc\u30c8O(n)\nN, K = map(int,input().split())\nnum = [0]*(10**5+1)\nfor i in range(N):\n a, b = map(int,input().split())\n num[a] += b\n\ntmp = 0\nfor i in range(10**5+ 1):\n tmp += num[i]\n if tmp >= K:\n print(i)\n break", "passed": true, "time": 0.21, "memory": 14272.0, "status": "done"}, {"code": "def main2():\n N, K = map(int, input().split())\n limit = 10**5\n\n ins = [0 for _ in range(limit + 1)]\n\n for _ in range(N):\n a, b = map(int, input().split())\n ins[a] += b\n\n c = 0\n for i in range(1, limit + 1):\n c += ins[i]\n\n if c >= K:\n print(i)\n return\n\ndef __starting_point():\n main2()\n__starting_point()", "passed": true, "time": 0.21, "memory": 14004.0, "status": "done"}, {"code": "N,K = map(int,input().split())\nans = []\n\nfor i in range(N):\n ab = list(map(int,input().split()))\n ans.append(ab)\n\nans.sort()\n\nl = 0\n \nfor i in range(N):\n l += ans[i][1]\n if l >= K:\n s = i\n break\nprint(ans[s][0])", "passed": true, "time": 0.22, "memory": 14328.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nl = sorted([list(map(int, input().split()))for i in range(n)])\nfor a, b in l:\n k -= b\n if k <1:\n print(a)\n break\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "n,k = [int(x) for x in input().split()]\na = []\nfor i in range(n):\n a.append([int(x) for x in input().split()])\na.sort()\n\nc = 0\nwhile k > 0:\n k -= a[c][1]\n c += 1\n\nprint(a[c-1][0])", "passed": true, "time": 0.2, "memory": 14284.0, "status": "done"}, {"code": "N, K = map(int, input().split())\n\nlst = [list(map(int, input().split())) for _ in range(N)]\nlst.sort(key=lambda x: x[0])\ns = 0\nfor i in range(N):\n\ts += lst[i][1]\n\tif s >= K: break\nprint(lst[i][0])", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nab=[list(map(int,input().split())) for i in range(n)]\nab.sort()\n\ndef slv():\n cnt = 0\n for i in range(n):\n cnt += ab[i][1]\n if cnt >= k:\n return print(ab[i][0])\n\nslv()", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nli = []\nfor i in range(n):\n temp = list(map(int, input().split()))\n li.append(temp)\n#print(li)\nli.sort()\n#print(li)\ntotal=0\nfor i in range(n):\n if i==n-1:\n #print(\"here\")\n print((li[i][0]))\n break\n total+=li[i][1]\n if total<k:\n continue\n else:\n print((li[i][0]))\n break\n #print(i, total)\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "def main():\n N, K = list(map(int, input().split()))\n l = []\n cnt = 0\n for _ in range(N):\n a, b = list(map(int, input().split()))\n l.append((a, b))\n l.sort(key=lambda x: x[0])\n for a, x in l:\n cnt += x\n if cnt >= K:\n print(a)\n return\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.2, "memory": 14188.0, "status": "done"}, {"code": "from collections import defaultdict as dd\nfrom itertools import count\nN, K = map(int, input().split())\nCnt = dd(lambda:0)\nfor _ in range(N):\n a, b = map(int, input().split())\n Cnt[a] += b\n\nnum = 0\nfor i in count(1,1):\n num += Cnt[i]\n if num >= K:\n print(i)\n break", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "N, K = map(int,input().split())\nls = [0]+[0]*10**5\nfor i in range(N):\n a,b = map(int,input().split())\n ls[a] += b\nii = 0\nfor i in range(1,10**5+1):\n ii += ls[i]\n if ii >= K:\n ans = i\n break\n else:\n continue\nprint(ans)", "passed": true, "time": 0.14, "memory": 14940.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nnum,count=[0]*((10**5)+1),0\nfor _ in range(n):\n a,b=map(int,input().split())\n num[a]+=b\nfor i in range(len(num)):\n count+=num[i]\n if count >= k:\n print(i)\n break", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\n\ndef main():\n n,k = map( int , input().split() )\n A = [ 0 for i in range( 10 ** 5 + 1 ) ]\n for i in range(n):\n a,b = map( int , input().split() )\n A[ a ] += b\n \n i = 0\n sum = 0\n while( sum < k ):\n i += 1\n sum += A[i]\n print(i)\n\n\n\nmain()", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "N,K=list(map(int,input().split()))\ncount=[0]*(100001)\nfor i in range(1,N+1) :\n a,b=list(map(int,input().split()))\n count[a]+=b\nfor i in range(1,100001) :\n if K<=count[i] :\n print(i)\n break\n K-=count[i]\n", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "# C - Big Array\ndef main():\n n, k = map(int, input().split())\n ab = [list(map(int, input().split())) for _ in range(n)]\n ab.sort()\n\n i = 0\n\n while k > 0:\n k -= ab[i][1]\n i += 1\n else:\n print(ab[i-1][0])\n\nif __name__ == \"__main__\":\n main()", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "from collections import defaultdict\nN,K = list(map(int,input().split()))\nN_List = defaultdict(int)\nfor i in range(N):\n Num,Cnt = list(map(int,input().split()))\n N_List[Num] += Cnt\n\nN_List = sorted(list(N_List.items()), key=lambda x:x[0])\n\nans = 0\nfor Key,Value in N_List:\n ans += Value\n if ans >= K:\n print(Key)\n break\n\n", "passed": true, "time": 0.21, "memory": 14064.0, "status": "done"}, {"code": "n,k=map(int,input().split())\ns=[0]*10**5\nfor i in range(n):\n a,b=map(int,input().split())\n s[a-1]+=b\ni=0\nwhile k>0:\n k-=s[i]\n i+=1\nprint(i)", "passed": true, "time": 0.15, "memory": 14748.0, "status": "done"}, {"code": "#95 C - Big Array\nN,K = map(int,input().split())\nlis = []\nfor _ in range(N):\n a,b = map(int,input().split())\n lis.append((a,b))\n\nlis = sorted(lis,reverse = False)\n\ncnt = 0\nnum = 0\nfor a,b in lis:\n cnt += b\n num = a\n if cnt >= K:\n break\nprint(num)", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\n\nab = [[0, 0]] * N\nfor i in range(N):\n _a, _b = list(map(int, input().split()))\n ab[i] = [_a, _b]\nab.sort(key=lambda x:x[0])\n\nj = 0\nindex = 0\nwhile j < K:\n j += ab[index][1]\n if j < K:\n index += 1\n\nprint((ab[index][0]))\n", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "#\n# abc061 c\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"3 4\n1 1\n2 2\n3 3\"\"\"\n output = \"\"\"3\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"10 500000\n1 100000\n1 100000\n1 100000\n1 100000\n1 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\"\"\"\n output = \"\"\"1\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n N, K = list(map(int, input().split()))\n D = [list(map(int, input().split())) for _ in range(N)]\n\n D.sort()\n t = 0\n for d in D:\n t += d[1]\n if t >= K:\n print((d[0]))\n break\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14608.0, "status": "done"}, {"code": "import heapq\n\nn, k = map(int,input().split())\n\nq = []\nfor i in range(n):\n q.append(list(map(int, input().split())))\n\nheapq.heapify(q)\n\ncnt = 0\nwhile cnt < k:\n a, b = heapq.heappop(q)\n cnt += b\n \nprint(a)", "passed": true, "time": 0.21, "memory": 14236.0, "status": "done"}, {"code": "#n = int(input())\nn, k = list(map(int, input().split()))\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\ndic = {}\nfor i in range(n):\n a, b = list(map(int, input().split()))\n dic[a] = dic.get(a, 0)+b\n\nl = sorted(dic.items())\n\nfor a, b in l:\n if k <= b:\n ans = a\n break\n k -= b\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nd = {}\nfor _ in range(n):\n a, b = map(int, input().split())\n if a in d.keys():\n d[a] += b\n else:\n d[a] = b\ncnt = 0\nsorted_d = sorted(d.items(), key=lambda x: x[0])\nfor key, val in sorted_d:\n cnt += val\n if k <= cnt:\n print(key)\n break", "passed": true, "time": 0.15, "memory": 14040.0, "status": "done"}, {"code": "n,k=map(int,input().split())\na=[]\nfor i in range(n):\n A=list(map(int,input().split()))\n a.append(A)\na = sorted(a, key=lambda x: x[0])\nb=0\nfor i in range(n):\n b+=a[i][1]\n if b>=k:\n print(a[i][0])\n return", "passed": true, "time": 0.24, "memory": 14044.0, "status": "done"}, {"code": "N,K = map(int,input().split())\nnums = []\n\nfor _ in range(N):\n a,b = map(int,input().split())\n nums.append([a,b])\n\nnums.sort()\nS = 0\n\nfor i in range(N+1):\n if S < K:\n S += nums[i][1]\n else:\n print(nums[i-1][0])\n break", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "import math\nfrom math import gcd,pi,sqrt\nINF = float(\"inf\")\n\nimport sys\nsys.setrecursionlimit(10**6)\nimport itertools\nfrom collections import Counter,deque\ndef i_input(): return int(input())\ndef i_map(): return list(map(int, input().split()))\ndef i_list(): return list(i_map())\ndef i_row(N): return [i_input() for _ in range(N)]\ndef i_row_list(N): return [i_list() for _ in range(N)]\ndef s_input(): return input()\ndef s_map(): return input().split()\ndef s_list(): return list(s_map())\ndef s_row(N): return [s_input for _ in range(N)]\ndef s_row_str(N): return [s_list() for _ in range(N)]\ndef s_row_list(N): return [list(s_input()) for _ in range(N)]\n\nimport string\n\ndef main():\n n,k = i_map()\n\n cnt = 0\n l = []\n for _ in range(n):\n a,b = i_map()\n l.append([a,b])\n\n l.sort()\n for i,j in l:\n cnt += j\n if cnt >= k:\n print(i)\n break\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.24, "memory": 14144.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 28 01:14:47 2020\n\n@author: liang\n\"\"\"\n\nN, K = list(map(int,input().split()))\nA = list()\nfor i in range(N):\n a, b = list(map(int,input().split()))\n A.append((a,b))\nA.sort(key= lambda x:x[0])\n\ntmp = 0\nfor i in range(N):\n a, b = A[i]\n tmp += b\n if tmp >= K:\n print(a)\n break\n", "passed": true, "time": 0.15, "memory": 14396.0, "status": "done"}, {"code": "li = [0]*(10**5+10)\nn,k = map(int, input().split())\nfor i in range(n):\n a,b = map(int, input().split())\n li[a] += b\ncnt = 0\nans = 0\nfor i in range(10**5+10):\n cnt += li[i]\n ans = i\n if cnt >= k:\n break\nprint(ans)", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nquery = sorted([tuple(map(int, input().split())) for _ in range(n)])\n\ncnt = 0\ni = 0\nwhile cnt < k:\n a, b = query[i]\n cnt += b\n i += 1\nprint(a)", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "# s = input()\n# n = len(s) - 1\n# ans = 0\n# for i in range(1 << n):\n# formula = s[0]\n# for j in range(n):\n# if ((i >> j) & 1):\n# formula += '+' + s[j + 1]\n# else:\n# formula += s[j + 1]\n# ans += eval(formula)\n# print(ans)\nimport sys\n\n\nstdin = sys.stdin\ndef ns(): return stdin.readline().rstrip()\ndef ni(): return int(stdin.readline().rstrip())\ndef nm(): return list(map(int, stdin.readline().split()))\ndef nl(): return list(map(int, stdin.readline().split()))\n\n\ndef main():\n n, k = nm()\n A = [0] * (10 ** 5 + 1)\n for i in range(n):\n a, b = nm()\n A[a] += b\n\n sum_num = 0\n for i, a in enumerate(A):\n sum_num += a\n if sum_num >= k:\n print(i)\n return\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.21, "memory": 14216.0, "status": "done"}, {"code": "N,K=map(int,input().split());c=[0]*(l:=10**5+1);s=0\nfor i in range(N):a,b=map(int,input().split());c[a]+=b\nfor i in range(l):\n s+=c[i]\n if s>=K: print(i);break", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\ndef main():\n n, k = list(map(int, input().split()))\n arr = sorted([list(map(int, input().split())) for i in range(n)])\n for ab in arr:\n k -= ab[1]\n if k <= 0:\n ans = ab[0]\n break\n\n print(ans)\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "N,K=map(int,input().split())\nl=[list(map(int,input().split()))for i in range(N)]\nl.sort(key=lambda x: x[0])\nans=0\nfor i in l:\n if K==0:\n break\n K-=min(K,i[1])\n ans=i[0]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n,k = list(map(int,input().split()))\nA = []\nfor _ in range(n):\n A.append(list(map(int,input().split())))\nA.sort(key=lambda x: x[0])\ncnt = 0\nwhile k>0:\n k-=A[cnt][1]\n cnt+=1\nprint((A[cnt-1][0]))\n", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "import sys\n\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninl = lambda: [int(x) for x in sys.stdin.readline().split()]\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print(\"\\033[33m\", *a, \"\\033[0m\", **dict(file=sys.stderr, **kw))\n\n\ndef solve():\n n, k = inl()\n v = []\n for i in range(n):\n a, b = inl()\n v.append((a, b))\n v.sort(reverse=True)\n c = k - 1\n while v:\n a, b = v.pop()\n if b > c:\n return a\n c -= b\n\n\nprint(solve())\n", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N,K=map(int,input().split())\ncnt=0\nP=[]\nfor i in range(N):\n a,b=map(int,input().split())\n P.append((a,b))\n\nP=sorted(P)\nfor i in range(N):\n cnt+=P[i][1]\n if cnt>=K:\n print(P[i][0])\n break", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\n\nab = [[0, 0]] * N\nfor i in range(N):\n _a, _b = list(map(int, input().split()))\n ab[i] = [_a, _b]\nab.sort(key=lambda x:x[0])\n\n\ntotal = 0\nfor pair in ab:\n total += pair[1]\n if total >= K:\n print((pair[0]))\n break\n", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nd = {}\nfor i in range(N):\n a, b = map(int, input().split())\n d[a] = d.get(a, 0) + b\n\ncnt = 0\nfor k in sorted(d.keys()):\n cnt += d[k]\n if cnt >= K:\n print(k)\n break", "passed": true, "time": 0.23, "memory": 14308.0, "status": "done"}, {"code": "n, k = map(int,input().split())\na_b = [ list(map(int, input().split())) for _ in range(n) ]\na_b = sorted(a_b, key=lambda x: x[0] )\n\ncount = 0\nfor i in range(len(a_b)):\n a, b = a_b[i]\n count += b\n if count >= k:\n print(a)\n break", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "n, k = map(int, (input().split()))\narr = [0] * 100100\nfor i in range(n):\n a, b = map(int, input().split())\n arr[a] += b\n\ncur = 0\nfor i in range(100100):\n cur += arr[i]\n if cur >= k:\n print(i)\n break", "passed": true, "time": 0.45, "memory": 14300.0, "status": "done"}, {"code": "N, K = map(int, input().split())\n\nbucket = [0] * (10 ** 5 + 1)\nfor _ in range(N):\n a, b = map(int, input().split())\n bucket[a] += b\n\ncnt = 0\nfor i, c in enumerate(bucket):\n if c == 0:\n continue\n cnt += c\n if cnt >= K:\n print(i)\n return", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N,K=map(int,input().split())\nd={}\nfor i in range(N):\n a,b=map(int,input().split())\n if a not in d:\n d[a]=b\n else:\n d[a]+=b\nd=sorted(d.items())\nfor i in d:\n K-=i[1]\n if K<=0:\n print(i[0])\n break", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "n,k = map(int, input().split())\nab = sorted([list(map(int, input().split())) for _ in range(n)])\ncnt = 0\nfor a,b in ab:\n cnt += b\n if cnt >= k: break\nprint(a)", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nar = {}\nfor i in range(n):\n a, b = list(map(int, input().split()))\n if (a in ar) == True:\n ar[a] += b\n else:\n ar[a] = b\n\nfor i in sorted(ar.keys()):\n k -= ar[i]\n if k <= 0:\n print(i)\n break\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "N,K=map(int,input().split())\nA={}\nfor i in range(N):\n a,b=map(int,input().split())\n A[a]=A.get(a,0)+b\nA=sorted(A.items())\n\ncnt=0\nfor n,k in A:\n cnt+=k\n if cnt>=K:\n print(n)\n return", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N,K=list(map(int,input().split()))\nA=[list(map(int,input().split())) for _ in range(N)]\nA=sorted(A, key=lambda x: x[0])\n\ncnt=0\nfor i in range(N):\n a,b=A[i]\n A[i][1]+=cnt\n cnt=A[i][1]\n\nfor i in range(N):\n a,b=A[i]\n if K<=b:break\nprint(a)\n", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "import bisect\n\nn,k=list(map(int,input().split()))\nhairetu=[0]*100001\n\nfor _ in range(n):\n a,b=list(map(int,input().split()))\n hairetu[a]+=b\n\nruiseki=[0]*100001\nfor i in range(1,100001):\n ruiseki[i]=ruiseki[i-1]+hairetu[i]\n\nprint((bisect.bisect_left(ruiseki,k)))\n", "passed": true, "time": 0.17, "memory": 17660.0, "status": "done"}, {"code": "xx = []\nn, k = map(int, input().split())\nab = [list(map(int, input().split())) for i in range(n)]\nxx = sorted(ab, key= lambda x:x[0])\n\nans = 0\nfor i in range(n):\n ans += xx[i][1]\n if ans >= k:\n print(xx[i][0])\n break", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "from collections import Counter\n\nn, k = map(int, input().split())\n\nd = Counter()\nfor _ in range(n):\n a, b = map(int, input().split())\n d[a] += b\n\nx = sorted(d.items(), key=lambda x: x[0])\ncnt = 0\nfor a, b in x:\n cnt += b\n if cnt >= k:\n print(a)\n return", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "AMAX = 10**5\ncount = [0] * (AMAX + 1)\n\nN, K = map(int, input().split())\n\nfor _ in range(N):\n a, b = map(int, input().split())\n count[a] += b\n\nfor ans in range(AMAX + 1):\n if K <= count[ans]:\n print(ans)\n break\n K -= count[ans]", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}]
[{"input": "3 4\n1 1\n2 2\n3 3\n", "output": "3\n"}, {"input": "10 500000\n1 100000\n1 100000\n1 100000\n1 100000\n1 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n100000 100000\n", "output": "1\n"}]
4,688
There are N balls placed in a row. AtCoDeer the deer is painting each of these in one of the K colors of his paint cans. For aesthetic reasons, any two adjacent balls must be painted in different colors. Find the number of the possible ways to paint the balls. -----Constraints----- - 1≦N≦1000 - 2≦K≦1000 - The correct answer is at most 2^{31}-1. -----Input----- The input is given from Standard Input in the following format: N K -----Output----- Print the number of the possible ways to paint the balls. -----Sample Input----- 2 2 -----Sample Output----- 2 We will denote the colors by 0 and 1. There are two possible ways: we can either paint the left ball in color 0 and the right ball in color 1, or paint the left in color 1 and the right in color 0.
introductory
[{"code": "n,k=map(int,input().split())\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.16, "memory": 14048.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nprint((k*pow(k-1, n-1)))\n", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "N,K = map(int,input().split())\nP = K\nfor i in range(N-1):\n P *= K-1\nprint(P)", "passed": true, "time": 1.94, "memory": 14216.0, "status": "done"}, {"code": "N, K=map(int, input().split(\" \"))\n\nprint(K*(K-1)**(N-1))", "passed": true, "time": 1.95, "memory": 14164.0, "status": "done"}, {"code": "N, K = map(int, input().split())\n\nans = K * (K - 1)**(N - 1)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14048.0, "status": "done"}, {"code": "N, K = map(int, input().split())\n\nres = 1\n\nfor i in range(N):\n if i == 0:\n res *= K\n else:\n res *= (K-1)\n\nprint(res)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "N,K=list(map(int,input().split()))\nans = K\nfor i in range(N-1):\n ans *= (K-1)\nprint(ans)\n", "passed": true, "time": 0.41, "memory": 14240.0, "status": "done"}, {"code": "N, K = map(int,input().split())\nnum = K;\n\nif N != 1 :\n for i in range(1,N):\n num *= K-1\n\nprint(num)", "passed": true, "time": 0.16, "memory": 14224.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nprint(K * pow(K-1,N-1))", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "n, k = map(int, input().split())\n\nprint(k * ((k - 1) ** (n - 1)))", "passed": true, "time": 0.17, "memory": 14164.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nprint(K * ((K - 1) ** (N - 1)))", "passed": true, "time": 0.18, "memory": 14280.0, "status": "done"}, {"code": "N,K=map(int,input().split())\nprint(K*((K-1)**(N-1)))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\n\nprint((k * (k-1)**(n-1)))\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nans = k * pow(k-1, n-1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nans = k\nfor _ in range(n-1):\n ans *= k-1\nprint(ans)", "passed": true, "time": 0.22, "memory": 14048.0, "status": "done"}, {"code": "N,K = map(int, input().split())\npattern = K*(K-1)**(N-1)\nprint(pattern)", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nans = k\nfor i in range(n-1):\n ans = ans * (k -1)\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nprint(k*((k-1)**(n-1)))", "passed": true, "time": 0.18, "memory": 14264.0, "status": "done"}, {"code": "n,k = map(int, input().split())\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.17, "memory": 14180.0, "status": "done"}, {"code": "N,K = map(int,input().split())\n\nans = K*(K-1)**(N-1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "lst = input().split()\n\nN = int(lst[0])\nK = int(lst[1])\n\nprint(K * ((K-1) ** (N-1)))", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nprint(k*((k-1)**(n-1)))", "passed": true, "time": 0.17, "memory": 14280.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nprint(k*((k-1)**(n-1)))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "N,K = map(int,input().split())\n\ndef calculate(n, k):\n print(k * pow(k-1,n-1))\n\ncalculate(N, K)", "passed": true, "time": 0.23, "memory": 14320.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nprint(k*((k-1)**(n-1)))", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nprint((k * (k-1) ** (n-1)))\n", "passed": true, "time": 0.24, "memory": 14068.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nif n==1:\n print(k)\nelse:\n print(k*(k-1)**(n-1))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\n\nans = 0\nans += k * (k - 1) ** (n - 1)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14372.0, "status": "done"}, {"code": "a,b=input().split()\na=int(a)\nb=int(b)\nprint(b*(b-1)**(a-1))", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "a = list(map(int ,input().split()))\nsum = 0\nfor i in range(a[0]):\n if i == 0:\n sum = a[1]\n else:\n sum *= a[1]-1\n\nprint(sum)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nx = K*(K-1)**(N-1)\nprint(x)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "N, K = map(int, input().split())\ntotal = K\nfor i in range(N-1):\n total *= (K-1)\nprint(total)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nans = k\nfor i in range(n-1):\n ans *= k-1\nprint(ans)", "passed": true, "time": 1.82, "memory": 14224.0, "status": "done"}, {"code": "n,k = map(int,input().split())\n\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "N, K = map(int,input().split())\nprint(K * (K - 1)**(N - 1))", "passed": true, "time": 0.35, "memory": 14172.0, "status": "done"}, {"code": "n,k=map(int, input().split())\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "N, K = [int(x) for x in input().split()]\nans = (K-1)**(N-1)*K\nprint(ans)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "nk = input().split()\n\nn = int(nk[0])\nk = int(nk[1])\n\np = k * (k-1)**(n-1)\n\nprint(p)\n", "passed": true, "time": 0.15, "memory": 14272.0, "status": "done"}, {"code": "n, k = map(int, input().split())\n\nprint(k * (k - 1) ** (n - 1))", "passed": true, "time": 0.15, "memory": 14184.0, "status": "done"}, {"code": "N, K = map(int, input().split())\n\ncnt = K\nfor i in range(N - 1):\n cnt *= (K - 1)\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\n\nprint((K * pow(K-1, N-1)))\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "N, K = map(int,input().split())\n\nans = K * ((K-1)**(N-1))\nprint(ans)", "passed": true, "time": 0.15, "memory": 14232.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nans = k\nfor i in range(n-1):\n ans *= k-1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\nprint((k*((k-1)**(n-1))))\n", "passed": true, "time": 0.15, "memory": 14168.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\n\nans = k * (k-1)**(n-1)\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14044.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nprint(k * pow(k - 1, n - 1))", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "a,b=map(int,input().split());print(b*(b-1)**(a-1))", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "\ndef resolve():\n n, k = list(map(int, input().split()))\n\n print((k * (k-1) ** (n-1)))\n\ndef __starting_point():\n resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "N,K = map(int,input().split())\n\nprint(K * (K - 1) ** (N - 1))", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n,k = list(map(int,input().split()))\nprint((k*((k-1)**(n-1))))\n", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nprint(k* ((k-1)**(n-1)))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n, k = map(int, input().split())\n\nans = k * pow(k - 1, n-1)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nprint(b*(b-1)**(a-1))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nans = K * ((K-1) ** (N-1))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "N,K = list(map(int,input().split()))\nprint((K * (K-1)**(N-1)))\n", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.23, "memory": 14088.0, "status": "done"}, {"code": "N, K = list(map(int,input().split()))\nans = 1\n\nans = K * (K - 1) ** (N - 1)\n\nprint(ans)\n \n", "passed": true, "time": 0.95, "memory": 14128.0, "status": "done"}, {"code": "N,K = map(int, input().split())\n\npr = K\nfor _ in range(1,N):\n pr *= K-1\nprint(pr)", "passed": true, "time": 0.21, "memory": 14204.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\nif(n!=1 and n!=1 ):\n print((k*(k-1)**(n-1)))\nif(n == 1):\n print(k)\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n,k=map(int,input().split())\na=k*(k-1)**(n-1)\nprint(a)", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "n,k = list(map(int,input().split()))\nprint((k*((k-1)**(n-1))))\n", "passed": true, "time": 0.15, "memory": 14204.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nif n == 1:\n print(k)\n return\nsu = k\nfor i in range(n-1):\n su *= (k-1)\nprint(su)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\nprint((K * pow(K - 1, N - 1)))\n", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "MOD = 10**11\n\ndef fast_pow(x, n, MOD):\n res = 1\n while n:\n if n & 1:\n res = res * x % MOD\n x = x * x % MOD\n n >>= 1\n return res\n\n\nn, k = map(int,input().split())\nif n == 1:\n print(k)\nelse:\n print(k * fast_pow(k-1, n-1, MOD))", "passed": true, "time": 0.21, "memory": 14116.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\nprint((k*(k-1)**(n-1)))\n", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "a,b = map(int,input().split())\n\nprint((b-1)**(a-1)*b)", "passed": true, "time": 0.24, "memory": 14052.0, "status": "done"}, {"code": "N,K=map(int,input().split())\nprint(K*(K-1)**(N-1))", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "N, K = map(int, input().split())\n\nprint(K*((K-1)**(N-1)))", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nprint(k*((k-1)**(n-1)))", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "\n# ABC046\nN, K = map(int, input().split())\nprint(K*(K-1)**(N-1))", "passed": true, "time": 0.24, "memory": 14184.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nprint(b*(b-1)**(a-1))", "passed": true, "time": 0.24, "memory": 14196.0, "status": "done"}, {"code": "n, k = tuple([int(x) for x in input().split(\" \")])\n\nprint((k * pow(k - 1, n - 1)))\n", "passed": true, "time": 0.23, "memory": 14016.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\nans = K\nfor i in range(N - 1):\n ans *= K - 1\n \nprint(ans) \n\n\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "str_line = input().split(\" \")\nnum = int(str_line[0])\nkind = int(str_line[1])\nans = kind \n\nfor i in range(num-1):\n ans *=(kind - 1)\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\n\ndef main():\n N, K = [int(x) for x in input().split()]\n\n print((K * (K - 1) ** (N - 1)))\n\n \n\ndef __starting_point():\n main()\n\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nm=1\nif n==1:\n print(k)\nelse:\n m *= k\n for i in range(n-1):\n m *= (k-1)\n print(m)", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\nN,K = map(int, input().split())\n\nans = K * ((K-1) ** (N-1)) \n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n,k = [int(x) for x in input().split()]\nres = k\nfor i in range(1,n):\n res *= k - 1\nprint(res)", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "def si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lint(): return list(map(int, input().split()))\ndef lint_dec(): return list([int(x) - 1 for x in input().split()])\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef graph_input(G, m):\n for _ in range(m):\n a, b = lint_dec()\n G[a].append(b)\n G[b].append(a)\n\n\n\n############################################################\nN, K = lint()\nprint((K * pow(K - 1, N - 1)))\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "def answer(n: int, k: int) -> int:\n return k * (k - 1) ** (n - 1)\n\n\ndef main():\n n, k = map(int, input().split())\n print(answer(n, k))\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "N, K = map(int, input().split(' '))\n\nanswer = (K-1)**(N-1) * K\nprint(answer)", "passed": true, "time": 0.42, "memory": 14044.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "n,k = map(int, input().split())\nans=k*((k-1)**(n-1))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\n\nprint((K * (K - 1) ** (N - 1)))\n", "passed": true, "time": 0.22, "memory": 14220.0, "status": "done"}, {"code": "n,k = list(map(int, input().split()))\np=k\nfor i in range(n-1):\n p *= k-1\nprint(p)\n", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "N, K = [int(x) for x in input().split()]\nprint(K*(K-1)**(N-1))", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nprint(K * ((K - 1) **(N - 1)))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nprint((k * pow((k-1), (n-1))))\n", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N,K = list(map(int,input().split()))\n\nprint((K*(K-1)**(N-1)))\n", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nans = k*(k-1)**(n-1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "N,K=map(int,input().split())\n\ns=K*(K-1)**(N-1)\n\nprint(int(s))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nprint(K*(K-1)**(N-1))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "N, K =map(int, input().split())\nprint(K*((K-1)**(N-1)))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nprint(k*(k-1)**(n-1))", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "import re\nimport copy\n\ndef accept_input():\n N,K = list(map(int,input().split()))\n return N,K\n\nN,K = accept_input()\n\n\nif K == 1:\n print(N)\nelse:\n print((K*((K-1)**(N-1))))\n", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}]
[{"input": "2 2\n", "output": "2\n"}, {"input": "1 10\n", "output": "10\n"}]
4,689
There is a circular pond with a perimeter of K meters, and N houses around them. The i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond. When traveling between these houses, you can only go around the pond. Find the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses. -----Constraints----- - 2 \leq K \leq 10^6 - 2 \leq N \leq 2 \times 10^5 - 0 \leq A_1 < ... < A_N < K - All values in input are integers. -----Input----- Input is given from Standard Input in the following format: K N A_1 A_2 ... A_N -----Output----- Print the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses. -----Sample Input----- 20 3 5 10 15 -----Sample Output----- 10 If you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.
introductory
[{"code": "k, n = map(int, input().split())\npoints = list(map(int, input().split()))\n\ndist = []\nfor i in range(n):\n if i != n-1:\n distance = points[i+1] - points[i]\n else:\n distance = points[0]+k - points[i]\n dist.append(distance)\n\nmax = dist[0]\nfor j in range(1, len(dist), 1):\n if max < dist[j]:\n max = dist[j]\ndist.remove(max)\n\nans = 0\nfor k in dist:\n ans += k\nprint(ans)", "passed": true, "time": 0.29, "memory": 14272.0, "status": "done"}, {"code": "k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nd = []\nfor i in range(n - 1):\n d.append(a[i + 1] - a[i])\nd.append(k - a[n - 1] + a[0])\nd.sort()\nprint(sum(d[:-1]))", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "K, N = map(int, input().split())\nA_l = sorted(map(int, input().split()))\nd_l = [K+A_l[0]-A_l[N-1]]\nfor i in range(1, N):\n d_l.append(A_l[i]-A_l[i-1])\nprint(K-max(d_l))", "passed": true, "time": 0.15, "memory": 14060.0, "status": "done"}, {"code": "k,n = map(int,input().split())\na = list(map(int,input().split()))\ntemp = 0\nfor i in range(n-1):\n temp = max(temp,a[i+1]-a[i])\ntemp = max(temp,k-a[n-1]+a[0])\nprint(k-temp)", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "# import math\n# import statistics\n# import itertools\n# a=int(input())\n# b,c=int(input()),int(input())\n# c=[]\n# for i in a:\n# c.append(int(i))\nA,B= map(int,input().split())\nf = list(map(int,input().split()))\n# g = [input().split for _ in range(a)]\n# h = []\n# for i in range(a):\n# h.append(list(map(int,input().split())))\n# a = [[0] for _ in range(H)]#nizigen\nkyori=[]\nfor i in range(len(f)-1):\n an=f[i+1]-f[i]\n kyori.append(an)\n \nan2=A-f[-1]+f[0]\nans=max(max(kyori),an2)\nprint(A-ans)", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "def i_input(): return int(input())\n\n\ndef i_map(): return map(int, input().split())\n\n\ndef i_list(): return list(map(int, input().split()))\n\n\ndef i_row(N): return [int(input()) for _ in range(N)]\n\n\ndef i_row_list(N): return [list(map(int, input().split())) for _ in range(N)]\n\n\nk, n = i_map()\naa = i_list()\ndif=[]\nfor i in range(n):\n if i==n-1:\n dif.append(k-aa[-1]+aa[0])\n else:\n dif.append(aa[i+1]-aa[i])\nprint(k-max(dif))", "passed": true, "time": 0.23, "memory": 14132.0, "status": "done"}, {"code": "K,N=map(int,input().split())\nA=list(map(int,input().split()))\nB=[0]*N\nfor i in range(N-1):\n B[i]=A[i+1]-A[i]\nB[N-1]=K-A[N-1]+A[0]\nprint(K-max(B))", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "k, n = list(map(int, input().split()))\na = list(map(int, input().split()))\nmx = a[0] + k - a[n - 1]\nfor i in range(n - 1):\n mx = max(mx, a[i + 1] - a[i])\nprint((k - mx))\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "K, N = list(map(int, input().split()))\nA_list = list(map(int, input().split()))\nA_list.append(K + A_list[0])\n\ndif_list = [0] * N\n\nfor i in range(N):\n dif_list[i] = A_list[i + 1] - A_list[i]\n\nprint(K - max(dif_list))", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "k, n = map(int, input().split())\na = list(map(int,input().split()))\ntmp = 0\nansl = [] \nfor i in range(n-1):\n tmp = a[i+1] - a[i]\n ansl.append(tmp)\ntmp = k - a[-1] + a[0]\nansl.append(tmp)\nprint(k -max(ansl))", "passed": true, "time": 0.15, "memory": 14204.0, "status": "done"}, {"code": "k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nm = 0\nfor i in range(n-1):\n if a[i+1]-a[i]>m:\n m = a[i+1]-a[i]\nif k-a[n-1]+a[0]>m:\n m = k-a[n-1]+a[0]\nprint(k-m)", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nmax_d = 0\n\nfor a in range(1, N):\n d = A[a] - A[a-1]\n if d > max_d:\n max_d = d\nlast_d = K - A[-1] + A[0]\nif last_d > max_d:\n max_d = last_d\nprint(K - max_d)", "passed": true, "time": 0.27, "memory": 14096.0, "status": "done"}, {"code": "k,n = map(int, input().split())\na = list(map(int, input().split()))\n\nans = 10000000\nfor i in range(n-1):\n ans = min(k-(a[i+1]-a[i]), ans)\nans = min(ans,a[n-1]-a[0])\nprint(ans)", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "k,n = map(int,input().split())\nL = list(map(int,input().split()))\nL.append(k+L[0])\nm = 0\n\nfor i in range(n):\n m = max(m, L[i+1]-L[i])\n\nprint(k-m)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\na = 0\nif A[0] == 0:\n a = K - A[N - 1]\nelse:\n a = min(A[N - 1] - A[0], K - A[N - 1] + A[0])\n\n\nfor i in range(N - 1):\n b = A[i + 1] - A[i]\n a = max(a, b)\nans = K - a\nprint(ans)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "import sys\nimport math\nfrom collections import defaultdict, deque, Counter\nfrom copy import deepcopy\nfrom bisect import bisect, bisect_right, bisect_left\nfrom heapq import heapify, heappop, heappush\n \ninput = sys.stdin.readline\ndef RD(): return input().rstrip()\ndef F(): return float(input().rstrip())\ndef I(): return int(input().rstrip())\ndef MI(): return map(int, input().split())\ndef MF(): return map(float,input().split())\ndef LI(): return list(map(int, input().split()))\ndef TI(): return tuple(map(int, input().split()))\ndef LF(): return list(map(float,input().split()))\ndef Init(H, W, num): return [[num for i in range(W)] for j in range(H)]\n \n \ndef main():\n K , N = MI()\n L = LI()\n res = L[-1] - L[0]\n max_num = L[-1]\n for i in range(1, N):\n temp = L[i]\n past = L[i-1]\n past += K - temp\n res = min(res, past)\n \n print(res)\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "K, N = map(int, input().split())\nAlst = list(map(int, input().split()))\nzero = Alst[0] + K\nM = 0\nnow = Alst[0]\nfor i in Alst:\n dis = i - now\n if dis > M:\n M = dis\n now = i\n\nlast = zero - now\nif last > M:\n M = last\n\nprint(K - M)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "k,n = list(map(int,input().split()))\na = list(map(int,input().split()))\n\nroute = []\nfor i in range(n-1):\n move = a[i+1] - a[i]\n route.append(move)\n\nroute.append(k-a[-1]+a[0])\n\nprint((sum(route) - max(route)))\n", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "K, N = map(int, input().split())\nA = list(map(int, input().split()))\nd = [K+A[0]-A[-1]]+[b-a for a, b in zip(A, A[1:])]\nprint(K-max(d))", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "k,n = list(map(int,input().split()))\na = list(map(int,input().split()))\n\nb = []\nfor i in range(n-1):\n b.append(a[i+1]-a[i])\n\nb.append(k-a[-1]+a[0])\n\nprint((sum(b)-max(b)))\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "k, n = map(int, input().split())\na_list = list(map(int, input().split()))\nlongest = 0\n\nfor i in range(n-1):\n distance = a_list[i+1] - a_list[i]\n longest = max(longest, distance)\n\nprint(k-max(longest, k-a_list[n-1]+a_list[0]))", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "k,n=map(int,input().split())\nl=list(map(int,input().split()))\nl.sort()\nans=k-l[n-1]+l[0]\nfor i in range(n-1):\n if l[i+1]-l[i]>=ans:\n ans=l[i+1]-l[i]\nprint(k-ans)", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "# coding=utf-8\n\ndef __starting_point():\n K, N = map(int, input().split())\n li = list(map(int, input().split()))\n li.append(K+li[0])\n\n l = 0\n for i in range(N):\n l = max(l, abs(li[i] - li[i+1]))\n\n print(K-l)\n__starting_point()", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "k,n=map(int,input().split())\nA=list(map(int,input().split()))\na=A\nfor i in range(n):\n a.append(k+A[i])\nd=[0]*n\nfor i in range(n):\n d[i]=a[n-1+i]-a[i]\nprint(min(d))", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "k, n =map(int,input().split())\na = list(map(int,input().split()))\nlongest = k - a[-1] + a [0]\nfor i in range(len(a)-1):\n longest = max(longest,a[i+1]-a[i])\nprint(k-longest)", "passed": true, "time": 0.23, "memory": 14308.0, "status": "done"}, {"code": "K,N = list(map(int,input().split()))\ndis = list(map(int,input().split()))\ndif = []\nfor i in range(N-1):\n dif.append(int(dis[i+1]-dis[i]))\n \ndif.append(int(K-dis[N-1]+dis[0]))\nprint((K-max(dif)))\n\n", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = []\n\nfor j in range(N-1):\n B.append(A[j+1]-A[j])\n\nC = A[0]+K-A[N-1]\nB.append(C)\nB.sort()\nprint((K-B[N-1]))\n", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "k, n = map(int, input().split())\na_list = list(map(int, input().split()))\n\nlongest = 0\nfor i in range(n):\n # if i==0:\n # continue\n if i==n-1:\n longest = max(longest, k-a_list[i]+a_list[0])\n else:\n distance = a_list[i+1] - a_list[i]\n longest = max(longest, distance)\n\nprint(k-longest)", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "k, n = map(int, input().split())\n\na = list(map(int, input().split()))\n\na.append(a[0] + k)\n\nm = 0\n\nfor i in range(n):\n m = max(m, a[i + 1] - a[i])\n\nprint(k - m)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nd = []\nfor i in range(N-1):\n d.append(A[i+1] - A[i])\nd.append(A[0] + K - A[N-1])\n\nmax_d = max(d)\n\nprint(K - max_d)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "def main():\n k, n = map(int, input().split())\n a = [int(v) for v in input().split()]\n distances = []\n for i in range(1, len(a)):\n distances.append((a[i]-a[i-1]))\n distances.append((k+a[0]) - a[-1])\n maximum = max(distances)\n return k - maximum\n\ndef __starting_point():\n print(main())\n__starting_point()", "passed": true, "time": 0.15, "memory": 14328.0, "status": "done"}, {"code": "k, n = list(map(int, input().split()))\na = list(map(int, input().split()))\n\nb = []\nfor i in range(n - 1):\n b.append(a[i + 1] - a[i])\n\nb.append(k - a[-1] + a[0])\n\nprint((sum(b) - max(b)))\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "#ABC160\nK,N=map(int,input().split())\nA =list(map(int,input().split()))\na=[K-(A[N-1]-A[0])]\nfor i in range(1,N):\n a.append(abs(A[i]-A[i-1]))\nprint(K-max(a))", "passed": true, "time": 0.25, "memory": 14364.0, "status": "done"}, {"code": "K, N = list(map(int, input().split()))\nAs = list(map(int, input().split()))\n\nAs += [As[0] + K]\n\nmaxDiff = 0\nfor i in range(N):\n d = As[i+1]-As[i]\n if d > maxDiff:\n maxDiff = d\n\nprint((K-maxDiff))\n", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "k, n = map(int, input().split())\na = list(map(int, input().split()))\nroot = []\nans = 0\n\nfor i in range(0, n-1):\n x = a[i+1] - a[i]\n root.append(x)\n\ny = a[0] + k - a[n-1]\nroot.append(y)\n\nfor i in root:\n ans += i\n\nans -= max(root)\nprint(ans) ", "passed": true, "time": 0.15, "memory": 14104.0, "status": "done"}, {"code": "k, n = map(int,input().split())\na = list(map(int,input().split()))\n\nda =[-1] * n\nda[n-1] = k - a[n-1] + a[0]\nfor i in range(n-1):\n da[i] = a[i+1] - a[i]\n \nprint(sum(da)-max(da))", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "K,N = map(int,input().split())\nA = [int(i) for i in input().split()]\nL = []\nans = 0\nfor i in range(N):\n if(i == N-1):\n L.append(K-A[N-1]+A[0])\n break\n L.append(A[i+1]-A[i])\nfor i in range(N):\n ans += L[i]\nans -= max(L)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "try:\n K, N = map(int,input().split())\n A = list(map(int, input().split()))\n\n li = []\n for i in range(N - 1):\n li.append(A[i + 1] - A[i]) \n\n li.append(abs(A[0] + (K - A[-1])))\n print(sum(li) - max(li))\nexcept:\n pass", "passed": true, "time": 0.15, "memory": 14344.0, "status": "done"}, {"code": "k, n = map(int, input().split())\nalst = list(map(int, input().split()))\nalst.append(alst[0] + k)\nminus = 0\nfor i in range(n):\n minus = max(minus, alst[i + 1] - alst[i])\nprint(k - minus)", "passed": true, "time": 0.3, "memory": 14324.0, "status": "done"}, {"code": "K, N = list(map(int, input().split()))\n\nA = list(map(int, input().split()))\n\nB = []\n\nfor i in range(len(A)-1):\n B.append(A[i+1]-A[i])\n\nB.append(A[0] - A[N-1] + K)\n\nb_max = max(B)\nb_max_index = B.index(max(B))\n\n\nB.remove(b_max)\nprint((sum(B)))\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "import math\nimport decimal\ndef i_input(): return int(input())\n\n\ndef i_map(): return map(int, input().split())\n\n\ndef i_list(): return list(map(int, input().split()))\n\n\ndef i_row(N): return [int(input()) for _ in range(N)]\n\n\ndef i_row_list(N): return [list(map(int, input().split())) for _ in range(N)]\n\nk,n= i_map()\naa=i_list()\ndis=[]\nfor i in range(n):\n if i == 0:\n dis.append(k-aa[-1]+aa[0])\n else:\n dis.append(aa[i]-aa[i-1])\nprint(k-max(dis))", "passed": true, "time": 0.16, "memory": 14216.0, "status": "done"}, {"code": "import sys\n\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninl = lambda: [int(x) for x in sys.stdin.readline().split()]\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print(\"\\033[33m\", *a, \"\\033[0m\", **dict(file=sys.stderr, **kw))\n\n\ndef solve():\n k, n = inl()\n A = inl()\n dmax = A[0] + (k - A[-1])\n for i in range(1, n):\n dmax = max(dmax, A[i] - A[i - 1])\n return k - dmax\n\n\nprint(solve())\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "k, n = map(int ,input().split())\na = list(map(int,input().split()))\n\na.append(k+a[0])\n\nd = 0\nans = 0\nfor i in range(n):\n d = (a[i+1]-a[i])\n ans =max(ans,d)\n \nprint(k-ans)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "K,N=map(int,input().split())\nA=list(map(int,input().split()))\nans=K-(A[-1]-A[0])\nfor i in range(N-1):\n tmp=A[i+1]-A[i]\n ans=max(ans,tmp)\nans=K-ans\nprint(ans)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "#!/usr/local/bin/python3\n# https://atcoder.jp/contests/abc160/tasks/abc160_c\n\nK, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\ndist = []\nfor i in range(N-1):\n dist.append(A[i+1] - A[i])\ndist.append(K - A[-1] + A[0])\n\nprint((K - max(dist)))\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "k,n = map(int,input().split())\na = list(map(int,input().split()))\n\na.sort()\na.append(a[0]+k)\n\nans = 0\nfor i in range(n):\n d = a[i+1] - a[i]\n ans = max(ans,d)\n\nprint(k - ans)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "K, N = list(map(int,input().split()))\nA = list(map(int,input().split()))\n\ndif = []\n\nfor i,a in enumerate(A[:len(A)-1]):\n dif.append(A[i+1] - a)\n\ndif.append(K-A[len(A)-1] + A[0])\n\nprint((K - max(dif)))\n", "passed": true, "time": 0.2, "memory": 14108.0, "status": "done"}, {"code": "k,n=list(map(int,input().split()))\n\na=list(map(int,input().split()))\na.sort()\na.append(k+a[0])\n\nb=[0]*(n)\nfor i in range(n):\n b[i]=a[i+1]-a[i]\n\nprint((k-max(b)))\n", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "k,n = list(map(int,input().split()))\na = list(map(int,input().split()))\n\nb = []\nfor i in range(n-1):\n b.append(a[i+1]-a[i])\n\nb.append(a[0]+(k-a[-1]))\n\nprint((sum(b)-max(b)))\n", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "K,N = map(int,input().split())\nA1 = list(map(int,input().split()))\n\nD = [0] * (N)\n\nA2 = [A1[i]+K for i in range(len(A1)-1)]\nA1 = A1+A2\n\nfor i in range(N):\n D[i] = A1[i+N-1] - A1[i]\n #print(A1[i],A1[i+N-1])\nprint(min(D))", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "k,n=map(int,input().split())\na=list(map(int,input().split()))\n\nc=[]\nfor i in range(1,n):\n c.append(a[i]-a[i-1])\nc.append(k-a[-1]+a[0])\n\nprint(k-max(c))", "passed": true, "time": 0.23, "memory": 14232.0, "status": "done"}, {"code": "k, n = map(int, input().split())\nan = list(map(int, input().split()))\n\n\nclass Solution:\n def __init__(self, k, n, an):\n self.k = k\n self.n = n\n self.an = an\n\n @staticmethod\n def __append_first():\n an.append(k + an[0])\n new_an = an\n return new_an\n\n def answer(self):\n new_an = self.__append_first()\n max_length = 0\n for i in range(n):\n max_length = max(max_length, new_an[i + 1] - new_an[i])\n print(k - max_length)\n\n\nconditions = Solution(k, n, an)\nconditions.answer()", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "K,N = map(int,input().split())\nA = list(map(int,input().split()))\nsa = []\n\nfor i in range(N-1):\n sa.append(A[i+1]-A[i])\n \nsa.append((A[0]-A[N-1])%K)\n\nprint(K-max(sa))", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "k, n = list(map(int, input().split()))\na = list(map(int, input().split()))\ndis = min(abs(a[0] - a[-1]), abs(k + a[0] - a[-1]))\nfor i in range(n-1):\n dis = max(dis, abs(a[i+1] - a[i]))\nans = k - dis\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\nA2 = [K+a for a in A]\nA3 = A + A2\n\ndist = [0] * N\nfor i in range(N):\n j = i + N - 1\n dist[i] = A3[j] - A[i]\n\nprint((min(dist)))\n\n", "passed": true, "time": 0.22, "memory": 14212.0, "status": "done"}, {"code": "def resolve():\n k,n = map(int,input().split())\n a = list(map(int,input().split()))\n l = a[0]+k-a[-1]\n for i in range(1,n):\n l = max(l,a[i]-a[i-1])\n print(k-l)\nresolve()", "passed": true, "time": 0.22, "memory": 14376.0, "status": "done"}, {"code": "# import numpy as np\n# import math\n\n# from scipy.special import perm : perm(n, r, exact=True)\n# from scipy.special import comb : comb(n, r, exact=True)\n\n# import itertools\n# for v in itertools.combinations(L, n):M.append(list(v))\n\n# from numba import njit\n# @njit('f8(i8,i8,i8,i8,f8[:,:,:])', cache=True)\n\n\n\"\"\" Definitions \"\"\"\n\ndef lcm(a, b):\n return a*b//math.gcd(a, b)\n\nMOD = 10**9+7\n\n# ============================================================\nk, n = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\nm = 2*10**5\nM = [0]*n\ndist = min(A[n-1]-A[0], k-A[n-1]+A[0])\nfor i in range(n-1):\n dist = max(dist, A[i+1]-A[i])\nprint((k-dist))\n", "passed": true, "time": 0.2, "memory": 14332.0, "status": "done"}, {"code": "l,n=map(int,input().split())\na=input().split()\nfor i in range(n):\n a[i]=(int)(a[i])\n \nmin=l+a[0]-a[n-1]\nfor i in range(n-1):\n if min<a[i+1]-a[i]:\n min=a[i+1]-a[i]\nprint(l-min)", "passed": true, "time": 0.19, "memory": 14048.0, "status": "done"}, {"code": "k, n = map(int,input().split())\na = list(map(int,input().split()))\n\nda =[-1] * n\nda[n-1] = k - a[n-1] + a[0]\nfor i in range(n-1):\n da[i] = a[i+1] - a[i]\nprint(k-max(da))", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nans = 10**18\n\nfor i in range(N):\n if i == 0:\n clock_distance = A[N-1] - A[i]\n reverse_distance = K - A[i+1] + A[i]\n elif i == N-1:\n clock_distance = K - A[i] + A[i-1]\n reverse_distance = A[i] - A[0]\n else:\n clock_distance = K - A[i] + A[i+1]\n reverse_distance = K - A[i+1] + A[i]\n ans = min(clock_distance, reverse_distance, ans)\n\nprint(ans)\n\n\n\n", "passed": true, "time": 0.32, "memory": 14312.0, "status": "done"}, {"code": "f=lambda:[*map(int,input().split())]\nk,n=f()\nl=f()\nl+=[l[0]+k]\na=0\nfor i in range(n):\n a=max(a,l[i+1]-l[i])\nprint(k-a)", "passed": true, "time": 0.42, "memory": 14068.0, "status": "done"}, {"code": "k, n = map(int, input().split())\na = [int(s) for s in input().split()]\n\nd = [0] * (n + 1)\nd[0] = a[0] - 0\nfor i in range(1, n):\n d[i] = a[i] - a[i - 1]\nd[n] = k - a[n - 1] + a[0]\nprint(k - max(d))", "passed": true, "time": 0.16, "memory": 14144.0, "status": "done"}, {"code": "k, n = map(int, input().split())\na_list = list(map(int, input().split()))\nlongest = 0\nfor i in range(n):\n if i==n-1:\n longest = max(longest, k-a_list[i]+a_list[0])\n else:\n distance = a_list[i+1] - a_list[i]\n longest = max(longest, distance)\nprint(k-longest)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "k,n = map(int,input().split())\na = list(map(int,input().split()))\nd= 0\nfor i in range(n-1):\n d = max(a[i+1]-a[i],d)\nprint(min((k-d),a[-1]-a[0]))", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "k,n = map(int,input().split())\nan = list(map(int,input().split()))\nan.append(k + an[0])\nmax_length = 0\nfor i in range(n):\n max_length = max(max_length,an[i+1]-an[i])\n\nprint(k-max_length)", "passed": true, "time": 0.15, "memory": 14268.0, "status": "done"}, {"code": "K,N = map(int,input().split())\nA = list(map(int,input().split()))\n\nT = []\n\nfor i in range(1,N):\n T.append(A[i] - A[i-1])\n\nT.append(K - A[N-1] + A[0])\n\nprint(sum(T)-max(T))", "passed": true, "time": 0.23, "memory": 14112.0, "status": "done"}, {"code": "k,n=map(int,input().split())\na=list(map(int,input().split()))\n\nn=len(a)-1\ncnt=[a[n]-a[0]]\nfor i in range(n) :\n cnt.append(k-(a[i+1]-a[i]))\nans=min(cnt)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "\nk, n = map(int, input().split())\na = list(map(int, input().split()))\n\nc = a[0]\na.append(c + k)\nb = [a[i+1] - a[i] for i in range(n)]\n\nprint(k - max(b))", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nd = [0]*n\nfor i in range(n):\n if i == n-1:\n d[n-1] = (k-a[n-1]) + a[0]\n \n else :\n d[i] = a[i+1] - a[i]\n\nd.sort()\nd[n-1] = 0\n\nprint(sum(d))", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\nA3 = A + [K+a for a in A]\ndist = [A3[i+N-1] - A[i] for i in range(N)]\n\nprint((min(dist)))\n\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "k, n = list(map(int,input().split()))\na = list(map(int,input().split()))\nnew_a = sorted(a)\nnum = len(new_a) - 1\ns_a = []\nb = (k - new_a[num]) + new_a[0]\ns_a.append(b)\ncun = 0\nfor i in new_a[1::]:\n s = i - new_a[cun]\n s_a.append(s)\n cun += 1\nmax_num = max(s_a)\nprint((sum(s_a) - max_num))\n\n", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "def __starting_point():\n\n k,n = list(map(int,input().split()))\n A = list(map(int,input().split()))\n\n #\u8ddd\u96e2\u306e\u5dee\u5206\u304c\u4e00\u756a\u591a\u3044\u533a\u9593\u3092\u6c42\u3081\u308b\n sbn = -1\n for i in range(n-1):\n sbn = max(sbn,A[i+1]-A[i])\n\n #\u6700\u521d\u3068\u6700\u5f8c\u3082\u6bd4\u8f03\u3059\u308b\n tmp1 = A[0] - 0\n tmp2 = k - A[n-1]\n sbn = max(sbn,tmp1+tmp2)\n\n print((k-sbn))\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "K, N = map(int, input().split())\nA = list(map(int, input().split()))\nA.append(K+A[0])\n\nmax_dist = max([A[i+1] - A[i] for i in range(N)])\nprint(K - max_dist)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "k, n = list(map(int, input().split()))\na = [0] + list(map(int, input().split()))\n\nd_max = 0\na[0] = a[n] - k\n\nfor i in range(1, n + 1):\n d = a[i] - a[i - 1]\n d_max = max(d, d_max)\n\nprint((k - d_max))\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "k, n = map(int, input().split())\nan = [int(num) for num in input().split()]\n\ndistance =[]\nfor i in range(n-1):\n distance.append(an[i+1]-an[i])\ndistance.append(an[0]+(k-an[n-1]))\n\ndistance.sort()\nprint(k-distance[n-1])", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nB = []\nfor i in range(N-1):\n B.append(A[i+1] - A[i])\nB.append(K - A[N-1] + A[0])\nans = K - max(B)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nsub = [0] * (N - 1)\n\nfor i in range(N - 1):\n\tsub[i] = A[i + 1] - A[i]\nsub.append(A[0] + (K - A[-1]))\n\nprint(sum(sub) - max(sub))", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "k,n = map(int,input().split())\na = list(map(int,input().split()))\nans = k\nmx = k-a[-1]+a[0]\nfor i in range(n-1):\n mx = max(mx,abs(a[i]-a[i+1]))\nprint(ans-mx)", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "k,n = map(int,input().split())\na = list(map(int,input().split()))\ndd = k-a[-1]+a[0]\nd = 0\nfor i in range(n-1):\n d = max(d,a[i+1]-a[i])\nd = max(d,dd)\nprint(k-d)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "K, N = map(int, input().split(' '))\nA_ls = list(map(int, input().split(' ')))\nrst = -1\nfor i in range(N):\n l = A_ls[(i + 1) % N] - A_ls[i]\n if l < 0:\n l = K - A_ls[i] + A_ls[(i + 1) % N]\n if rst == -1:\n rst = l\n else:\n rst = max(rst, l)\nprint(K - rst)", "passed": true, "time": 0.28, "memory": 14064.0, "status": "done"}, {"code": "K,N=list(map(int,input().split()))\nA=list(map(int,input().split()))\nans=A[0]+K-A[-1]\nfor i in range(N-1):\n ans=max(ans,A[i+1]-A[i])\nprint((K-ans))\n", "passed": true, "time": 0.28, "memory": 14164.0, "status": "done"}, {"code": "k, n = list(map(int, input().split()))\ncnt = [0] * (n + 1)\ncmb = 0\na = list(map(int, input().split()))\n\nans = 10 ** 6 + 1\nfor i in range(n):\n r_idx = ((i+1)%n)\n r_ans = a[i]+(k-a[r_idx]) if a[i] < a[r_idx] else abs(a[r_idx]-a[i])\n l_idx = (i-1+n)%n\n l_ans = (k-a[i])+a[l_idx] if a[i] > a[l_idx] else a[l_idx]-a[i]\n\n ans = min([ans, r_ans, l_ans])\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "k,n=map(int,input().split());a,c=[*map(int,input().split())],[0]*n\nfor i in range(n-1):\n c[i]=a[i+1]-a[i]\nc[-1]=a[0]+k-a[-1]\nprint(k-max(c))", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "K, N = map(int, input().split())\nA = [int(i) for i in input().split()]\nA.append(A[0] + K)\nmax = 0\nfor i in range(N):\n\tif max <= (A[i+1] - A[i]):\n\t\tmax = A[i+1] - A[i]\n \nprint(K - max)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "K, N = list(map(int,input().split()))\nA = list(map(int,input().split()))\nA.sort()\nd = [A[i+1]-A[i] for i in range(N-1)]\nd.append(A[0]+K-A[-1])\nprint(K-max(d))", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "k,n=map(int,input().split());a=[*map(int,input().split())];d=[0]*n\nfor i in range(n-1):\n d[i]=a[i+1]-a[i]\nd[-1]=a[0]+k-a[-1]\nprint(k-max(d))", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "k, n = list(map(int, input().split()))\na = list(map(int, input().split()))\na1 = sorted(a)\ntemp = list()\nx = len(a)-1\nfor i in range(x):\n temp.append(a1[i+1]-a1[i])\ntemp.append(min(max(a)-min(a),k-max(a)+min(a)))\nans = k-max(temp)\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14360.0, "status": "done"}, {"code": "k, n = map(int, input().split())\na = list(map(int, input().split()))\n\nbef = a[0]\nmax_diff = 0\nfor i in range(1,n):\n diff = abs(bef - a[i])\n max_diff = max(diff, max_diff)\n bef = a[i]\n\nprint(k - max(max_diff, k - abs(a[n-1] - a[0])))", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "K, N = list(map(int, input().split()))\nA = [int(x) for x in input().split()]\n\nmx = A[0] + K - A[-1]\n\nfor i in range(len(A) - 1):\n dis = A[i + 1] - A[i]\n if dis > mx:\n mx = dis\n\nprint((K - mx))\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\n\nA = sorted(A)\nL = []\nANS = 0\n\nA_max = max(A)\n\nfor i in range(N-1):\n L.append(abs(A[i+1]-A[i]))\n \nL.append(K + A[0] - A_max)\n\nL = sorted(L)\n\n\nL.pop(-1)\n\nfor i in range(len(L)):\n ANS = ANS + L[i]\n \nprint(ANS)\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "k,n = map(int, input().split())\nA = list(map(int,input().split()))\nd = 0\n\nfor i in range(n-1) :\n d = max(d, A[i+1] - A[i])\n\nd1 = (k - A[n-1]) + A[0]\nd = max(d, d1)\nprint(k-d)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "K, N = map(int, input().split())\nA = [int(a) for a in input().split()]\nA.append(A[0] + K)\nb = []\nmax = 0\nsum = 0\nfor i in range(N):\n t = A[i+1] - A[i]\n sum += t\n if max < t:\n max = t\nsum -= max\nprint(sum)", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "K, N = map(int, input().split())\nA = list(map(int, input().split()))\n\nnums = [0] * N\nfor i in range(N - 1):\n nums[i] = A[i + 1] - A[i]\nnums[-1] = K + A[0] - A[-1]\n\nprint(sum(nums) - max(nums))\nreturn", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}]
[{"input": "20 3\n5 10 15\n", "output": "10\n"}, {"input": "20 3\n0 5 15\n", "output": "10\n"}]
4,690
There are two rectangles. The lengths of the vertical sides of the first rectangle are A, and the lengths of the horizontal sides of the first rectangle are B. The lengths of the vertical sides of the second rectangle are C, and the lengths of the horizontal sides of the second rectangle are D. Print the area of the rectangle with the larger area. If the two rectangles have equal areas, print that area. -----Constraints----- - All input values are integers. - 1≤A≤10^4 - 1≤B≤10^4 - 1≤C≤10^4 - 1≤D≤10^4 -----Input----- The input is given from Standard Input in the following format: A B C D -----Output----- Print the area of the rectangle with the larger area. If the two rectangles have equal areas, print that area. -----Sample Input----- 3 5 2 7 -----Sample Output----- 15 The first rectangle has an area of 3×5=15, and the second rectangle has an area of 2×7=14. Thus, the output should be 15, the larger area.
introductory
[{"code": "a,b,c,d=map(int, input().split()) \nprint(max(a*b,c*d))", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\n\nS1 = A * B\nS2 = C * D\n\nprint(max(S1, S2))", "passed": true, "time": 0.15, "memory": 14128.0, "status": "done"}, {"code": "a,b,c,d = map(int, input().split())\n\nprint(max(a*b, c*d))", "passed": true, "time": 0.21, "memory": 14044.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\nlist01 = [a * b, c * d]\nprint(max(list01))", "passed": true, "time": 0.24, "memory": 14324.0, "status": "done"}, {"code": "# 052\n\n# 1.\u5024\u3092\u6b63\u3057\u304f\u53d6\u5f97\na,b,c,d=(int(x) for x in input().split())\n\n# 2.\u6b63\u3057\u304f\u51e6\u7406\n\nmenseki1 = a * b\nmenseki2 = c * d\n\nif menseki1 > menseki2:\n print(menseki1)\n\nelif menseki1 < menseki2:\n print(menseki2)\n\nelse :\n print(menseki1)\n", "passed": true, "time": 0.15, "memory": 14184.0, "status": "done"}, {"code": "A,B,C,D = map(int,input().split())\n\nproduct = max(A * B,C * D)\nprint(product)", "passed": true, "time": 0.22, "memory": 14092.0, "status": "done"}, {"code": "a,b,c,d = map(int,input().split())\n\nx = a*b\ny = c*d\n\nif x>y:\n\tprint(x)\nelif y>=x:\n\tprint(y)", "passed": true, "time": 0.7, "memory": 14220.0, "status": "done"}, {"code": "A, B, C, D = map(int,input().split())\nx = A * B\ny = C * D\n\nif x > y :\n print(x)\nelse:\n print(y)", "passed": true, "time": 0.2, "memory": 14336.0, "status": "done"}, {"code": "# A - Two Rectangles\n\n# A B C D\nA, B, C, D = map(int, input().split())\n\n\nif A * B >= C * D:\n answer = A * B\nelse:\n answer = C * D\n\nprint(answer)", "passed": true, "time": 0.24, "memory": 14180.0, "status": "done"}, {"code": "a,b,c,d = map(int,input().split())\narea1 = a * b\narea2 = c * d \n\nif area1 > area2:\n print(area1)\nelse:\n print(area2)", "passed": true, "time": 0.36, "memory": 14284.0, "status": "done"}, {"code": "\na,b,c,d=list(map(int,input().split()))\n\nprint((max(a*b,c*d)))\n\n", "passed": true, "time": 0.19, "memory": 14072.0, "status": "done"}, {"code": "a,b,c,d = map(int, input().split())\nprint(max(a * b, c * d))", "passed": true, "time": 0.22, "memory": 14152.0, "status": "done"}, {"code": "a,b,c,d = map(int,input().split())\n\nprint(max(a*b,c*d))", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "A, B, C, D = map(int,input().split())\n\nif A * B == C * D:\n print(A * B)\nelse:\n print(max(A * B, C * D))", "passed": true, "time": 0.16, "memory": 14196.0, "status": "done"}, {"code": "A, B, C, D = list(map(int, input().split()))\n\nif A * B > C * D:\n print((A * B))\nelse:\n print((C * D))\n", "passed": true, "time": 0.28, "memory": 14212.0, "status": "done"}, {"code": "A, B, C, D = list(map(int, input().split()))\nprint(max(A * B, C * D))", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "a, b, c, d = list(map(int,input().split()))\n\nrectangles_1 = a * b\nrectangles_2 = c * d\n\nif rectangles_1 > rectangles_2:\n print(rectangles_1)\nelse:\n print(rectangles_2)\n", "passed": true, "time": 0.2, "memory": 14104.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\ns1 = A * B\ns2 = C * D\n\nif s1 == s2:\n print(s1)\nelif s1 > s2:\n print(s1)\nelse:\n print(s2)", "passed": true, "time": 0.21, "memory": 14156.0, "status": "done"}, {"code": "a, b, c, d = list(map(int, input().split()))\nprint((max(a * b, c * d)))\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "# \u6570\u5024\u306e\u53d6\u5f97\nA,B,C,D = map(int,input().split())\n\n# \u9762\u7a4d\u306e\u6700\u5927\u5024\u3092\u51fa\u529b\nAB = A * B\nCD = C * D\nprint(max(AB,CD))", "passed": true, "time": 0.41, "memory": 14080.0, "status": "done"}, {"code": "'''\nABC052_a A - Two Rectangles\nhttps://atcoder.jp/contests/abc052/tasks/abc052_a\n'''\n\nclass Solver:\n \"\"\" solve ABC052_a class \"\"\"\n ans = 0\n\n def __init__(self, a, b, c, d):\n self.solve(a, b, c, d)\n\n def compare(self, s1, s2):\n return s1 if s1 > s2 else s2\n\n def calc_area(self, h, w):\n return h*w\n\n def solve(self, h1, w1, h2, w2):\n s1 = self.calc_area(h1, w1)\n s2 = self.calc_area(h2, w2)\n self.ans = self.compare(s1, s2)\n\ndef input_data():\n return list(map(int, input().split()))\n\ndef main():\n a, b, c, d = input_data()\n answer = Solver(a, b, c, d).ans\n print(answer)\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\ndef main():\n a, b, c, d = list(map(int, input().split()))\n print((max(a * b, c * d)))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "a,b,c,d = map(int, input().split())\nprint(max(a*b, c*d))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "a, b, c, d = list(map(int, input().split()))\nx = a * b\ny = c * d\nif x == y:\n print(x)\nelif x > y:\n print(x)\nelif y > x:\n print(y)\n", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\n\n\n\nprint(A*B if A*B == C*D else max(A*B, C*D))", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lint_dec(): return list([int(x) - 1 for x in input().split()])\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nA, B, C, D = lint()\nprint((max(A*B, C*D)))\n", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\nif a*b - c*d >= 0:\n print(a*b)\nelse:\n print(c*d)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\n\narea = [A * B, C * D]\n\nprint(max(area))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "a,b,c,d = map(int,input().split())\n\nprint(max(a*b,c*d))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "a, b, c, d = list(map(int, input().split()))\nprint((max(a * b, c * d)))\n", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "a, b, c, d= [*map(int, input().split())]\nprint(max(a*b,c*d))", "passed": true, "time": 0.25, "memory": 14112.0, "status": "done"}, {"code": "vertical1, horizontal1, vertical2, horizontal2 = map(int, input().split())\narea1 = vertical1 * horizontal1\narea2 = vertical2 * horizontal2\nif area1 < area2:\n print(area2)\nelse:\n print(area1)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "A,B,C,D = map(int,input().split(\" \"))\nprint(max(A*B,C*D))", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "# 052a\n\ndef atc_052a(input_value: str) -> int:\n A, B, C, D = map(int, input_value.split(\" \"))\n return max(A * B, C * D)\n\ninput_value = input()\nprint(atc_052a(input_value))", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "a,b,c,d = map(int,input().split())\n\nif a*b > c*d:\n print(a*b)\n \nelif a*b < c*d:\n print(c*d)\n \nelse:\n print(a*b)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "\n\nA, B, C, D = map(int, input().split())\n\n\n\narea_ab = A * B\narea_cd = C * D\n\nif area_ab > area_cd:\n print(area_ab)\nelse:\n print(area_cd)", "passed": true, "time": 0.18, "memory": 14096.0, "status": "done"}, {"code": "# \u9762\u7a4d\u306e\u6700\u5927\u5024\u3092\u51fa\u529b\u3059\u308b\n\nA, B, C, D = list(map(int, input().split()))\n\narea = [A * B, C * D]\n\nprint((max(area)))\n", "passed": true, "time": 0.22, "memory": 14256.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\n\nobj1 = a*b\nobj2 = c*d\n\nif obj1 < obj2:\n ans = obj2\nelif obj2 < obj1:\n ans = obj1\nelse:\n ans = obj1\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "# 052a\n\ndef atc_052a(input_value: str) -> int:\n A, B, C, D = list(map(int, input_value.split(\" \")))\n return max(A * B, C * D)\n\ninput_value = input()\nprint((atc_052a(input_value)))\n", "passed": true, "time": 0.18, "memory": 14056.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\n\narea1 = A * B\narea2 = C * D\n\nif area1 > area2 or area1 == area2:\n print(area1)\nelse:\n print(area2)", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\n\nprint(max(a*b,c*d))", "passed": true, "time": 0.14, "memory": 13980.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\n\nif A * B >= C * D:\n print(A * B)\nelse:\n print(C * D)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "a,b,c,d = map(int,input().split())\nif a*b > c*d:\n print(a*b)\nelse:\n print(c*d)", "passed": true, "time": 0.28, "memory": 14116.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\nprint(max(A * B, C * D))", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "a,b,c,d=map(int,input().split())\nprint(max(a*b,c*d))", "passed": true, "time": 0.24, "memory": 14248.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\n\n\nl = list(map(int,input().split()))\n\nrecA = l[:2]\nrecB = l[2:]\n\nareaA = int(recA[0]) * int(recA[-1])\nareaB = int(recB[0]) * int(recB[-1])\n\nif(areaA > areaB):\n print(areaA)\nelif (areaB > areaA):\n print(areaB)\nelif(areaB == areaA):\n print(areaB)\n\n", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\n\n# \u4e8c\u3064\u306e\u9577\u65b9\u5f62\u304c\u3042\u308a\u307e\u3059\u3002\n# \u4e00\u3064\u76ee\u306e\u9577\u65b9\u5f62\u306f\u3001\u7e26\u306e\u8fba\u306e\u9577\u3055\u304c A\u3001\u6a2a\u306e\u8fba\u306e\u9577\u3055\u304c B\u3067\u3059\u3002\n# \u4e8c\u3064\u76ee\u306e\u9577\u65b9\u5f62\u306f\u3001\u7e26\u306e\u8fba\u306e\u9577\u3055\u304c C\u3001\u6a2a\u306e\u8fba\u306e\u9577\u3055\u304c D\u3067\u3059\u3002\n# \u3053\u306e\u4e8c\u3064\u306e\u9577\u65b9\u5f62\u306e\u3046\u3061\u3001\u9762\u7a4d\u306e\u5927\u304d\u3044\u65b9\u306e\u9762\u7a4d\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n# \u306a\u304a\u3001\u4e8c\u3064\u306e\u9577\u65b9\u5f62\u306e\u9762\u7a4d\u304c\u7b49\u3057\u3044\u6642\u306f\u3001\u305d\u306e\u9762\u7a4d\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\narea_ab = A * B\narea_cd = C * D\n\nif area_ab > area_cd:\n print(area_ab)\nelse:\n print(area_cd)", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "n = [int(x) for x in input().split()]\nprint(max(n[0]*n[1],n[2]*n[3]))", "passed": true, "time": 0.24, "memory": 14236.0, "status": "done"}, {"code": "# 052_a\nA, B, C, D = list(map(int, input().split()))\nS1=A*B\nS2=C*D\n\nif (1<=A&A<=10**4)&(1<=B&B<=10**4)&(1<=C&C<=10**4)&(1<=D&D<=10**4):\n if S1>S2:\n print(S1)\n elif S1<=S2:\n print(S2)\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "'''\n\u554f\u984c\uff1a\n \u4e8c\u3064\u306e\u9577\u65b9\u5f62\u304c\u3042\u308a\u307e\u3059\u3002\n \u4e00\u3064\u76ee\u306e\u9577\u65b9\u5f62\u306f\u3001\u7e26\u306e\u8fba\u306e\u9577\u3055\u304c A\u3001\u6a2a\u306e\u8fba\u306e\u9577\u3055\u304c B \u3067\u3059\u3002\n \u4e8c\u3064\u76ee\u306e\u9577\u65b9\u5f62\u306f\u3001\u7e26\u306e\u8fba\u306e\u9577\u3055\u304c C\u3001\u6a2a\u306e\u8fba\u306e\u9577\u3055\u304c D \u3067\u3059\u3002\n\n \u3053\u306e\u4e8c\u3064\u306e\u9577\u65b9\u5f62\u306e\u3046\u3061\u3001\u9762\u7a4d\u306e\u5927\u304d\u3044\u65b9\u306e\u9762\u7a4d\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u306a\u304a\u3001\u4e8c\u3064\u306e\u9577\u65b9\u5f62\u306e\u9762\u7a4d\u304c\u7b49\u3057\u3044\u6642\u306f\u3001\u305d\u306e\u9762\u7a4d\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n'''\n\n'''\n\u5236\u7d04\uff1a\n \u5165\u529b\u306f\u5168\u3066\u6574\u6570\u3067\u3042\u308b\n 1 \u2266 A \u2266 10000\n 1 \u2266 B \u2266 10000\n 1 \u2266 C \u2266 10000\n 1 \u2266 D \u2266 10000\n'''\n\n# \u6a19\u6e96\u5165\u529b\u304b\u3089 A, B, C, D \u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\na, b, c, d = list(map(int, input().split()))\n\nresult = [a * b, c * d] # \u7d50\u679c\u683c\u7d0d\u7528\u30ea\u30b9\u30c8\nprint((max(result)))\n", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "A,B,C,D = map(int,input().split())\nif A * B == C * D:\n print(A * B)\nelif A * B < C * D:\n print(C * D)\nelif A * B > C * D:\n print(A * B)", "passed": true, "time": 0.19, "memory": 14228.0, "status": "done"}, {"code": "vertical1, horizontal1, vertical2, horizontal2 = map(int, input().split())\nif vertical1 * horizontal1 < vertical2 * horizontal2:\n print(vertical2 * horizontal2)\nelse:\n print(vertical1 * horizontal1)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "A, B, C, D = list(map(int,input().split()))\n\nprint(max(A * B, C * D))", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "A, B, C, D = list(map(int, input().split()))\nif A * B >= C * D:\n print((A * B))\nelse:\n print((C * D))\n", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "a,b,c,d=map(int,input().split())\nprint(max(a*b,c*d))", "passed": true, "time": 0.23, "memory": 14252.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\nprint(max(A * B, C * D))", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\narea1 = a * b\narea2 = c * d\nif area1 >= area2:\n print(area1)\nelse:\n print(area2)", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\nprint(max(a*b, c*d))", "passed": true, "time": 0.26, "memory": 14152.0, "status": "done"}, {"code": "a, b, c, d = list(map(int, input().split()))\n\nrec1 = a * b\nrec2 = c * d\n\nif rec1 >= rec2:\n print(rec1)\nelse:\n print(rec2)\n", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "A, B, C, D = list(map(int,input().split()))\n\ndef answer(A: int, B: int, C: int, D: int) -> int:\n return max(A * B, C * D)\n\nprint((answer(A, B, C, D)))\n", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\n\nprint(max(A * B, C * D))", "passed": true, "time": 0.17, "memory": 14204.0, "status": "done"}, {"code": "A,B,C,D=list(map(int,input().split()))\nprint((max(A*B,C*D)))\n", "passed": true, "time": 0.17, "memory": 14084.0, "status": "done"}, {"code": "a,b,c,d=map(int,input().split())\nprint(max(a*b,c*d))", "passed": true, "time": 0.18, "memory": 14152.0, "status": "done"}, {"code": "#ABC052A\na,b,c,d = map(int,input().split())\nprint(max(a*b,c*d))", "passed": true, "time": 0.17, "memory": 14228.0, "status": "done"}, {"code": "S_list = iter(list(map(int,input().split())))\narea = list()\nfor x,y in zip(S_list ,S_list):\n area.append(x*y)\nprint(max(area))", "passed": true, "time": 0.23, "memory": 14064.0, "status": "done"}, {"code": "a,b,c,d =map(int, input().split())\nif a * b > c * d:\n print(a * b)\nelse:\n print(c * d)", "passed": true, "time": 0.22, "memory": 14092.0, "status": "done"}, {"code": "A, B, C, D=map(int,input().split())\n\nif A * B >= C * D:\n print(A * B)\nif A * B < C * D:\n print(C * D)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "# A - Two Rectangles\n# https://atcoder.jp/contests/abc052/tasks/abc052_a\n\nsquare = list(map(int, input().split()))\n\nresult = [square[0] * square[1], square[2] * square[3]]\nprint((max(result)))\n", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "a,b,c,d=map(int,input().split())\ne=[]\nf=a*b\ng=c*d\ne.append(f)\ne.append(g)\nif(f==g):\n print(f)\nelse:\n print(max(e))", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\n\nif A*B > C*D:\n print(A*B)\nelif A*B < C*D:\n print(C*D)\nelse:\n print(A * B)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\nif(a*b > c*d):\n print(a*b)\nelse:\n print(c*d)", "passed": true, "time": 0.15, "memory": 14312.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\n\nrec1 = a * b\nrec2 = c * d\n\nif rec1 == rec2:\n print(rec1)\nelse:\n print(max(rec1, rec2))", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "A,B,C,D = map(int,input().split())\n\nab = A * B\ncd = C * D\n\nif ab > cd:\n print(ab)\nelif cd > ab:\n print(cd)\nelse:\n print(ab)", "passed": true, "time": 0.16, "memory": 14164.0, "status": "done"}, {"code": "a, b, c, d = list(map(int, input().split()))\n\nprint((max(a * b, c * d)))\n", "passed": true, "time": 0.15, "memory": 14268.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\nprint(max(a*b, c*d))", "passed": true, "time": 0.15, "memory": 14044.0, "status": "done"}, {"code": "rectangle1_scale1, rectangle1_scale2, rectangle2_scale1, rectangle2_scale2 = list(map(int, input().split()))\n\nbig_rectangle_area = max(rectangle1_scale1 * rectangle1_scale2, rectangle2_scale1 * rectangle2_scale2)\n\nprint(big_rectangle_area)\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "a, b, c, d = map(int,input().split())\nprint(max(a*b, c*d))", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\nprint(A * B if A * B >= C * D else C * D)", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "a, b, c, d = (int(n) for n in input().split())\nprint(max(a * b, c * d))", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\nif a * b >= c * d:\n print(a * b)\nelse:\n print(c * d)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "#52\nA,B,C,D=map(int,input().split())\nif (A*B)>(C*D):\n print(A*B)\nelse:\n print(C*D)", "passed": true, "time": 0.23, "memory": 14200.0, "status": "done"}, {"code": "# 1\u3064\u76ee\u3000\u7e26A\u3001\u6a2aB\n# 2\u3064\u76ee\u3000\u7e26C\u3001\u6a2aD\na, b, c, d = list(map(int, input().split()))\n# \u9762\u7a4d\u304c\u5927\u304d\u3044\u65b9\u3092\u51fa\u529b\u3001\u7b49\u3057\u3044\u6642\u306f\u9762\u7a4d\u3092\u51fa\u529b\n\nif a * b >= c * d:\n print((a * b))\nelse:\n print((c * d))\n", "passed": true, "time": 0.23, "memory": 14280.0, "status": "done"}, {"code": "a,b,c,d = map(int,input().split())\n# 2\u3064\u306e\u9762\u7a4d\u3092\u30ea\u30b9\u30c8\u5316\narea = [a*b,c*d]\n# \u9762\u7a4d\u306e\u3046\u3061\u6700\u5927\u5024\u3092\u51fa\u529b\nprint(max(area))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "a,b,c,d=map(int,input().split())\nif a*b>=c*d:print(a*b)\nelse:print(c*d)", "passed": true, "time": 0.15, "memory": 14136.0, "status": "done"}, {"code": "A,B,C,D = map(int, input().split())\nprint(max(A*B, C*D))", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "a,b,c,d=map(int,input().split())\nprint(max(a*b,c*d))", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\n\nif a * b >= c * d:\n print(a * b)\nelse:\n print(c * d)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "A,B,C,D=map(int,input().split())\nprint(max(A*B,C*D))", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "a, b, c, d = list(map(int, input().split()))\nprint(max(a*b, c*d)) ", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "a, b, c, d = map(int,input().split())\nprint(max(a * b, c * d))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "val = list(map(int,input().split()))\nprint(max(val[0] * val[1], val[2] * val[3]))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "A, B, C, D = map(int,input().split())\n\nareaAB = A * B\nareaCD = C * D\n\nif areaAB == areaCD:\n result = areaAB\nelif areaAB > areaCD:\n result = areaAB\nelse:\n result = areaCD\n\nprint(result)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\nprint(max(A * B, C * D))", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "A,B,C,D = map(int,input().split())\nprint(max(A*B, C*D))", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "a,b,c,d=map(int, input().split())\n\nx=a*b\ny=c*d\n\nif x>=y:\n print(x)\nif y>x:\n print(y)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "# \u4e8c\u3064\u306e\u9577\u65b9\u5f62\u304c\u3042\u308a\u307e\u3059\u3002 \u4e00\u3064\u76ee\u306e\u9577\u65b9\u5f62\u306f\u3001\u7e26\u306e\u8fba\u306e\u9577\u3055\u304c A \u3001\u6a2a\u306e\u8fba\u306e\u9577\u3055\u304c B \u3067\u3059\u3002\n# \u4e8c\u3064\u76ee\u306e\u9577\u65b9\u5f62\u306f\u3001\u7e26\u306e\u8fba\u306e\u9577\u3055\u304c C \u3001\u6a2a\u306e\u8fba\u306e\u9577\u3055\u304c D \u3067\u3059\u3002 \u3053\u306e\u4e8c\u3064\u306e\u9577\u65b9\u5f62\u306e\u3046\u3061\u3001\u9762\u7a4d\u306e\u5927\u304d\u3044\u65b9\u306e\u9762\u7a4d\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n# \u306a\u304a\u3001\u4e8c\u3064\u306e\u9577\u65b9\u5f62\u306e\u9762\u7a4d\u304c\u7b49\u3057\u3044\u6642\u306f\u3001\u305d\u306e\u9762\u7a4d\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\nA,B,C,D = map(int,input().split())\n\nx = A * B\ny = C * D\nif x > y:\n print(x)\nelif x < y:\n print(y)\nelif x == y:\n print(x)", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "A,B,C,D = map(int, input().split())\n\narea1 = A * B\narea2 = C * D\n\nif area1 > area2:\n print(area1)\nelif area1 < area2:\n print(area2)\nelse:\n print(area1)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "a, b, c, d = map(int, input().split())\n\nprint(max(a * b, c * d))", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "A, B, C, D = map(int, input().split())\n\nX = A * B\nY = C * D\n\n\nif X > Y:\n print(X)\nelse:\n print(Y)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}]
[{"input": "3 5 2 7\n", "output": "15\n"}, {"input": "100 600 200 300\n", "output": "60000\n"}]
4,691
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A. The problem has N test cases. For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. See the Output section for the output format. -----Constraints----- - 1 \leq N \leq 10^5 - S_i is AC, WA, TLE, or RE. -----Input----- Input is given from Standard Input in the following format: N S_1 \vdots S_N -----Output----- Let C_0, C_1, C_2, and C_3 be the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. Print the following: AC x C_0 WA x C_1 TLE x C_2 RE x C_3 -----Sample Input----- 6 AC TLE AC AC WA TLE -----Sample Output----- AC x 3 WA x 1 TLE x 2 RE x 0 We have 3, 1, 2, and 0 test case(s) for which the verdict is AC, WA, TLE, and RE, respectively.
introductory
[{"code": "c = int(input())\n\nr = [\"AC\", \"WA\", \"TLE\", \"RE\"]\na = { i:0 for i in r}\n\nfor i in range(c):\n s = input()\n a [s] += 1\n\nfor rr in r:\n print(rr + \" x \" + str(a[rr]))", "passed": true, "time": 0.18, "memory": 14288.0, "status": "done"}, {"code": "n = int(input())\nl = []\nfor i in range(n):\n l.append(input().rstrip())\n \nprint('AC x ' + str(l.count('AC')))\nprint('WA x ' + str(l.count('WA')))\nprint('TLE x ' + str(l.count('TLE')))\nprint('RE x ' + str(l.count('RE')))", "passed": true, "time": 0.15, "memory": 14280.0, "status": "done"}, {"code": "n = int(input())\nl = []\nfor i in range(n):\n l.append(str(input()))\nprint((\"AC x \"+str(l.count('AC'))))\nprint((\"WA x \"+str(l.count('WA'))))\nprint((\"TLE x \"+str(l.count('TLE'))))\nprint((\"RE x \"+str(l.count('RE'))))\n", "passed": true, "time": 0.27, "memory": 14328.0, "status": "done"}, {"code": "\nn = int(input())\nAC,WA,TLE,RE = 0,0,0,0\n\nfor x in range(n):\n s = input()\n if s == 'AC':\n AC = AC + 1\n elif s == 'WA':\n WA = WA + 1\n elif s == 'TLE':\n TLE = TLE + 1\n elif s == 'RE':\n RE = RE + 1\n\nprint(('AC x ' + str(AC)))\nprint(('WA x ' + str(WA)))\nprint(('TLE x ' + str(TLE)))\nprint(('RE x ' + str(RE)))\n\n", "passed": true, "time": 0.91, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\njudge = ['AC', 'WA', 'TLE', 'RE']\ncnt = [0] * 4\nfor _ in range(n):\n s = input()\n cnt[judge.index(s)] += 1\nfor i in range(4):\n print(judge[i], \"x\", cnt[i])", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "n = int(input())\nac = wa = tle = re = 0\nfor i in range(n):\n st = input()\n if st == 'AC':\n ac += 1\n elif st == 'WA':\n wa += 1\n elif st == 'TLE':\n tle += 1\n else:\n re += 1\nprint(f'AC x {ac}\\nWA x {wa}\\nTLE x {tle}\\nRE x {re}')\n", "passed": true, "time": 1.76, "memory": 14256.0, "status": "done"}, {"code": "N = int(input())\n\nC0 = 0\nC1 = 0\nC2 = 0\nC3 = 0\n\nfor i in range(N):\n Si = input()\n if Si == 'AC':\n C0 += 1\n elif Si == 'WA':\n C1 += 1\n elif Si == 'TLE':\n C2 += 1\n elif Si == 'RE':\n C3 += 1\nprint('AC x ' + str(C0))\nprint('WA x ' + str(C1))\nprint('TLE x ' + str(C2))\nprint('RE x ' + str(C3))", "passed": true, "time": 0.36, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\n\nd = {\"AC\":0,\"WA\":0,\"TLE\":0,\"RE\":0}\nfor _ in range(N):\n d[input()]+=1\nfor i,v in d.items():\n print(f\"{i} x {v}\")", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "import sys\n\n\ninputs = []\nfor input in sys.stdin:\n inputs.append(input.replace(\"\\n\", \"\"))\n\nAC = 0\nWA = 0\nTLE = 0\nRE = 0\n\nfor index, input in enumerate(inputs, 1):\n if input == \"AC\":\n AC += 1\n if input == \"WA\":\n WA += 1\n if input == \"TLE\":\n TLE += 1\n if input == \"RE\":\n RE += 1\n\nprint((\"AC x \" + str(AC) + \"\\nWA x \" + str(WA) + \"\\nTLE x \" + str(TLE) + \"\\nRE x \" + str(RE)))\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "N = int(input())\nD = {\"AC\": 0, \"WA\": 0, \"TLE\": 0, \"RE\": 0}\nfor i in range(N):\n D[input()] += 1\nfor x, y in list(D.items()):\n print((\"{0} x {1}\".format(x, y)))\n", "passed": true, "time": 0.27, "memory": 14180.0, "status": "done"}, {"code": "N = int(input())\nAC = 0\nWA = 0\nTLE = 0\nRE = 0\nfor i in range(N):\n s = input()\n if(s=='AC'):\n AC+=1\n elif(s=='WA'):\n WA+=1\n elif(s=='TLE'):\n TLE+=1\n elif(s=='RE'):\n RE+=1\n\nprint('AC x '+str(AC))\nprint('WA x '+str(WA))\nprint('TLE x '+str(TLE))\nprint('RE x '+str(RE))", "passed": true, "time": 0.19, "memory": 14316.0, "status": "done"}, {"code": "N = int(input())\nC0 = C1 = C2 = C3 = 0\n\nfor i in range(N):\n S = str(input())\n if S == \"AC\":\n C0 += 1\n if S == \"WA\":\n C1 += 1\n if S == \"TLE\":\n C2 += 1\n if S == \"RE\":\n C3 += 1\n\nC0 = str(C0)\nC1 = str(C1)\nC2 = str(C2)\nC3 = str(C3)\n\nprint(\"AC x \" + C0)\nprint(\"WA x \" + C1)\nprint(\"TLE x \" + C2)\nprint(\"RE x \" + C3)", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "N = int(input())\nS = [input() for i in range(N)]\n\nnac = len([s for s in S if s == \"AC\"])\nnwa = len([s for s in S if s == \"WA\"])\nntle = len([s for s in S if s == \"TLE\"])\nnre = len([s for s in S if s == \"RE\"])\n\nprint((\"AC x \" + str(nac)))\nprint((\"WA x \" + str(nwa)))\nprint((\"TLE x \" + str(ntle)))\nprint((\"RE x \" + str(nre)))\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "dic = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}\nN = int(input())\nfor i in range(N):\n dic[input()] += 1\nfor i in dic:\n print(i, 'x', dic[i])", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "N = int(input())\nS = ['' for i in range(N)]\nfor i in range(N):\n S[i] = str(input())\n\nitem = [0, 0, 0, 0]\nrslt = ['AC', 'WA', 'TLE', 'RE']\nfor i in range(N):\n if S[i] == rslt[0]:\n item[0] += 1\n elif S[i] == rslt[1]:\n item[1] += 1\n elif S[i] == rslt[2]:\n item[2] += 1\n else:\n item[3] += 1\n\nfor i in range(4):\n print(rslt[i], 'x', item[i])", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "N = int(input())\nresult = [\"AC\",\"WA\",\"TLE\",\"RE\"]\nS = [input() for i in range(N)]\n\nfor i in result:\n print(i,\"x\",S.count(i))", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "n = int(input())\nd = {\"AC\": 0, \"WA\": 0, \"TLE\": 0, \"RE\": 0}\nfor i in range(n):\n s = input()\n d[s] += 1\nprint(\"AC x\", d[\"AC\"])\nprint(\"WA x\", d[\"WA\"])\nprint(\"TLE x\", d[\"TLE\"])\nprint(\"RE x\", d[\"RE\"])", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "n = int(input())\njudge_list = [input() for i in range(n)]\n\nac_n = judge_list.count('AC')\ntle_n = judge_list.count('TLE')\nwa_n = judge_list.count('WA')\nre_n = judge_list.count('RE')\n\nprint(f'AC x {ac_n}')\nprint(f'WA x {wa_n}')\nprint(f'TLE x {tle_n}')\nprint(f'RE x {re_n}')\n", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "N = int(input())\nS = [input() for i in range(N)]\n\nprint(\"AC x\",S.count(\"AC\"))\nprint(\"WA x\",S.count(\"WA\"))\nprint(\"TLE x\",S.count(\"TLE\"))\nprint(\"RE x\",S.count(\"RE\"))", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "N = int(input())\nresult = []\nfor i in range(N):\n r = input()\n result.append(r)\nAC = 0\nWA = 0\nTLE = 0\nRE = 0\nfor i in range(N):\n if result[i] == 'AC':\n AC += 1\n if result[i] == 'WA':\n WA += 1\n if result[i] == 'TLE':\n TLE += 1\n if result[i] == 'RE':\n RE += 1\nprint('AC x', AC)\nprint('WA x', WA)\nprint('TLE x', TLE)\nprint('RE x', RE)", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "import collections as cs\nc=cs.Counter([input() for i in range(int(input()))])\nprint(f'AC x {c[\"AC\"]}')\nprint(f'WA x {c[\"WA\"]}')\nprint(f'TLE x {c[\"TLE\"]}')\nprint(f'RE x {c[\"RE\"]}')", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "n = int(input())\n\nac = 0\nwa = 0\ntle = 0\nre = 0\n\nfor i in range(n):\n result = input()\n if result == \"AC\":\n ac = ac + 1\n elif result == \"WA\":\n wa = wa + 1\n elif result == \"TLE\":\n tle = tle + 1\n elif result == \"RE\":\n re = re + 1\n\nprint(\"AC x \" + str(ac))\nprint(\"WA x \" + str(wa))\nprint(\"TLE x \" + str(tle))\nprint(\"RE x \" + str(re))", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "a,w,t,r = 0,0,0,0\nfor _ in range(int(input())):\n s = input()\n if(s == \"AC\"):\n a += 1\n elif(s == \"WA\"):\n w += 1\n elif(s == \"TLE\"):\n t += 1\n else:\n r += 1\nprint(\"AC x\",a)\nprint(\"WA x\",w)\nprint(\"TLE x\",t)\nprint(\"RE x\",r)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "import collections\n\nn = int(input())\nlist = []\nfor i in range(n):\n x = input()\n list.append(x)\n \nc = collections.Counter(list)\n\nprint(\"AC x {}\".format(c['AC']))\nprint(\"WA x {}\".format(c['WA']))\nprint(\"TLE x {}\".format(c['TLE']))\nprint(\"RE x {}\".format(c['RE']))", "passed": true, "time": 0.42, "memory": 14052.0, "status": "done"}, {"code": "n = int(input())\n\ns = [input() for i in range(n)]\n\nnumAC = 0\nnumWA = 0\nnumTLE = 0\nnumRE = 0\n\nfor i in range(len(s)):\n if s[i] == \"AC\":\n numAC += 1\n elif s[i] == \"WA\":\n numWA += 1\n elif s[i] == \"TLE\":\n numTLE += 1\n elif s[i] == \"RE\":\n numRE += 1\n else:\n continue\nprint(\"AC x {}\\nWA x {}\\nTLE x {}\\nRE x {}\".format(numAC,numWA,numTLE,numRE))", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "from collections import defaultdict\nkero = ['AC', 'WA', 'TLE', 'RE']\n\ntanuki = defaultdict(int)\nn = int(input())\ns = [input() for i in range(n)]\nfor res in s:\n tanuki[res] += 1\n\nfor k in kero:\n print(f'{k} x {tanuki[k]}')", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "n = int(input())\nli = [input() for i in range(n)]\nac = 0\nwa = 0\ntle = 0\nre = 0\nfor i in li:\n if i == 'AC':\n ac += 1\n elif i == 'WA':\n wa += 1\n elif i == 'TLE':\n tle += 1\n elif i == 'RE':\n re += 1\nprint('AC x',ac)\nprint('WA x',wa)\nprint('TLE x',tle)\nprint('RE x',re)", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "N = int(input())\nS = [input() for i in range(N)]\n \nprint(\"AC x\",S.count(\"AC\"))\nprint(\"WA x\",S.count(\"WA\"))\nprint(\"TLE x\",S.count(\"TLE\"))\nprint(\"RE x\",S.count(\"RE\"))", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "def main():\n n = int(input())\n \n s = [input().rstrip('\\r') for i in range(n)]\n li = [\"AC\", \"WA\", \"TLE\", \"RE\"]\n cnt = 0\n \n for i in range(len(li)):\n for j in s:\n if li[i] == j:\n cnt += 1\n print(li[i] + \" x \" + str(cnt))\n cnt = 0\n \n \ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 14224.0, "status": "done"}, {"code": "count = int(input())\nlists = []\n\nfor i in range(count):\n new = input()\n lists.append(new)\n\nac_count = lists.count('AC')\nwa_count = lists.count('WA')\ntle_count = lists.count('TLE')\nre_count = lists.count('RE')\n\nprint((\"AC x \" + str(ac_count)))\nprint((\"WA x \" + str(wa_count)))\nprint((\"TLE x \" + str(tle_count)))\nprint((\"RE x \" + str(re_count)))\n\n", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "import collections\nN = int(input())\na = [input() for i in range(N)]\nprint(\"AC x \"+str(a.count(\"AC\")))\nprint(\"WA x \"+str(a.count(\"WA\")))\nprint(\"TLE x \"+str(a.count(\"TLE\")))\nprint(\"RE x \"+str(a.count(\"RE\")))", "passed": true, "time": 0.38, "memory": 14160.0, "status": "done"}, {"code": "n = int(input())\ns = [input() for i in range(n)]\n\nac, wa, tle, re = 0, 0, 0, 0\n\nfor s_e in s:\n if s_e == \"AC\":\n ac += 1\n elif s_e == \"WA\":\n wa += 1\n elif s_e == \"TLE\":\n tle += 1\n elif s_e == \"RE\":\n re += 1\n\nprint(f\"AC x {ac}\")\nprint(f\"WA x {wa}\")\nprint(f\"TLE x {tle}\")\nprint(f\"RE x {re}\")\n", "passed": true, "time": 0.23, "memory": 14296.0, "status": "done"}, {"code": "count = {\"AC\":0,\"WA\":0, \"TLE\":0, \"RE\":0}\nfor i in range(int(input())):\n x = str(input())\n if x in count:\n count[x] += 1\n\nprint(\"AC x \" + str(count[\"AC\"]))\nprint(\"WA x \" + str(count[\"WA\"]))\nprint(\"TLE x \" + str(count[\"TLE\"]))\nprint(\"RE x \" + str(count[\"RE\"]))", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "res = []\n\nn = int(input())\n\nfor i in range(n):\n r = input()\n res.append(r)\n\nac = res.count(\"AC\")\nwa = res.count(\"WA\")\ntle = res.count(\"TLE\")\nre = res.count(\"RE\")\n\nprint(\"AC x \"+str(ac))\nprint(\"WA x \"+str(wa))\nprint(\"TLE x \"+str(tle))\nprint(\"RE x \"+str(re))", "passed": true, "time": 0.3, "memory": 14332.0, "status": "done"}, {"code": "import collections\nn = int(input())\nres = [input() for i in range(n)]\na = collections.Counter(res)\n\nprint('{} x {}'.format('AC', a['AC']))\nprint('{} x {}'.format('WA', a['WA']))\nprint('{} x {}'.format('TLE', a['TLE']))\nprint('{} x {}'.format('RE', a['RE']))", "passed": true, "time": 0.35, "memory": 14048.0, "status": "done"}, {"code": "N=int(input())\nac=0\nwa=0\ntle=0\nre=0\nfor _ in range(N):\n s=input()\n if 'AC'==s:\n ac+=1\n elif 'WA'==s:\n wa+=1\n elif 'TLE'==s:\n tle+=1\n elif 'RE'==s:\n re+=1\nprint('AC','x',ac)\nprint('WA','x',wa)\nprint('TLE','x',tle)\nprint('RE','x',re)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "ac = 0\nwa = 0\ntle = 0\nre = 0\nfor i in range(int(input())):\n word = input()\n if word == \"AC\":\n ac += 1\n elif word == \"WA\":\n wa += 1\n elif word == \"TLE\":\n tle += 1\n elif word == \"RE\":\n re += 1\n \nprint(\"AC x \" + str(ac))\nprint(\"WA x \" + str(wa))\nprint(\"TLE x \" + str(tle))\nprint(\"RE x \" + str(re))", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "N = int(input())\nc0, c1, c2, c3 = 0, 0, 0, 0\nfor i in range(N):\n r = input()\n if r == 'AC':\n c0 += 1\n elif r == 'WA':\n c1 += 1\n elif r == 'TLE':\n c2 += 1\n else:\n c3 += 1\nprint('AC x ' + str(c0))\nprint('WA x ' + str(c1))\nprint('TLE x ' + str(c2))\nprint('RE x ' + str(c3))", "passed": true, "time": 0.25, "memory": 14188.0, "status": "done"}, {"code": "n = int(input())\ns = [input() for i in range(n)]\nresults = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}\nfor res in s:\n results[res] += 1\nfor r, num in results.items():\n print(f'{r} x {num}')", "passed": true, "time": 0.25, "memory": 14012.0, "status": "done"}, {"code": "# coding: utf-8\n# Your code here!\n\nn = int(input())\n\nac = 0\nwa = 0\ntle = 0\nre = 0\n\nfor i in range(n):\n s = input()\n if s ==\"AC\":\n ac += 1\n elif s ==\"WA\":\n wa += 1\n elif s ==\"TLE\":\n tle += 1\n elif s ==\"RE\":\n re += 1\n \nprint(\"AC x \" + str(ac))\nprint(\"WA x \" + str(wa))\nprint(\"TLE x \" + str(tle))\nprint(\"RE x \" + str(re))", "passed": true, "time": 0.16, "memory": 14260.0, "status": "done"}, {"code": "N = int(input())\nac = 0\nwa = 0\ntle = 0\nre = 0\nfor i in range(N):\n s = str(input())\n if s == 'AC':\n ac += 1\n elif s == 'WA':\n wa += 1\n elif s == 'TLE':\n tle += 1\n elif s =='RE':\n re += 1\nprint('AC x',ac)\nprint('WA x',wa)\nprint('TLE x',tle)\nprint('RE x',re)", "passed": true, "time": 0.22, "memory": 14344.0, "status": "done"}, {"code": "N = int(input())\nD = {\"AC\": 0, \"WA\": 0, \"TLE\": 0, \"RE\": 0}\nfor i in range(N):\n D[input()] += 1\nfor x, y in list(D.items()):\n print((\"{0} x {1}\".format(x, y)))\n\n", "passed": true, "time": 0.3, "memory": 14212.0, "status": "done"}, {"code": "n=int(input())\nacc=0\nwac=0\ntlec=0\nrec=0\nfor i in range(n):\n s = input()\n if(s==\"AC\"):\n acc+=1\n elif(s==\"WA\"):\n wac+=1\n elif(s==\"TLE\"):\n tlec+=1\n elif(s==\"RE\"):\n rec+=1\nprint(\"AC x %d\" %(acc))\nprint(\"WA x %d\" %(wac))\nprint(\"TLE x %d\" %(tlec))\nprint(\"RE x %d\" %(rec))", "passed": true, "time": 0.22, "memory": 14208.0, "status": "done"}, {"code": "N = int(input())\nD = {\"AC\":0,\"WA\":0,\"TLE\":0,\"RE\":0}\nfor i in range(N):\n D[input()]+=1\nfor x,y in D.items():\n print(\"{0} x {1}\".format(x,y) )", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "N=int(input())\n\nitem={\"AC\":0,\"WA\":0,\"TLE\":0,\"RE\":0}\n\nfor n in range(N):\n S=input()\n\n if S==\"AC\":\n item[\"AC\"]+=1\n elif S==\"WA\":\n item[\"WA\"]+=1\n elif S==\"TLE\":\n item[\"TLE\"]+=1\n else:\n item[\"RE\"]+=1\n\nprint(\"AC x\",end=\" \")\nprint(item[\"AC\"])\n\nprint(\"WA x\",end=\" \")\nprint(item[\"WA\"])\n\nprint(\"TLE x\",end=\" \")\nprint(item[\"TLE\"])\n\nprint(\"RE x\",end=\" \")\nprint(item[\"RE\"])\n", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "N = int(input())\nstring = [\"AC\", \"WA\", \"TLE\", \"RE\"]\ncount = [0] * 4\nfor i in range(N):\n s = input()\n if s == \"AC\":\n count[0] = count[0] + 1\n elif s == \"WA\":\n count[1] = count[1] + 1\n elif s == \"TLE\":\n count[2] = count[2] + 1\n else:\n count[3] = count[3] + 1\nfor j in range(len(count)):\n print(string[j] + \" x \" + str(count[j]))", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "n = int(input())\nac=0\nwa=0\ntle=0\nre=0\nfor i in range(n):\n s=input()\n if(s == 'AC'):\n ac += 1\n elif(s == 'WA'):\n wa += 1\n elif(s == 'TLE'):\n tle += 1\n else:\n re += 1\nprint('AC x {}'.format(ac))\nprint('WA x {}'.format(wa))\nprint('TLE x {}'.format(tle))\nprint('RE x {}'.format(re))", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "n=int(input())\na=[0]*4\nb=[\"AC\",\"WA\",\"TLE\",\"RE\"]\nfor i in range(n):\n s=input()\n for j in range(4):\n if s == b[j]:\n a[j]+=1\nfor i in range(4):\n print(b[i]+\" x \"+str(a[i]))", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "N = int(input())\nj = [input() for i in range(N)]\nimport collections\nc = collections.Counter(j)\ncs = c['AC']\nca = c['WA']\ncb = c['TLE']\ncc = c['RE']\nprint(f'AC x {cs}')\nprint(f'WA x {ca}')\nprint(f'TLE x {cb}')\nprint(f'RE x {cc}')\n", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "n = int(input())\ns = [input() for _ in range(n)]\nac = s.count(\"AC\")\nwa = s.count(\"WA\")\ntle = s.count(\"TLE\")\nre = s.count(\"RE\")\n\nprint(f\"AC x {ac}\")\nprint(f\"WA x {wa}\")\nprint(f\"TLE x {tle}\")\nprint(f\"RE x {re}\")", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "n = int(input())\nac, wa, tle, re = 0, 0, 0, 0;\n\nfor i in range(n):\n s = input()\n if s == 'AC':\n ac += 1\n elif s == 'WA':\n wa += 1\n elif s == 'TLE':\n tle += 1\n else:\n re += 1\n\nprint('AC', 'x', ac)\nprint('WA', 'x', wa)\nprint('TLE', 'x', tle)\nprint('RE', 'x', re)", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "\nn = int(input())\nres = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}\n\nfor i in range(n):\n res[input()] +=1\n\nfor k in res:\n print(('{} x {}'.format(k, res[k])))\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\nac = 0\nwa = 0\ntle = 0\nre = 0\nfor i in range(n):\n s = input()\n if s == \"AC\":\n ac += 1\n elif s == \"WA\":\n wa += 1\n elif s == \"TLE\":\n tle += 1\n else:\n re += 1\nprint(\"AC\",\"x\",ac)\nprint(\"WA\",\"x\",wa)\nprint(\"TLE\",\"x\",tle)\nprint(\"RE\",\"x\",re)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n = int(input())\n\nac = 0\nwa = 0\ntle = 0\nre = 0\n\nfor i in range(n):\n s = input()\n if s == \"AC\":\n ac += 1\n elif s == \"WA\":\n wa += 1\n elif s == \"TLE\":\n tle += 1\n elif s == \"RE\":\n re += 1\n\nprint((\"AC x {}\".format(str(ac))))\nprint((\"WA x {}\".format(str(wa))))\nprint((\"TLE x {}\".format(str(tle))))\nprint((\"RE x {}\".format(str(re))))\n\n", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "N = int(input())\n\nS = []\n\nc0 = 0\nc1 = 0\nc2 = 0\nc3 = 0\n \nfor i in range(N):\n S.append(input())\n \n if S[i] == \"AC\" :\n c0 += 1\n elif S[i] == \"WA\" :\n c1 += 1\n elif S[i] == \"TLE\" :\n c2 += 1\n elif S[i] == \"RE\" :\n c3 += 1\n \nprint(\"AC x \" + str(c0))\nprint(\"WA x \" + str(c1))\nprint(\"TLE x \" + str(c2))\nprint(\"RE x \" + str(c3))", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "N = int(input().split()[0])\na = [0,0,0,0]\nfor i in range(N):\n b=input().split()[0]\n if(b == 'AC'):\n a[0]+=1\n elif(b == 'WA'):\n a[1]+=1\n elif(b == 'TLE'):\n a[2]+=1\n elif(b == 'RE'):\n a[3]+=1\nprint((\"AC x {0}\\nWA x {1}\\nTLE x {2}\\nRE x {3}\".format(a[0],a[1],a[2],a[3])))\n", "passed": true, "time": 0.96, "memory": 14220.0, "status": "done"}, {"code": "n = int(input())\nresult_dict = {'AC':0,'WA':0,'TLE':0,'RE':0}\nfor i in range(n):\n s = input()\n result_dict[s] += 1\n \nprint('AC'+' x '+str(result_dict['AC']))\nprint('WA'+' x '+str(result_dict['WA']))\nprint('TLE'+' x '+str(result_dict['TLE']))\nprint('RE'+' x '+str(result_dict['RE']))", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "N = int(input())\nAC = 0\nWA = 0\nTLE = 0\nRE = 0\nfor i in range(N):\n value = str(input())\n if value == 'AC':\n AC += 1\n elif value == 'WA':\n WA += 1\n elif value == 'TLE':\n TLE += 1\n else:\n RE += 1\nprint(('AC x ' + str(AC)))\nprint(('WA x ' + str(WA)))\nprint(('TLE x ' + str(TLE)))\nprint(('RE x ' + str(RE)))\n", "passed": true, "time": 0.2, "memory": 14388.0, "status": "done"}, {"code": "N = int(input())\ndic = {\"AC\": 0, \"WA\": 0, \"TLE\": 0, \"RE\": 0} # \u30ad\u30fc\u3068\u521d\u671f\u5024\u3092\u8a2d\u5b9a\n\nfor i in range(N):\n S = input()\n if S == \"AC\":\n dic[\"AC\"] += 1\n elif S == \"WA\":\n dic[\"WA\"] += 1\n elif S == \"TLE\":\n dic[\"TLE\"] += 1\n else:\n dic[\"RE\"] += 1\n\nfor key in list(dic.keys()):\n print((\"{0} x {1}\".format(key, dic[key])))\n\n", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "N = int(input())\nC = 0\nD = 0\nE = 0\nF = 0\nS = ''\n\nfor i in range(N):\n S = input()\n if S == 'AC':\n C += 1\n elif S == 'WA':\n D += 1\n elif S == 'TLE':\n E += 1\n elif S == 'RE':\n F += 1\nprint('AC x '+ str(C), 'WA x ' + str(D), 'TLE x ' + str(E), 'RE x ' + str(F), sep='\\n')\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "n=int(input())\na,w,t,r=0,0,0,0\nfor i in range(n):\n g=input()\n if g=='AC':\n a+=1\n if g=='WA':\n w+=1\n if g=='TLE':\n t+=1\n if g=='RE':\n r+=1\nprint('AC x ' + str(a))\nprint('WA x ' + str(w))\nprint('TLE x ' + str(t))\nprint('RE x ' + str(r))", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n=int(input())\nd={\n 'AC':0,\n 'WA':0,\n 'TLE':0,\n 'RE':0\n}\n\nfor i in range(n):\n d[input()]+=1\n\nfor k,v in d.items():\n print(k,'x', v)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "N = int(input())\n\nS = [input() for i in range(N)]\n\nc0 = (S.count(\"AC\"))\nc1 = (S.count(\"WA\"))\nc2 = (S.count(\"TLE\"))\nc3 = (S.count(\"RE\"))\n\nprint(\"AC x \" + str(c0))\nprint(\"WA x \" + str(c1))\nprint(\"TLE x \" + str(c2))\nprint(\"RE x \" + str(c3))", "passed": true, "time": 0.25, "memory": 14208.0, "status": "done"}, {"code": "n=int(input())\na=[input() for i in range(n)]\n\nfor i in ['AC','WA','TLE','RE']:\n print(f'{i} x {a.count(i)}')", "passed": true, "time": 0.15, "memory": 14060.0, "status": "done"}, {"code": "N = int(input())\nAC = 0\nWA = 0\nTLE = 0\nRE = 0\n\nfor i in range(N):\n S = input()\n if S == \"AC\":\n AC += 1\n elif S == \"WA\":\n WA += 1\n elif S == \"TLE\":\n TLE += 1\n else:\n RE += 1\n \n \nprint(\"AC x\",AC)\nprint(\"WA x\",WA)\nprint(\"TLE x\",TLE)\nprint(\"RE x\",RE)", "passed": true, "time": 0.15, "memory": 14328.0, "status": "done"}, {"code": "n = int(input())\ns = [input().split() for i in range(n)]\na = 0\nb = 0\nc = 0\nd = 0\nfor i in range(n):\n if s[i][0] == 'AC':\n a += 1\n elif s[i][0] == 'WA':\n b += 1\n elif s[i][0] == 'TLE':\n c += 1\n else:\n d += 1\nprint('AC x '+str(a))\nprint('WA x '+str(b))\nprint('TLE x '+ str(c))\nprint('RE x '+str(d))", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "from collections import Counter\nfrom typing import List\n\n\ndef answer(n: int, s: List[str]) -> List[str]:\n result = []\n judges = ['AC', 'WA', 'TLE', 'RE']\n aggregate = {i: 0 for i in judges}\n counter = Counter(s)\n\n for i in counter:\n aggregate[i] += counter[i]\n for j in aggregate:\n result.append(f'{j} x {aggregate[j]}')\n\n return result\n\n\ndef main():\n n = int(input())\n s = [input() for _ in range(n)]\n for i in answer(n, s):\n print(i)\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.16, "memory": 15392.0, "status": "done"}, {"code": "N = int(input())\nS_list = [input() for i in range(N)]\n\nac = S_list.count(\"AC\")\nwa = S_list.count(\"WA\")\ntle = S_list.count(\"TLE\")\nre = S_list.count(\"RE\")\n\nprint(f'AC x {ac}')\nprint(f'WA x {wa}')\nprint(f'TLE x {tle}')\nprint(f'RE x {re}')", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n = int(input())\ns = []\nfor i in range(n):\n s.append(input())\nac = s.count(\"AC\")\nwa = s.count(\"WA\")\ntle = s.count(\"TLE\")\nre = s.count(\"RE\")\n\nprint(\"AC x\", ac)\nprint(\"WA x\", wa)\nprint(\"TLE x\", tle)\nprint(\"RE x\", re)", "passed": true, "time": 0.15, "memory": 14204.0, "status": "done"}, {"code": "N = int(input())\n\ndata = [input() for _ in range(N)]\n\ndef f(s):\n c = len([x for x in data if x in s])\n print(f\"{s} x {c}\")\n \nf(\"AC\")\nf(\"WA\")\nf(\"TLE\")\nf(\"RE\")\n", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "n = int(input())\nAC = 0\nWA = 0\nTLE = 0\nRE = 0\nfor i in range(n):\n s = input()\n if(s == \"AC\"):\n AC += 1\n elif(s == \"WA\"):\n WA += 1\n elif(s == \"TLE\"):\n TLE += 1\n else:\n RE += 1\nprint(('AC x {}'.format(AC)))\nprint(('WA x {}'.format(WA)))\nprint(('TLE x {}'.format(TLE)))\nprint(('RE x {}'.format(RE)))\n", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "N = int(input())\nC = 0\nD = 0\nE = 0\nF = 0\nS = ''\n\nfor i in range(N):\n S = input()\n if S == 'AC':\n C += 1\n elif S == 'WA':\n D += 1\n elif S == 'TLE':\n E += 1\n elif S == 'RE':\n F += 1\nprint('AC x '+ str(C), 'WA x ' + str(D), 'TLE x ' + str(E), 'RE x ' + str(F), sep='\\n')\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "N=int(input())\nS=[]\nAC=0\nTLE=0\nWA=0\nRE=0\n\nfor i in range(0,N):\n\tS.append(input())\n\tif S[i]=='AC':\n\t\tAC+=1\n\telif S[i]=='TLE':\n\t\tTLE+=1\n\telif S[i]=='WA':\n\t\tWA+=1\n\telif S[i]=='RE':\n\t\tRE+=1\n\nprint('AC x %d'%AC)\nprint('WA x %d'%WA)\nprint('TLE x %d'%TLE)\nprint('RE x %d'%RE)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "N = int(input())\nS = []\nfor _ in range(N):\n S.append(input())\n\nAC = 0\nWA = 0\nTLE = 0\nRE = 0\n\nfor s in S:\n if(s == \"AC\"):\n AC += 1\n elif(s == \"WA\"):\n WA += 1\n elif(s == \"TLE\"):\n TLE += 1\n elif(s == \"RE\"):\n RE += 1\n\nprint(f\"AC x {AC}\")\nprint(f\"WA x {WA}\")\nprint(f\"TLE x {TLE}\")\nprint(f\"RE x {RE}\")\n", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "n=int(input())\ns=[input() for i in range(n)]\nprint(\"AC x \"+str(s.count(\"AC\")))\nprint(\"WA x \"+str(s.count(\"WA\")))\nprint(\"TLE x \"+str(s.count(\"TLE\")))\nprint(\"RE x \"+str(s.count(\"RE\")))", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "N = int(input())\nS = [input() for i in range(N)]\nA = 0\nW = 0\nT = 0 \nR = 0\n\nfor i in range(len(S)):\n if S[i] == 'AC':\n A += 1\n elif S[i] == 'WA':\n W += 1\n elif S[i] == 'TLE':\n T += 1\n else:\n R += 1\n\nprint('AC x ' + str(A))\nprint('WA x ' + str(W))\nprint('TLE x ' + str(T))\nprint('RE x ' + str(R))", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "N = int(input())\njudge = {\"AC\":0, \"WA\":0, \"TLE\":0, \"RE\":0}\n \nfor _ in range(N):\n j_input = input()\n for j in judge.keys():\n if j_input == j:\n judge[j] += 1\n \nfor j in judge.keys():\n print(j , end = \" x \")\n print(judge[j])", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "def main():\n N = int(input())\n result = {\"AC\": 0, \"WA\": 0, \"TLE\": 0, \"RE\":0}\n\n for i in range(N):\n result[input()] += 1\n\n print(( \"AC x \" + str(result[\"AC\"]) ))\n print((\"WA x \" + str(result[\"WA\"])))\n print((\"TLE x \" + str(result[\"TLE\"])))\n print((\"RE x \" + str(result[\"RE\"])))\n\nmain()\n", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "# list\u3058\u3083\u306a\u304f\u3066dict\u4f7f\u3044\u305f\u3044\nn = int(input())\nj = [0] * 4\nmoji = [\"AC\", \"WA\", \"TLE\", \"RE\"]\nfor i in range(n):\n s=input()\n if s == \"AC\":\n j[0] += 1\n elif s==\"WA\":\n j[1] += 1\n elif s==\"TLE\":\n j[2] += 1\n elif s == \"RE\":\n j[3] += 1\nfor k in range(4):\n print(f\"{moji[k]} x {j[k]}\")\n", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "N = int(input())\nac, wa, tle, re = 0, 0, 0, 0\nfor i in range(N):\n s = input()\n if s == \"AC\": ac += 1\n elif s == \"WA\": wa += 1\n elif s == \"TLE\": tle += 1\n else: re += 1\nprint(\"AC x {}\".format(ac))\nprint(\"WA x {}\".format(wa))\nprint(\"TLE x {}\".format(tle))\nprint(\"RE x {}\".format(re))", "passed": true, "time": 0.15, "memory": 14260.0, "status": "done"}, {"code": "def resolve():\n N = int(input())\n AC=0;WA=0;TLE=0;RE=0\n for i in range(N):\n S = input()\n if S==\"AC\":\n AC+=1\n elif S==\"WA\":\n WA+=1\n elif S==\"TLE\":\n TLE+=1\n elif S==\"RE\":\n RE+=1\n\n print(\"AC x \"+str(AC)) \n print(\"WA x \"+str(WA)) \n print(\"TLE x \"+str(TLE)) \n print(\"RE x \"+str(RE)) \n\nresolve()", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "N = int(input().split()[0])\na = [0,0,0,0]\nfor i in range(N):\n b=input().split()[0]\n if(b == 'AC'):\n a[0]+=1\n elif(b == 'WA'):\n a[1]+=1\n elif(b == 'TLE'):\n a[2]+=1\n elif(b == 'RE'):\n a[3]+=1\nprint((\"AC x {0}\\nWA x {1}\\nTLE x {2}\\nRE x {3}\".format(a[0],a[1],a[2],a[3])))\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "N = int(input())\nans_ac = 0\nans_wa = 0\nans_tle =0\nans_re =0\n\nfor i in range(N):\n S = input()\n if S == 'AC':\n ans_ac += 1\n elif S == 'WA':\n ans_wa += 1\n elif S == 'TLE':\n ans_tle += 1\n else:\n ans_re += 1\n\nprint('AC','x',ans_ac)\nprint('WA','x',ans_wa)\nprint('TLE','x',ans_tle)\nprint('RE','x',ans_re)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}]
[{"input": "6\nAC\nTLE\nAC\nAC\nWA\nTLE\n", "output": "AC x 3\nWA x 1\nTLE x 2\nRE x 0\n"}, {"input": "10\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\n", "output": "AC x 10\nWA x 0\nTLE x 0\nRE x 0\n"}]
4,692
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? -----Constraints----- - 1≤M≤23 - M is an integer. -----Input----- Input is given from Standard Input in the following format: M -----Output----- If we have x hours until New Year at M o'clock on 30th, December, print x. -----Sample Input----- 21 -----Sample Output----- 27 We have 27 hours until New Year at 21 o'clock on 30th, December.
introductory
[{"code": "time=int(input())\nAns=48-time\nprint(Ans)", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "#\u300012\u670830\u65e5\u306eM\u6642\u304b\u3089\u6b21\u306e\u5e74\u306b\u306a\u308b\u307e\u3067\u306f\u4f55\u6642\u9593\u304b\u3001\u6c42\u3081\u3066\u304f\u3060\u3055\u3044\u3002\n\nM = int(input())\nprint(48 - M) #30\u65e531\u65e5\u306e\u5408\u8a0848\u6642\u9593\u304b\u3089\u73fe\u5728\u306e\u6642\u523b\u3092\u5f15\u304f\u3068\u3001\u6b8b\u308a\u6642\u9593\u304c\u51fa\u305b\u308b\u3002", "passed": true, "time": 0.24, "memory": 14220.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.16, "memory": 14192.0, "status": "done"}, {"code": "m=int(input())\nprint(48-m)", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "# 12\u6708 30\u65e5\u306e M\u6642\u304b\u3089\u6b21\u306e\u5e74\u306b\u306a\u308b\u307e\u3067\u304c x\u6642\u9593\u306e\u3068\u304d\u3001x\u3092\u51fa\u529b\nM = int(input())\n\nprint(24 + (24 - M))", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "# 084a\n\nM = int(input())\n\nprint((24 + (24 - M)))\n", "passed": true, "time": 0.85, "memory": 14084.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.16, "memory": 14040.0, "status": "done"}, {"code": "N = int(input())\nprint((48 - N))\n", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\nprint(48 - n)", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "# 12\u670830\u65e5\u306e M \u6642\u304b\u3089\u6b21\u306e\u5e74\u306b\u306a\u308b\u307e\u3067\u306f\u4f55\u6642\u9593\u304b\u3001\u6c42\u3081\u3066\u304f\u3060\u3055\u3044\u3002\n\n# \u5236\u7d04\n# 1 \u2266 M \u2266 23\n# \u5165\u529b\u306f\u5168\u3066\u6574\u6570\n\n# \u6a19\u6e96\u5165\u529b\u304b\u3089 M\u306e\u5024\u3092\u53d6\u5f97\u3057\u3001\u51fa\u529b\u3059\u308b\nm = int(input())\n\n# \u6b8b\u308a\u4f55\u6642\u9593\u304b\u8a08\u7b97\u3057\u3001\u51fa\u529b\u3059\u308b\nresult = 48 - m\nprint(result)\n", "passed": true, "time": 0.15, "memory": 14192.0, "status": "done"}, {"code": "t = int(input())\nprint(24 + (24 - t))", "passed": true, "time": 0.17, "memory": 14088.0, "status": "done"}, {"code": "M = int(input())\n\nanswer = 48 - M\nprint(answer)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "m = int(input())\nprint(48-m)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "# \u5165\u529b\nM = int(input())\n\n# \u51e6\u7406\nx = 48 - M\n\n# \u51fa\u529b\nprint(x)", "passed": true, "time": 0.23, "memory": 14060.0, "status": "done"}, {"code": "# A - New Year\n\n# 12/30\u306eM\u6642\u304b\u3089\u6b21\u306e\u5e74\u306b\u306a\u308b\u306e\u306f\u4f55\u6642\u9593\u5f8c\u304b\u51fa\u529b\u3059\u308b\n\n\nM = int(input())\n\nprint(((24 - M) + 24))\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "m = int(input())\n\nprint(48 - m)", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "N = int(input())\nprint((24 - N + 24))\n", "passed": true, "time": 0.22, "memory": 14152.0, "status": "done"}, {"code": "n = int(input())\nr = 24 - n\nprint((24+r))\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "M = int(input())\n\nprint(48-M)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "M = int(input())\n\nprint(24 + ( 24 - M))", "passed": true, "time": 0.23, "memory": 14076.0, "status": "done"}, {"code": "print(48 - int(input()))", "passed": true, "time": 0.24, "memory": 14028.0, "status": "done"}, {"code": "M = int(input())\n\nanswer = 48 - M\n\nprint(answer)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "m = int(input())\nhours = 24\nprint(24-m+24)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "from datetime import datetime, date\n\ndt = datetime(date.today().year, 12, 30, int(input()), 0, 0)\ntd = abs(dt - datetime(dt.year + 1, 1, 1))\nanswer = int(td.total_seconds() / (60 * 60))\nprint(answer)", "passed": true, "time": 0.16, "memory": 16380.0, "status": "done"}, {"code": "M = int(input())\n\n# 31\u65e5\u5206\u306f+24\u300130\u65e5\u5206\u306f24-M\nprint((48 - M))\n", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "m=int(input())\nprint(48-m)", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "M=int(input())\nprint(48-M)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "a=int(input())\nprint(48-a)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "M = int(input())\n\nprint(48 - M)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.26, "memory": 14204.0, "status": "done"}, {"code": "a=int(input())\nprint((24+(24-a)))\n", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "print((48-int(input())))\n", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "m = int(input())\nprint((24 - m + 24))\n", "passed": true, "time": 0.21, "memory": 14292.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.19, "memory": 14284.0, "status": "done"}, {"code": "m = int(input())\nprint(48 - m)", "passed": true, "time": 0.2, "memory": 14264.0, "status": "done"}, {"code": "n=int(input())\n\nprint(48-n)", "passed": true, "time": 0.61, "memory": 14024.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nsys.setrecursionlimit(10**6)\n\nm = int(input())\n\nprint((24-m+24))\n", "passed": true, "time": 0.24, "memory": 14252.0, "status": "done"}, {"code": "# \u6307\u5b9a\u6642\u523b\u306e\u53d6\u5f97\nM = int(input())\n \n# 12/30\u306e\u6b8b\u308a\u6642\u9593\u306812/31\u306e24\u6642\u9593\u3092\u52a0\u7b97\u3057\u7d50\u679c\u3092\u51fa\u529b\ntotal = (24 - M) + 24\nprint(total)", "passed": true, "time": 0.19, "memory": 14208.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.22, "memory": 14280.0, "status": "done"}, {"code": "m = int(input())\n\nans = 24-m + 24\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "h = int(input())\nprint(48-h)", "passed": true, "time": 0.3, "memory": 14084.0, "status": "done"}, {"code": "print((48-int(input())))\n", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "M = int(input())\n\nprint( 24 +(24 - M))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "M = int(input())\n\nx = 24 - M\nprint(x + 24)", "passed": true, "time": 0.15, "memory": 14192.0, "status": "done"}, {"code": "# AtCoder abc084 a\n# \u30b9\u30c8\u30ec\u30c3\u30c1\u8ab2\u984c\n\n# \u5165\u529b\nm = int(input())\n\n# \u51e6\u7406(m + x = 48)\nx = 48 - m\n\n# \u51fa\u529b\nprint(x)\n", "passed": true, "time": 0.23, "memory": 14060.0, "status": "done"}, {"code": "# M\u6642\u306e\u6642\u9593\u3092\u6574\u6570\u3067\u5165\u529b\nM = int(input())\n# 12\u670830\u65e5\u306eM\u6642\u304b\u30891\u67081\u65e50\u6642\u307e\u3067\u306e\u6642\u9593\u3092\u51fa\u529b\nprint(48 - M)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "M=int(input())\n\nx=24+(24-M)\n\nprint(x)", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "# \u5165\u529b\nM = int(input())\n\n# 48\u6642\u9593\u304b\u308912\u670830\u65e5\u306eM\u6642\u3092\u3072\u304f\ntime_remaining = 48 - M\n\n# \u51fa\u529b\nprint(time_remaining)", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "print(48 - int(input()))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "M = int(input())\nprint(48-M)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "M=int(input())\nprint(48-M)", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n=int(input())\nprint(48-n)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "M = int(input())\nprint(48 - M)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "m=int(input())\nprint(24+24-m)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "M = int(input())\nprint(48 -M)", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "M = int(input())\n\nx = 24 + (24 - M)\nprint(x)", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "# A - New Year\n# https://atcoder.jp/contests/abc084/tasks/abc084_a\n\nM = int(input())\n\nprint((48 - M))\n", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "a = int(input())\nprint(48-a)", "passed": true, "time": 0.15, "memory": 14060.0, "status": "done"}, {"code": "print(48 - int(input()))", "passed": true, "time": 0.15, "memory": 14012.0, "status": "done"}, {"code": "# \u5165\u529b\nM = int(input())\n\n# \u51fa\u529b\nif 1 <= M <=23:\n print(48 - M)", "passed": true, "time": 0.15, "memory": 14292.0, "status": "done"}, {"code": "m = int(input())\n\nprint((24 - m + 24))\n", "passed": true, "time": 0.15, "memory": 14156.0, "status": "done"}, {"code": "def main():\n time=input()\n remaining_hour = 48 - int(time)\n \n print(remaining_hour)\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "a = int(input())\na = 48 - a\nprint(a)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "M = int(input())\nprint(48-M)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "m = int(input())\nprint(48-m)", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "M = int(input())\nprint(48-M)", "passed": true, "time": 0.24, "memory": 14228.0, "status": "done"}, {"code": "n = int(input())\nprint(48-n)", "passed": true, "time": 0.16, "memory": 14152.0, "status": "done"}, {"code": "m = int(input())\nprint(48-m)", "passed": true, "time": 0.14, "memory": 14020.0, "status": "done"}, {"code": "M=int(input())\n\nprint((24-M)+24)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "print(48 - int(input()))", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "m = int(input())\n\nx = 48 - m\n\nprint(x)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.23, "memory": 14044.0, "status": "done"}, {"code": "n=int(input())\nprint(48-n)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.14, "memory": 13992.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "m=int(input())\nprint(48-m)", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "n=int(input())\nprint(48-n)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "m = int(input())\nprint((48 - m))\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "print(24-int(input()) + 24)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "S = int(input())\n\nday = 24 + (24 - S)\nprint (day)", "passed": true, "time": 0.24, "memory": 14156.0, "status": "done"}, {"code": "m=int(input())\nprint(24+(24-m))", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "# 084_a\nM=int(input())\nif 1<=M and M<=23:\n result=48-M\n if result>=0:\n print(result)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "def main():\n m = int(input())\n print(48 - m)\n\n\nmain()", "passed": true, "time": 0.19, "memory": 14156.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.22, "memory": 14028.0, "status": "done"}, {"code": "a=int(input())\nprint(24+(24-a))", "passed": true, "time": 0.2, "memory": 14052.0, "status": "done"}, {"code": "# 12\u670830\u65e5\u306eM\u6642\u304b\u3089\u6b21\u306e\u5e74\u306b\u306a\u308b\u307e\u3067\u306f\u4f55\u6642\u9593\u304b\u3082\u3068\u3081\u308b\n\nM = int(input())\n\nM = (24 - M) + 24\nprint(M)", "passed": true, "time": 0.2, "memory": 14060.0, "status": "done"}, {"code": "n = int(input())\n\nprint(24 - n + 24)", "passed": true, "time": 0.21, "memory": 14152.0, "status": "done"}, {"code": "a = input()\nb = 24 - int(a)\nc = 24 + b \nprint(c)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "x = int(input())\nprint(48-x)", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "a=int(input())\nprint(48-a)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "m = int(input())\n\nprint(24+24-m)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "m = int(input())\nprint(48-m)", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "m = int(input())\nprint(24+(24-m))", "passed": true, "time": 0.14, "memory": 13976.0, "status": "done"}, {"code": "M = int(input())\n\nprint(48 - M)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "print(48-int(input()))", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n = int(input())\nprint(48-n)", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}]
[{"input": "21\n", "output": "27\n"}, {"input": "12\n", "output": "36\n"}]
4,693
You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output error instead. -----Constraints----- - A and B are integers. - 1 ≤ A, B ≤ 9 -----Input----- Input is given from Standard Input in the following format: A B -----Output----- If A + B is 10 or greater, print the string error (case-sensitive); otherwise, print the value of A + B. -----Sample Input----- 6 3 -----Sample Output----- 9
introductory
[{"code": "# A - Restricted\n# https://atcoder.jp/contests/abc063/tasks/abc063_a\n\nA, B = list(map(int, input().split()))\n\nresult = A + B\nif result >= 10:\n print('error')\nelse:\n print(result)\n", "passed": true, "time": 0.36, "memory": 14304.0, "status": "done"}, {"code": "l = input().split()\n\nans = int(l[0]) + int(l[1])\n\nif 10 <= ans:\n print('error')\nelse:\n print(ans)", "passed": true, "time": 0.43, "memory": 14028.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif a+b >= 10:\n print(\"error\")\nelse:\n print(a+b)", "passed": true, "time": 0.15, "memory": 14068.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif (a+b)<=9:\n print(a+b)\nelse:\n print(\"error\")", "passed": true, "time": 0.31, "memory": 14100.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nprint(a+b if a+b < 10 else 'error')", "passed": true, "time": 1.51, "memory": 14064.0, "status": "done"}, {"code": "def iroha():\n a, b = list(map(int, input().split()))\n \n ans = a+b\n\n print((ans if ans < 10 else \"error\"))\n\n\n\ndef __starting_point():\n iroha()\n\n\n__starting_point()", "passed": true, "time": 0.26, "memory": 14200.0, "status": "done"}, {"code": "a, b= map(int, input().split())\n\nif a+b<10:\n print(a+b)\nelse:\n print('error')", "passed": true, "time": 0.36, "memory": 14076.0, "status": "done"}, {"code": "# 063a\n\nA, B = list(map(int, input().split()))\n\nif A + B >= 10:\n print('error')\nelse:\n print((A + B))\n", "passed": true, "time": 0.25, "memory": 14280.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nif A + B < 10:\n print(A + B)\nelse:\n print('error')", "passed": true, "time": 1.61, "memory": 14104.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a+b>=10:\n print(\"error\")\nelse:\n print(a+b)", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "a, b=map(int, input().split())\nif a+b<10:\n print(a+b)\nelse:\n print(\"error\")", "passed": true, "time": 0.36, "memory": 14176.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nresult = a + b\nif result >= 10:\n print('error')\nelse:\n print(result)", "passed": true, "time": 0.26, "memory": 14060.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nanswer = a + b\nprint('error' if 10 <= answer else answer)", "passed": true, "time": 0.16, "memory": 14188.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\nif A + B >= 10:\n print('error')\nelse:\n print(A + B)", "passed": true, "time": 0.25, "memory": 14284.0, "status": "done"}, {"code": "# \u4e8c\u3064\u306e\u6574\u6570A,B\u306e\u548c 10\u4ee5\u4e0a\u306a\u3089error\u3068\u51fa\u529b\n\nA, B = map(int, input().split())\n\nif A + B < 10:\n print(A + B)\nelse:\n print('error')", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "A, B = map(int,input().split())\n\nif A + B >= 10:\n print( \"error\" )\nelse:\n print( A + B )", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nprint(a + b if a + b < 10 else \"error\")", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "a,b = map(int,input().split())\n\nprint('error' if a+b >= 10 else a+b)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "a,b= map(int,input().split())\nif a+b >= 10:\n print(\"error\")\nelse:\n print(a+b)", "passed": true, "time": 0.15, "memory": 14076.0, "status": "done"}, {"code": "A,B=list(map(int,input().split()));print((A+B if A+B<10 else \"error\"))\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nans = a + b\nif ans >= 10: print('error')\nelse: print(ans)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "a, b=map(int, input().split())\nif a+b<10:\n print(a+b)\nelse:\n print('error')", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "# \u5165\u529b \nA, B = map(int, input().split()) \n \n# \u51fa\u529b \nsum = A + B \n \nif sum >= 10: \n print('error') \nelse: \n print(sum) ", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\nif a + b >= 10:\n print(\"error\")\nelse:\n print((a + b))\n", "passed": true, "time": 0.18, "memory": 14168.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif a+b >= 10:\n print(\"error\")\nelse:\n print(a+b)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "A, B = map(int,input().split())\n\nif A + B >= 10:\n print(\"error\")\nelse:\n print(A + B)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "# \u5165\u529b\nA, B = map(int, input().split())\n\n# A+B\u304c10\u4ee5\u4e0a\u306a\u3089error\u3001\u305d\u308c\u4ee5\u5916\u306a\u3089\u7d50\u679c\u3092\u51fa\u529b\nif A + B >= 10:\n print('error')\nelse:\n print(A + B)", "passed": true, "time": 0.34, "memory": 14172.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif a + b < 10:\n print(a + b)\nelse:\n print('error')", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "S_list = list(map(int,input().split()))\n\nadd = S_list[0] + S_list[1]\nif add >= 10:\n result = \"error\"\nelse:\n result = add \nprint(result)\n", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nprint(a+b if a+b < 10 else \"error\")", "passed": true, "time": 0.21, "memory": 14196.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\ndef main():\n a, b = list(map(int, input().split()))\n print((a + b if a + b < 10 else 'error'))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.23, "memory": 14244.0, "status": "done"}, {"code": "A,B = map(int,input().split())\n\nif A + B >= 10:\n print('error')\nelse:\n print(A + B)", "passed": true, "time": 0.23, "memory": 14080.0, "status": "done"}, {"code": "a,b = map(int, input().split())\n\nif a + b >= 10:\n print(\"error\")\nelse:\n print(a + b)", "passed": true, "time": 0.22, "memory": 14204.0, "status": "done"}, {"code": "# 063_a\nA,B=map(int,input().split())\nif 1<=A and B<=9:\n if A+B>=10:\n print('error')\n else:\n print(A+B)", "passed": true, "time": 0.2, "memory": 14064.0, "status": "done"}, {"code": "A, B = list(map(int,input().split()))\nif A+B < 10:\n print(A+B)\nelse:\n print('error')", "passed": true, "time": 0.17, "memory": 14036.0, "status": "done"}, {"code": "A,B = map(int,input().split())\nprint(A+B if A+B < 10 else \"error\")", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "A,B=map(int,input().split())\nif A+B>=10 :\n print(\"error\")\nelse :\n print(A+B)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "A, B = list(map(int, input().split()))\n\nif A + B < 10:\n print((A + B))\nelse:\n print('error')\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nx = a + b\nif x < 10:\n print(x)\nelse:\n print('error')", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "import sys\n\ninput = sys.stdin.readline\n\na, b= list(map(int, input().split()))\n\nab = a+b\nif ab >= 10:\n print(\"error\")\nelse:\n print(ab)\n", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a+b >= 10:\n print(\"error\")\nelse:\n print(a+b)", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nprint(a+b if a+b <10 else \"error\")", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif a + b >= 10:\n print('error')\nelse:\n print(a+b)", "passed": true, "time": 0.15, "memory": 14072.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif a + b >= 10:\n print('error')\nelse:\n print(a+b)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "# AtCoder abc063 a\n# \u30b9\u30c8\u30ec\u30c3\u30c1\u8ab2\u984c\n\n# \u5165\u529b\na, b = list(map(int, input().split()))\n\n# \u51e6\u7406\nif (a + b) >= 10:\n print(\"error\")\nelse:\n print((a + b))\n", "passed": true, "time": 0.16, "memory": 14184.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\nINF = float('inf')\nMOD = 10**9 + 7\n#MOD = 998244353\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lintdec(): return list(map(lambda x:int(x) - 1, input().split()))\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nA, B = lint()\nprint(A + B if A + B < 10 else 'error')", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "a,b=map(int, input().split()) \nprint(\"error\" if a+b>=10 else a+b)", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "a,b = [int(x) for x in input().split()]\nif a + b >= 10:\n print(\"error\")\nelse:\n print(a+b)", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "x=sum(map(int,input().split()))\nif x>=10:\n print(\"error\")\nelse:\n print(x)\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\nif A + B < 10:\n print(A + B)\nelse:\n print('error')", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\nif A+B >= 10:\n print(\"error\")\nelse:\n print(A+B)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint(\"error\" if a + b >= 10 else a + b)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\nprint(A + B if A + B < 10 else \"error\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nif n + k < 10:\n print(n + k)\nelse:\n print(\"error\")", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "x,y=list(map(int,input().split()))\nif x+y<10:\n print((x+y))\nelse:\n print('error')\n", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "A,B = map(int,input().split())\na = A+B\nif a<10:\n print(a)\nelse:\n print(\"error\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nif A+B>=10:\n print(\"error\")\nelse:\n print(A+B)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "# \u4e8c\u3064\u306e\u6574\u6570 A, B\u304c\u5165\u529b\u3055\u308c\u307e\u3059\u3002\n# A + B \u306e\u5024\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n# \u305f\u3060\u3057\u3001\n# A + B \u304c 10 \u4ee5\u4e0a\u306e\u5834\u5408\u306f\u3001\n# \u4ee3\u308f\u308a\u306b error \u3068\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\n# \u5236\u7d04\n# A, B \u306f\u6574\u6570\u3067\u3042\u308b\u3002\n# 1 \u2266 A, B \u2266 9\n\n# \u6a19\u6e96\u5165\u529b\u304b\u3089 A, B \u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\na, b = list(map(int, input().split()))\n\n# \u8a08\u7b97\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\nresult = \"error\"\n\nif a + b < 10:\n result = a + b\n\nprint(result)\n", "passed": true, "time": 0.49, "memory": 14068.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint(a+b if a+b < 10 else \"error\")", "passed": true, "time": 0.19, "memory": 14228.0, "status": "done"}, {"code": "int_1, int_2 = map(int, input().split())\nanswer = int_1 + int_2\n\nif 10 <= answer:\n print('error')\nelse:\n print(answer)", "passed": true, "time": 0.27, "memory": 14272.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\n\nprint((a+b if a+b < 10 else 'error'))\n", "passed": true, "time": 0.22, "memory": 14184.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\nprint((\"error\" if a+b>=10 else a+b))\n", "passed": true, "time": 0.26, "memory": 14164.0, "status": "done"}, {"code": "a, b = map(int,input().split())\nprint('error') if a + b >= 10 else print(a+b)", "passed": true, "time": 0.26, "memory": 14200.0, "status": "done"}, {"code": "C=sum(map(int,input().split()))\nif C>=10:\n print(\"error\")\nelse:\n print(C)", "passed": true, "time": 0.22, "memory": 14304.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a+b>=10:\n print(\"error\")\nelse:\n print(a+b)", "passed": true, "time": 0.2, "memory": 14080.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif 10<=a+b:\n print('error')\nelse:\n print(a+b)", "passed": true, "time": 0.23, "memory": 14180.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nprint(a+b if a+b < 10 else \"error\")", "passed": true, "time": 0.16, "memory": 14076.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nprint('error' if a + b >= 10 else a + b)", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a + b >= 10:\n print('error')\nelse:\n print(a + b)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a + b >= 10:\n print('error')\nelse:\n print(a + b)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nC = A + B\nprint(C if C < 10 else \"error\")", "passed": true, "time": 0.15, "memory": 14192.0, "status": "done"}, {"code": "LI = lambda: list(map(int, input().split()))\n\nA, B = LI()\n\n\ndef main():\n ans = A + B;\n if ans >= 10:\n ans = \"error\"\n print(ans)\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nprint(A+B if A+B < 10 else 'error')", "passed": true, "time": 0.23, "memory": 14108.0, "status": "done"}, {"code": "# s=int(input())\n# b=input()\n# c=[]\n# for i in range(b):\n# c.append(a[i])\na = list(map(int,input().split()))\n#b = list(map(int,input().split()))\n\nif (a[0]+a[1])<10:\n print(a[0]+a[1])\nelse:\n print(\"error\")", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "'''\nabc063 A - Restricted\nhttps://atcoder.jp/contests/abc063/tasks/abc063_a\n'''\n\na, b = list(map(int, input().split()))\nans = a+b if a+b < 10 else 'error'\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "A,B=list(map(int,input().split()))\nif A+B>=10:\n print(\"error\")\nelse:\n print((A+B))\n", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "a,b=map(int, input().split())\n\nprint(a+b if a+b<10 else 'error')", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint(a+b if a+b<10 else 'error')", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "# A - Restricted\n\n# A+B\u306e\u5024\u3092\u51fa\u529b\u3059\u308b\n# A+B\u304c10\u4ee5\u4e0a\u306e\u5834\u5408\u306ferror\u3068\u51fa\u529b\u3059\u308b\n\n\nA,B = list(map(int,input().split()))\n\nanswer = A + B\n\nif answer < 10:\n print(answer)\nelse:\n print('error')\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "# \u5404\u6570\u5024\u306e\u53d6\u5f97\nA,B = map(int,input().split())\n\n# \u5408\u8a08\u304c10\u4ee5\u4e0a\u304b\u5224\u5b9a\u5f8c\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\ntotal = A + B\nif total < 10 :\n print(total)\nelse:\n print(\"error\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a,b=map(int,input().split())\n\nif a+b>=10:\n print('error')\n \nelse:\n print(a+b)", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a+b>9:\n print('error')\nelse:\n print(a+b)", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "# \u5165\u529b\nA, B =map(int,input().split())\n\n# \u51e6\u7406\nanswer = A + B\nif answer < 10:\n print(answer)\nelse:\n print('error')", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nprint(A+B if A+B < 10 else 'error')", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nprint(a+b if a+b < 10 else \"error\")", "passed": true, "time": 0.22, "memory": 14280.0, "status": "done"}, {"code": "#n = int(input())\na, b = list(map(int, input().split()))\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\nans = a+b\nif a+b >= 10:\n ans = 'error'\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a+b>=10:\n print(\"error\")\nelse:\n print(a+b)", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a + b >= 10:\n print('error')\nelse:\n print(a + b)", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "# \u4e8c\u3064\u306e\u6574\u6570 A , B \u304c\u5165\u529b\u3055\u308c\u307e\u3059\u3002 A + B \u306e\u5024\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n# \u305f\u3060\u3057\u3001 A + B \u304c 10 \u4ee5\u4e0a\u306e\u5834\u5408\u306f\u3001\u4ee3\u308f\u308a\u306b error \u3068\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\nA,B = map(int,input().split())\n\nif A + B <= 9:\n print(A + B)\n\nelse:\n print('error')", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a+b<10:print(a+b)\nelse:print('error')", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n \nif A + B < 10: print(A+B)\nelse: print('error')", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "# coding = SJIS\n\na, b = map(int, input().split())\n\nif a + b >= 10:\n print(\"error\")\nelse:\n print(a + b)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "a,b = map(int,input().split())\n#lis = list(map(int,input().split()))\nprint(\"error\" if a+b >= 10 else a+b)", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a+b>=10:\n print(\"error\")\nelse:\n print(a+b)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "a, b = map(int, input().split())\ns = a + b\nif s >= 10: print('error')\nelse: print(s)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "a,b=list(map(int,input().split()))\nif (a+b)<10:\n print((a+b))\nelse:\n print(\"error\")\n\n", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\nx = A + B\n\nif x >= 10:\n print(\"error\")\nelse:\n print(x)", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\n\nif 10 <= a + b:\n print(\"error\")\nelse:\n print((a + b))\n", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}]
[{"input": "6 3\n", "output": "9\n"}, {"input": "6 4\n", "output": "error\n"}]
4,694
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts. There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses. Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions. -----Constraints----- - 1 ≤ N ≤ 100 - 0 ≤ a_i ≤ 1000 - a_i is an integer. -----Input----- Input is given from Standard Input in the following format: N a_1 a_2 ... a_N -----Output----- Print the minimum distance to be traveled. -----Sample Input----- 4 2 3 7 9 -----Sample Output----- 7 The travel distance of 7 can be achieved by starting at coordinate 9 and traveling straight to coordinate 2. It is not possible to do with a travel distance of less than 7, and thus 7 is the minimum distance to be traveled.
introductory
[{"code": "N=int(input())\nA=list(map(int, input().split()))\n\nprint(max(A)-min(A))", "passed": true, "time": 0.15, "memory": 14100.0, "status": "done"}, {"code": "n = int(input())\nli = list(map(int,input().split()))\nli.sort()\nprint(li[-1]-li[0])", "passed": true, "time": 0.2, "memory": 14316.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\nprint(max(a)-min(a))", "passed": true, "time": 1.06, "memory": 14292.0, "status": "done"}, {"code": "N = int(input())\nlist = sorted(map(int,input().split()))\n\nprint(list[N-1] - list[0])", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\nprint(max(a)-min(a))", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "N = int(input())\nN_List = list(map(int,input().split()))\nprint(max(N_List)-min(N_List))", "passed": true, "time": 0.3, "memory": 14084.0, "status": "done"}, {"code": "N=input()\na=list(map(int,input().split()))\na.sort()\nprint(a[-1]-a[0])", "passed": true, "time": 0.15, "memory": 14148.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int, input().split()))\nprint(max(a)-min(a))", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nprint(max(a) - min(a))", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "N = int(input())\npoints = list(map(int, input().split()))\n\nresult = max(points) - min(points)\nprint(result)", "passed": true, "time": 0.24, "memory": 14036.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nans = max(A) - min(A)\nprint(ans)", "passed": true, "time": 0.2, "memory": 14256.0, "status": "done"}, {"code": "N = int(input())\na = sorted(set(list(map(int, input().split()))))\nprint((a[-1]- a[0]))\n\n\n\n", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "# B - Traveling AtCoDeer Problem\ndef main():\n _ = int(input())\n a = list(map(int, input().split()))\n\n print(max(a)-min(a))\n\n\n\nif __name__ == \"__main__\":\n main()", "passed": true, "time": 0.16, "memory": 14064.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\nprint(max(a)-min(a))", "passed": true, "time": 0.28, "memory": 14328.0, "status": "done"}, {"code": "input()\na = list(map(int,input().split()))\na.sort()\nprint(a[-1]-a[0])", "passed": true, "time": 0.2, "memory": 14060.0, "status": "done"}, {"code": "N = input()\nx = list(map(int,input().split()))\n\nprint(max(x) - min(x))", "passed": true, "time": 0.24, "memory": 14200.0, "status": "done"}, {"code": "#https://atcoder.jp/contests/abc064/tasks/abc064_b\nS_list = [input() for i in range(2)]\nN = map(int,S_list[0].split()) \nA_list = list(map(int,S_list[1].split()))\n\nprint(max(A_list)-min(A_list))", "passed": true, "time": 0.18, "memory": 14264.0, "status": "done"}, {"code": "n=input()\na=[int(i) for i in input().split()]\nprint(max(a)-min(a))", "passed": true, "time": 0.19, "memory": 14272.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\na.sort()\n\ndistance = 0\n\nfor i in range(N - 1):\n distance += a[i + 1] - a[i]\n\nprint(distance)", "passed": true, "time": 0.21, "memory": 14052.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nprint(max(a) - min(a))", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\na.sort()\nprint(a[n-1]-a[0])", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "N=int(input())\na=str(input())\n\ndef ans064(N:int, a:str):\n a_list=sorted(map(int,a.split()))\n return(a_list[-1]-a_list[0])\n\nprint(ans064(N,a))", "passed": true, "time": 0.14, "memory": 14368.0, "status": "done"}, {"code": "n = input()\ndata = list(map(int,input().split()))\ndata.sort(reverse = True)\nans = 0\nfor i in range(len(data) - 1):\n ans += data[i] - data[i + 1]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n = input()\nlist01 = input().split()\nlist02 = [int(a) for a in list01]\n\nprint(max(list02) - min(list02))", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\nprint((max(a)-min(a)))\n", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "N = map(int, input().split())\npoint = list(map(int,input().split()))\n\nmax = 0\nmin = 1000\n\nfor i in range(len(point)):\n if max < point[i]:\n max = point[i]\n if min > point[i]:\n min = point[i]\nprint(max - min)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\nL = list(map(int,input().split()))\nL.sort()\nprint(L[n-1]-L[0])", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "n = int(input())\narr = list(map(int, input().split()))\n\nprint(max(arr) - min(arr))", "passed": true, "time": 0.21, "memory": 14188.0, "status": "done"}, {"code": "def answer(n: int, a: []) -> int:\n return max(a) - min(a)\n\n\ndef main():\n n = int(input())\n a = list(map(int, input().split()))\n print(answer(n, a))\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "# \u30af\u30ea\u30b9\u30de\u30b9\u3082\u3042\u3068\u534a\u5e74\u3068\u306a\u308a\u3001\u30c8\u30ca\u30ab\u30a4\u306eAtCoDeer\u541b\u306f\u30d7\u30ec\u30bc\u30f3\u30c8\u3092\u914d\u308b\u8a08\u753b\u3092\u7acb\u3066\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\n# TopCoDeer\u901a\u308a\u306b\u306fN\u500b\u306e\u5bb6\u304c\u4e26\u3093\u3067\u3044\u307e\u3059\u3002i\u500b\u76ee\u306e\u5bb6\u306f\u5ea7\u6a19ai\u306b\u3042\u308a\u307e\u3059\u3002\u5f7c\u306f\u3053\u306e\u3059\u3079\u3066\u306e\u5bb6\u306b\u30d7\u30ec\u30bc\u30f3\u30c8\u3092\u914d\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\n# \u597d\u304d\u306a\u5834\u6240\u304b\u3089\u958b\u59cb\u3057\u597d\u304d\u306a\u5834\u6240\u3067\u7d42\u4e86\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u6642\u3001\u6700\u5c0f\u306e\u79fb\u52d5\u8ddd\u96e2\u3092\u6c42\u3081\u306a\u3055\u3044\u3002\n\nN = int(input())\na = list(map(int,input().split()))\n\nprint(max(a) - min(a))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\n\n# \u4e00\u756a\u96e2\u308c\u3066\u3044\u308b\u5ea7\u6a19\u306e\u5dee\nprint(max(a) - min(a))", "passed": true, "time": 0.26, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\nhouses = list(map(int, input().split()))\nprint(max(houses)-min(houses))", "passed": true, "time": 0.24, "memory": 14308.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\na.sort()\nprint(a[len(a)-1] - a[0])", "passed": true, "time": 0.26, "memory": 14028.0, "status": "done"}, {"code": "n = int(input())\ncoordinates = list(map(int, input().split()))\n\nprint((max(coordinates) - min((coordinates))))\n\n", "passed": true, "time": 0.22, "memory": 14312.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\n\nprint(max(a) - min(a))", "passed": true, "time": 0.21, "memory": 14080.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\n\ndistance = max(a)-min(a)\n\nprint(distance)", "passed": true, "time": 0.21, "memory": 14300.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nprint(max(a)-min(a))", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "\nn=input()\na=list(map(int, input().split()))\n\na1=max(a)\na2=min(a)\n\nprint((a1-a2))\n", "passed": true, "time": 0.21, "memory": 14036.0, "status": "done"}, {"code": "N=int(input())\nA=list(map(int,input().split()))\nans=max(A)-min(A)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "N = int(input())\nA = sorted(list(map(int,input().split())))\nprint(A[N-1]-A[0])", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nprint(max(a) - min(a))", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "N = input()\na = list(map(int, input().split()))\n\nprint(max(a) - min(a))", "passed": true, "time": 0.23, "memory": 14084.0, "status": "done"}, {"code": "# 064b\n\ndef atc_064b(input_value: str) -> str:\n N = input_value[0]\n ai = [int(i) for i in input_value[1].split(\" \")]\n return max(ai) - min(ai)\n\nN = input()\nai = input()\nprint(atc_064b([N, ai]))", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "N = int(input())\nS = map(int,input().split())\n\nNumber = list(S)\nNumber.sort(reverse=True)\ntotal_distance = []\n# print(Number)\n\nfor i in range(1,N):\n distance = Number[0] - Number[1]\n total_distance.append(distance)\n del Number[0]\n\nprint(sum(total_distance))", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "def abc064b(n: int, a_list: int) -> int:\n return max(a_list) - min(a_list)\n\nn = int(input())\na_list = list(map(int, input().split()))\n\nprint((abc064b(n, a_list)))\n", "passed": true, "time": 0.16, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\n# \u30ea\u30b9\u30c8\u306e\u6700\u5927\u5024\u304b\u3089\u6700\u5c0f\u5024\u3092\u5f15\u3044\u3066\u51fa\u529b\nprint((max(a)-min(a)))\n", "passed": true, "time": 0.16, "memory": 14212.0, "status": "done"}, {"code": "def main():\n N = int(input())\n a = list(map(int,input().split()))\n a.sort()\n ans = 0\n #print(a)\n for i in range(1,N,1):\n ans += a[i] - a[i-1]\n\n return ans\n\nprint((main()))\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "home_num = int(input())\nhouse_from = list(map(int,input().split()))\n\nprint(max(set(house_from)) - min(set(house_from)))", "passed": true, "time": 0.14, "memory": 14016.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\nprint(max(a)-min(a))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\n\nprint(max(a) - min(a))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "# \u6570\u5024\u306e\u53d6\u5f97\nhomecnt = int(input())\nhomeplace = list(map(int,input().split()))\n\n# \u6700\u77ed\u8ddd\u96e2\u3092\u8a08\u7b97\u3057\u51fa\u529b\ndist = max(homeplace) - min(homeplace)\nprint(dist)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\na.sort()\nprint((a[-1] - a[0]))\n", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "def atc_064b(input_value: str) -> str:\n N = input_value[0]\n ai = [int(i) for i in input_value[1].split(\" \")]\n return max(ai) - min(ai)\n\nN = input()\nai = input()\nprint((atc_064b([N, ai])))\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "n = int(input())\nx = list(map(int,input().split()))\nprint(max(x)-min(x))", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "num_house = int(input())\na = list(map(int, input().split()))\nhouse_list = list(a)\n\nprint((max(house_list) - min(house_list)))\n", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nprint(max(a)-min(a))", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\n\nprint(max(a)-min(a))", "passed": true, "time": 0.15, "memory": 14292.0, "status": "done"}, {"code": "N = int(input())\nA =list(map(int, input().split()))\n\nMAX = max(A)\nMIN = min(A)\n\nprint(MAX-MIN)", "passed": true, "time": 0.14, "memory": 14008.0, "status": "done"}, {"code": "n=input()\na=list(map(int, input().split()))\n\ndef answer(n:int, a:list)->int:\n return max(a)-min(a)\n\nprint(answer(n,a))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "total_house = int(input())\nhouse_coordinate = sorted(list(map(int, input().split())))\nprint(house_coordinate[total_house - 1]- house_coordinate[0])", "passed": true, "time": 0.22, "memory": 14184.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\n\nA.sort()\n\nprint(A[-1] - A[0] if N > 1 else 0)", "passed": true, "time": 0.24, "memory": 14060.0, "status": "done"}, {"code": "n = int(input())\na = [int(x) for x in input().split()]\nprint(max(a) - min(a))", "passed": true, "time": 0.23, "memory": 14360.0, "status": "done"}, {"code": "#ABC064B\nn = int(input())\na = sorted(list(map(int,input().split())))\nans = 0 \nfor i in range(n-1):\n ans += a[i+1]-a[i]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\nINF = float('inf')\nMOD = 10**9 + 7\n#MOD = 998244353\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lintdec(): return list(map(lambda x:int(x) - 1, input().split()))\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nN = ii()\nma = 0\nmi = INF\n\nfor a in lint():\n ma = max(ma, a)\n mi = min(mi, a)\n\nprint(ma - mi)", "passed": true, "time": 0.21, "memory": 14388.0, "status": "done"}, {"code": "n = int(input())\na = sorted(list(map(int, input().split())))\nprint(a[-1]-a[0])", "passed": true, "time": 0.23, "memory": 14144.0, "status": "done"}, {"code": "N=input()\nNi=list(map(int,input().split()))\n\nprint(max(Ni)-min(Ni))", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "a = int(input())\nlis = list(map(int,input().split()))\nprint(max(lis)-min(lis))", "passed": true, "time": 0.16, "memory": 14256.0, "status": "done"}, {"code": "N = int(input())\nhouse = list(map(int, input().split()))\n\nprint(max(house) - min(house) )", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\n\nprint(max(a) - min(a))", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "total_house = int(input())\nhouse_coordinate = sorted(list(map(int, input().split())))\nprint(house_coordinate[total_house - 1] - house_coordinate[0])", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\na.sort()\n\ndistance = 0\n\nfor i in range(N - 1):\n distance += a[i + 1] - a[i]\n\nprint(distance)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "# B - Traveling AtCoDeer Problem\n\n# N\nN = int(input())\nmy_list = list(map(int, input().split(maxsplit=N)))\n\nmy_list_sort = sorted(my_list)\nanswer = my_list_sort[-1] - my_list_sort[0]\n\nprint(answer)\n", "passed": true, "time": 0.16, "memory": 14140.0, "status": "done"}, {"code": "N = int(input())\nlst = input().split()\n\nfor i in range(N):\n lst[i] = int(lst[i])\n\nprint(max(lst) - min(lst))", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "from sys import stdin\nrs = lambda : stdin.readline().strip()\nri = lambda : int(rs())\nril = lambda : list(map(int, rs().split()))\n\ndef main():\n N = ri()\n a = ril()\n print((max(a) - min(a)))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.16, "memory": 14140.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nprint(max(a)-min(a))", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "n = input()\na = list(map(int, input().split()))\nprint(max(a) - min(a))", "passed": true, "time": 0.16, "memory": 14328.0, "status": "done"}, {"code": "import sys\n\ninput = sys.stdin.readline\nN = int(input())\nA = list(map(int, input().split()))\nA.sort()\nprint(A[N-1] - A[0])", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "N = int(input())\nhouse = list(map(int, input().split()))\n\n# \u30d7\u30ec\u30bc\u30f3\u30c8\u3092\u5c4a\u3051\u308b\u305f\u3081\u306e\u3001\u6700\u5927\u5024\u304b\u3089\u6700\u5c0f\u5024\u3092\u5f15\u3044\u3066\u3001\u6700\u5c0f\u306e\u79fb\u52d5\u8ddd\u96e2\u3092\u51fa\u529b\n\nprint(max(house)-min(house))", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "# \u6700\u5c0f\u306e\u79fb\u52d5\u8ddd\u96e2\u306f\u3001\u4e00\u756a\u7aef\u304b\u3089\u53cd\u5bfe\u5074\u307e\u3067\u4e00\u76f4\u7dda\u306b\u79fb\u52d5\u3059\u308b\u4e8b\u3002\n# \u884c\u3063\u305f\u308a\u6765\u305f\u308a\u3059\u308b\u53ef\u80fd\u6027\u306f\u306a\u3044\nn = int(input())\na = list(map(int, input().split()))\n# \u5ea7\u6a19\u306f\u6b63\u306e\u6574\u6570\u306e\u307f\u306a\u306e\u3067max-min\u3067\u8a08\u7b97\u3067\u304d\u305d\u3046\u3002\n# print(mix-min)\nprint(max(a)-min(a))", "passed": true, "time": 0.17, "memory": 14300.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nprint(max(a) - min(a))", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\na.sort()\nprint(a[-1]-a[0])", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n = int(input())\nstreet = sorted(list(map(int, input().split())))\nprint((street[-1]-street[0]))\n", "passed": true, "time": 0.23, "memory": 14272.0, "status": "done"}, {"code": "n = int(input())\na = [int(i) for i in input().split()]\n\nprint(max(a) - min(a))", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "n = int(input())\na = [int(s) for s in input().split()]\n\nprint(max(a) - min(a))", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\n\nprint(max(a) - min(a))", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "def minimum_dist(l1: list) -> int:\n return max(l1) - min(l1)\n\n\ndef __starting_point():\n n = int(input())\n list_coordinate = list(map(int, input().split()))\n print((minimum_dist(list_coordinate)))\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "N = int(input())\na = sorted([int(x) for x in input().split()])\n\nprint(max(a) - min(a))", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "N = int(input())\na = [ int(v) for v in input().split(\" \") ]\n\nmax_v = max(a)\nmin_v = min(a)\n\nprint((max_v - min_v))\n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "# list\u3092\u4e26\u3073\u66ff\u3048\u3066\u79fb\u52d5\u8ddd\u96e2\u306e\u6700\u5c0f\u5024\u3092\u6c42\u3081\u308b\n\nN = int(input())\na = list(map(int, input().split()))\n\n# \u964d\u9806\u306b\u4e26\u3073\u66ff\u3048\u308b\ndescending_a = sorted(a, reverse=True)\n# print(descending_a)\n\n# \u5ea7\u6a19\u306e\u6700\u5927\u5024\u304b\u3089\u6700\u5c0f\u5024\u3092\u5f15\u304f\u2192\u79fb\u52d5\u8ddd\u96e2\u3092\u6c42\u3081\u308b\nprint((descending_a[0] - descending_a[-1]))\n", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "input()\na = list(map(int,input().split()))\nprint(max(a)-min(a))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\nli = list(map(int, input().split()))\nprint(max(li)-min(li))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "N = input()\na = list(map(int, input().split()))\nprint(max(a)-min(a))", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nx = max(A)\ny = min(A)\nprint(x - y)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\n\nprint(max(A)-min(A))", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\na.sort()\nans = a[-1] - a[0]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "N = int(input())\nhome = list(map(int,input().split()))\n\nprint((max(home))-(min(home)))", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\na.sort()\nprint(a[N - 1] - a[0])", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}]
[{"input": "4\n2 3 7 9\n", "output": "7\n"}, {"input": "8\n3 1 4 1 5 9 2 6\n", "output": "8\n"}]
4,695
Based on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below. Given two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group. -----Constraints----- - x and y are integers. - 1 ≤ x < y ≤ 12 -----Input----- Input is given from Standard Input in the following format: x y -----Output----- If x and y belong to the same group, print Yes; otherwise, print No. -----Sample Input----- 1 3 -----Sample Output----- Yes
introductory
[{"code": "n1 = [1, 3, 5, 7, 8, 10, 12]\nn2 = [4, 6, 9, 11]\n\na, b = list(map(int, input().split()))\nprint((\"Yes\" if a in n1 and b in n1 or a in n2 and b in n2 else \"No\"))\n", "passed": true, "time": 0.15, "memory": 14144.0, "status": "done"}, {"code": "lst1 = [4,6,9,11]\nlst2 = [2]\nlst3 = [1,3,5,7,8,10,12]\nx,y = map(int,input().split())\nif x in lst1 and y in lst1:\n print('Yes')\nelif x in lst2 and y in lst2:\n print('Yes')\nelif x in lst3 and y in lst3:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.22, "memory": 14212.0, "status": "done"}, {"code": "x,y=map(int,input().split())\nA=[2]\nB=[4,6,9,11]\nC=[1,3,5,7,8,10,12]\nif x in B and y in B:\n print(\"Yes\")\nelif x in C and y in C:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "a,b,c=[1,3,5,7,8,10,12],[4,6,9,11],[2]\nprint('YNeos'[len(set([0 if i in a else [1,2][i in b] for i in list(map(int,input().split()))]))!=1::2])", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "X,Y=map(int,input().split())\nA=1,3,5,7,8,10,12\nB=4,6,9,11\nC=2\nans=\"No\"\nif X in A and Y in A:\n ans=\"Yes\"\nelif X in B and Y in B:\n ans=\"Yes\"\nelif X==Y==2:\n ans=\"Yes\"\nprint(ans)", "passed": true, "time": 0.23, "memory": 14120.0, "status": "done"}, {"code": "x,y=map(int,input().split())\ngrp1=[1,3,5,7,8,10,12]\ngrp2=[4,6,9,11]\n\nif x in grp1 and y in grp1: print(\"Yes\")\nelif x in grp2 and y in grp2: print(\"Yes\")\nelse: print(\"No\")", "passed": true, "time": 0.23, "memory": 14124.0, "status": "done"}, {"code": "a = map(int, input().split())\ninput_list = list(a)\n\ngroup_a = [1, 3, 5, 7, 8, 10, 12]\ngroup_b = [4, 6, 9, 11]\ngroup_c = [2]\nlist_of_list = [group_a, group_b, group_c]\n\ncount_match = 0\n\nfor list_i in list_of_list:\n if input_list[0] in list_i and input_list[1] in list_i:\n count_match += 1\n break\n\nif count_match == 1:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.22, "memory": 14216.0, "status": "done"}, {"code": "data_1 =[1,3,5,7,8,10,12]\ndata_2 =[4,6,9,11]\nx,y = map(int,input().split())\nif x in data_1 and y in data_1:\n print('Yes')\nelif x in data_2 and y in data_2:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.22, "memory": 14084.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nx, y = list(map(int, input().split()))\n\na = [1, 3, 5, 7, 8, 10, 12]\nb = [4, 6, 9, 11]\nc = [2]\n\nif x in a and y in a:\n print('Yes')\nelif x in b and y in b:\n print('Yes')\nelif x in c and y in c:\n print('Yes')\nelse:\n print('No')\n", "passed": true, "time": 0.23, "memory": 14308.0, "status": "done"}, {"code": "a,b = map(int,input().split())\n\nx = [1,3,5,7,8,10,12]\ny = [4,6,9,11]\n\nif a in x and b in x or a in y and b in y:\n print('Yes')\n \nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "x,y=map(int,input().split())\ns1 = [1,3,5,7,8,10,12]\ns2 = [4,6,9,11]\ns3 = [2]\nif x in s1 and y in s1:\n print('Yes')\nelif x in s2 and y in s2:\n print('Yes')\nelif x in s3 and y in s3:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.16, "memory": 14244.0, "status": "done"}, {"code": "x,y = map(int, input().split())\na = [1,3,5,7,8,10,12]\nb = [4,6,9,11]\nc = [2]\nif (x in a and y in a) or (x in b and y in b) or (x in c and y in c):\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.23, "memory": 14168.0, "status": "done"}, {"code": "x, y = map(int, input().split())\n\nA = [1, 3, 5, 7, 8, 10, 12]\nB = [4, 6, 9, 11]\nC = [2, ]\n\nif x in A and y in A:\n print('Yes')\nelif x in B and y in B:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.23, "memory": 14108.0, "status": "done"}, {"code": "x,y=map(int,input().split())\n\nn=[0,1,3,1,2,1,2,1,1,2,1,2,1]\n\nif n[x]==n[y]:\n ans=\"Yes\"\nelse:\n ans=\"No\"\n \nprint(ans)", "passed": true, "time": 0.22, "memory": 14112.0, "status": "done"}, {"code": "A=[1,3,5,7,8,10,12]\nB=[4,6,9,11]\nC=[2]\nx,y = map(int,input().split())\nif x in A and y in A:\n print('Yes') \nelif x in B and y in B:\n print('Yes')\nelse:\n print('No') ", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "x, y = map(int,input().split())\nS1 = [1, 3, 5, 7, 8, 10, 12]\nS2 = [4, 6, 9, 11]\nans = False\nfor i in range(len(S1)):\n for j in range(len(S1)):\n if S1[i] == x and S1[j] == y:\n ans = True\nfor i in range(len(S2)):\n for j in range(len(S2)):\n if S2[i] == x and S2[j] == y:\n ans = True\nif ans:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "c = [['1', '3', '5', '7', '8', '10', '12'], ['4', '6', '9', '11'], ['2']]\n\na, b = input().split(' ')\n\nif a in c[0] and b in c[0]:\n print(\"Yes\")\nelif a in c[1] and b in c[1]:\n print(\"Yes\")\nelif a in c[2] and b in c[2]:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "x, y = map(int, input().split())\ngroup1 = [1, 3, 5, 7, 8, 10, 12]\ngroup2 = [4, 6, 9, 11]\n\nflag = False\nif x in group1 and y in group1:\n flag = True\nelif x in group2 and y in group2:\n flag = True\n \nif flag:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.15, "memory": 14112.0, "status": "done"}, {"code": "x, y = list(map(int, input().split()))\na = [1, 3, 5, 7, 8, 10, 12]\nb = [4, 6, 9, 11]\nc = [2]\n\nif x in a and x not in b and x not in c and y in a and y not in b and y not in c:\n print('Yes')\nelif x not in a and x in b and x not in c and y not in a and y in b and y not in c :\n print('Yes')\nelse:\n print('No')\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "x,y = map(int,input().split())\ngr_a = [1,3,5,7,8,10,12]\ngr_b = [4,6,9,11]\ngr_c = [2]\n\nif x in gr_a and y in gr_a:\n print(\"Yes\")\nelif x in gr_b and y in gr_b:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "g1 = [4, 6, 9, 11]\ng2 = [2]\n\nx, y = list(map(int, input().split()))\ngx = 1 if x in g1 else 2 if x in g2 else 0\ngy = 1 if y in g1 else 2 if y in g2 else 0\nprint((\"Yes\" if gx == gy else \"No\"))\n", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "a = map(int, input().split())\ninput_set = set(a)\n\ngroup_a = {1, 3, 5, 7, 8, 10, 12}\ngroup_b = {4, 6, 9, 11}\ngroup_c = {2}\n\nlist_of_list = [group_a, group_b, group_c]\n\ncount_match = 0\n\nfor set_i in list_of_list:\n if set_i.issuperset(input_set):\n count_match += 1\n print('Yes')\n break\n\nif not count_match >= 1:\n print('No')", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "a=[1,3,5,7,8,10,12]\nb=[4,6,9,11]\nc=list(map(int,input().split(\" \")))\nprint(\"Yes\") if (c[0] in a and c[1] in a) or (c[0] in b and c[1] in b) else print(\"No\")", "passed": true, "time": 0.18, "memory": 14264.0, "status": "done"}, {"code": "x, y = list(map(int,input().split()))\n\na= [1,3,5,7,8,10,12]\nb= [4,6,9,11]\nc= [2]\n\nif (x in a and y in a) or (x in b and y in b) or (x in c and y in c):\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "x,y=map(int,input().split())\na=[1,3,5,7,8,10,12]\nb=[4,6,9,11]\nc=[2]\n\nif (x in a and y in a) or (x in b and y in b) or (x in c and y in c):\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.16, "memory": 14168.0, "status": "done"}, {"code": "l = ((1,3,5,7,8,10,12),(4,6,9,11),(0,2))\nx,y = map(int, input().split())\np = 0\nfor i in l:\n\tif x in i and y in i:\n\t\tp = 1\n\t\tbreak\nans = 'Yes' if p == 1 else 'No'\nprint(ans)", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "group1 = [1, 3, 5, 7, 8, 10, 12]\ngroup2 = [4, 6, 9, 11]\n\nx, y = map(int, input().split())\n\nif (x in group1 and y in group1) or (x in group2 and y in group2) or (x == y == 2):\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "print('YNeos'[len(set([0 if i==2 else [1,2][i in [4,6,9,11]] for i in [*map(int,input().split())]]))!=1::2])", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "G1 = [1,3,5,7,8,10,12]\nG2 = [4,6,9,11]\nx,y = map(int, input().split())\n\nif x in G1 and y in G1:\n print('Yes')\nelif x in G2 and y in G2:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "x,y=map(int,input().split())\na=[1,3,5,7,8,10,12]\nb=[4,6,9,11]\nif x in a and y in a :\n print(\"Yes\")\nelif x in b and y in b :\n print(\"Yes\")\nelse :\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "x,y=list(map(int,input().split()))\nfor l in [[1,3,5,7,8,10,12],[4,6,9,11],[2]]:\n if x in l and y in l:\n print('Yes')\n return\nprint('No')\n", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "x, y = map(int, input().split())\n\ng1 = [1, 3, 5, 7, 8, 10, 12]\ng2 = [4, 6, 9, 11]\ng3 = [2]\n\nif (x in g1 and y in g1) or (x in g2 and y in g2) or (x in g3 and y in g3):\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\n\nlis = [4, 6, 9, 11]\nlis2 = [1, 3, 5, 7, 8, 10, 12]\n\nif a == b == 2:\n print('Yes')\nelif a in lis and b in lis:\n print('Yes')\nelif a in lis2 and b in lis2:\n print('Yes')\nelse:\n print('No')\n", "passed": true, "time": 0.15, "memory": 14356.0, "status": "done"}, {"code": "def solve():\n x, y = list(map(int, input().split()))\n a = [1, 3, 5, 7, 8, 10, 12]\n b = [4, 6, 9, 11]\n c = [2]\n\n if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):\n print(\"Yes\")\n else:\n print(\"No\")\n\n\ndef __starting_point():\n solve()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14320.0, "status": "done"}, {"code": "array1 = [1,3,5,7,8,10,12]\narray2 = [4,6,9,11]\narray3 = [2]\nx,y = map(int,input().split())\nif (x in array1 and y in array1) or (x in array2 and y in array2) or (x in array3 and y in array3):\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.15, "memory": 14356.0, "status": "done"}, {"code": "x,y=map(int,input().split())\na=[1,3,5,7,8,10,12]\nb=[4,6,9,11]\nif x in a and y in a:\n print(\"Yes\")\nelif x in b and y in b:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.16, "memory": 14256.0, "status": "done"}, {"code": "s1 =set([1,3,5,7,8,10,12])\ns2 =set([4,6,9,11])\ns3 =set([2])\na,b =map(int,input().split())\nfor i in [s1,s2,s3]:\n if a in i and b in i:\n print(\"Yes\")\n break\nelse:\n print(\"No\")", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "a = [1, 3, 5, 7, 8, 10, 12]\nb = [4, 6, 9, 11]\nc = [2]\nx, y = map(int, input().split())\nif a.count(x) * a.count(y) > 0 or b.count(x) * b.count(y) > 0 or c.count(x) * c.count(y) > 0:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "a,b = [int(x) for x in input().split()]\ng = [[] for x in range(3)]\ng[0] = [1,3,5,7,8,10,12]\ng[1] = [4,6,9,11]\ng[2] = [2]\nres = \"No\"\nfor i in range(3):\n if a in g[i] and b in g[i]:\n res = \"Yes\"\n \nprint(res)", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a == 4 or a == 6 or a == 9 or a == 11:\n if b == 1 or b == 2 or b == 3 or b == 5 or b == 7 or b == 8 or b == 10 or b == 12:\n print(\"No\")\n else:\n print(\"Yes\")\n \nelif a == 2:\n print(\"No\")\n \nelse:\n if b == 2 or b == 4 or b == 6 or b == 9 or b == 11:\n print(\"No\")\n else:\n print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "a=[1,3,5,7,8,10,12]\nb=[4,6,9,11]\nc=[2]\np=0\nq=0\n\ns=list(map(int,input().split()))\n\nfor i in a:\n if s[0]==i:\n p=0\n elif s[0]==2:\n p=2\n else:\n p=1\n\nfor i in a:\n if s[1]==i:\n q=0\n elif s[1]==2:\n q=2\n else:\n q=1\n\nif p==q:\n print('Yes')\nelse:\n print('No')\n", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nl1=[1,3,5,7,8,10,12]\nl2=[4,6,9,11] \nif a==2 or b==2:\n print(\"No\")\nelif a in l1 and b in l1:\n print(\"Yes\")\nelif a in l2 and b in l2:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "a, b = map(int, input().split())\ns = {1, 3, 5, 8, 7, 10, 12}\nt = {4, 6, 9, 11}\nu = {2}\nif a in s and b in s:\n print(\"Yes\")\nelif a in t and b in t:\n print(\"Yes\")\nelif a in u and b in u:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "x, y = list(map(int, input().split()))\na = [1, 3, 5, 7, 8, 10, 12]\nb = [4, 6, 9, 11]\nc = [2]\n\nif (x in a and y in a) or (x in b and y in b) or (x in c and y in c):\n print('Yes')\nelse:\n print('No')\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "x, y=map(int, input().split())\nA=set([1, 3, 5, 7, 8, 10, 12])\nB=set([4, 6, 9, 11])\nif x in A and y in A:\n print('Yes')\nelif x in B and y in B:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "x,y=map(int,input().split())\n \nA=[1,3,5,7,8,10,12]\nB=[4,6,9,11]\n \nif x==2 or y==2:\n print('No')\nelif (x in A and y in A) or (x in B and y in B):\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "x,y=map(int, input().split()) \ng=[[1,3,5,7,8,10,12],[4,6,9,11]]\nprint(\"Yes\" if any(x in g[i] and y in g[i] for i in range(2)) else \"No\")", "passed": true, "time": 0.23, "memory": 14132.0, "status": "done"}, {"code": "gr = [0,1,3,1,2,1,2,1,1,2,1,2,1]\nx, y = map(int, input().split())\nans = 'Yes' if gr[x] == gr[y] else 'No'\nprint(ans)", "passed": true, "time": 0.23, "memory": 14296.0, "status": "done"}, {"code": "x,y = map(int,input().split())\n\ngrp1=[1,3,5,7,8,10,12]\ngrp2=[4,6,9,11]\n\nif x in grp1 and y in grp1: print('Yes')\nelif x in grp2 and y in grp2: print('Yes')\nelse: print('No')", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "a=[1,3,5,7,8,10,12]\nb=[4,6,9,11]\nx,y=map(int,input().split())\nif (x in a and y in a) or (x in b and y in b):print('Yes')\nelse:print('No')", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "x,y=map(int,input().split())\ngroup_A=[1,3,5,7,8,10,12]\ngroup_B=[4,6,9,11]\nif x in group_A and y in group_A :\n print(\"Yes\")\nelif x in group_B and y in group_B :\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.15, "memory": 14276.0, "status": "done"}, {"code": "L=[1,0,1,2,1,2,1,1,2,1,2,1]\na,b=map(int,input().split())\nif L[a-1]==L[b-1]:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "a = [1, 3, 5, 7, 8, 10, 12]\nb = [4, 6, 9, 11]\nc = [2]\nx, y = map(int, input().split())\nif (x in a and y in a) or (x in b and y in b) or (x in c and y in c):\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "x,y=list(map(int,input().split()))\nA={1,3,5,7,8,10,13}\nB={4,6,9,11}\nC={2}\n\nif (x in A and y in A) or (x in B and y in B) or (x in C and y in C):\n print(\"Yes\")\nelse:\n print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "g = [-1, 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0]\nx, y = map(int, input().split())\nif g[x] == g[y]: print('Yes')\nelse: print('No')", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "x, y = list(map(int, input().split()))\n\nga = [4,6,9,11]\ngb = [1,3,5,7,8,10,12]\ngc = [2]\n\nxg = yg = \"\"\ndef group(x):\n if x in ga:\n return \"ga\"\n if x in gb:\n return \"gb\"\n if x in gc:\n return \"gc\"\nxg = group(x)\nyg = group(y)\nif xg == yg:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "x, y = map(int, input().split())\n\ng1 = [1, 3, 5, 7, 8, 10, 12]\ng2 = [4, 6, 9, 11]\n\n\nif x == 2 and y == 2:\n print(\"Yes\")\nelif x in g1 and y in g1:\n print(\"Yes\")\nelif x in g2 and y in g2:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "a,b=map(int,input().split())\ns=[1,3,5,7,8,10,12]\nt=[4,6,9,11]\nif a in s:\n a = 0\nelif a in t:\n a = 1\nelse:\n a = 2\nif b in s:\n b = 0\nelif b in t:\n b = 1\nelse:\n b = 2\nprint(\"Yes\" if a==b else \"No\")", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "N = 12\nParent = [I for I in range(N+1)]\nRank = [0]*(N+1)\ndef FindParent(X):\n if Parent[X]==X:\n return X\n else:\n Parent[X] = FindParent(Parent[X])\n return Parent[X]\n\ndef CheckParent(X,Y):\n return FindParent(X)==FindParent(Y)\n\ndef UniteParent(X,Y):\n X = FindParent(X)\n Y = FindParent(Y)\n if X==Y:\n return 0\n if Rank[X]<Rank[Y]:\n Parent[X] = Y\n else:\n Parent[Y] = X\n if Rank[X]==Rank[Y]:\n Rank[X] += 1\n \nfor GA in [3,5,7,8,10,12]:\n UniteParent(1,GA)\nfor GB in [6,9,11]:\n UniteParent(4,GB)\nX,Y = (int(T) for T in input().split())\nprint(['No','Yes'][CheckParent(X,Y)])", "passed": true, "time": 0.22, "memory": 14356.0, "status": "done"}, {"code": "import bisect, collections, copy, heapq, itertools, math, string, sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = float('inf')\ndef I(): return int(input())\ndef F(): return float(input())\ndef SS(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LSS(): return input().split()\n\ndef resolve():\n x, y = LI()\n d = {1: 0, 2: 2, 3: 0, 4: 1, 5: 0, 6: 1, 7: 0, 8: 0, 9: 1, 10: 0, 11: 1, 12: 0}\n\n if d[x] == d[y]:\n print('Yes')\n else:\n print('No')\n\ndef __starting_point():\n resolve()\n\n__starting_point()", "passed": true, "time": 0.24, "memory": 14384.0, "status": "done"}, {"code": "a = [1,3,5,7,8,10,12]\nb = [4,6,9,11]\nc = [2]\nx,y=map(int,input().split())\nif x in a and y in a:\n print(\"Yes\")\nelif x in b and y in b:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "x,y=map(int,input().split())\ns1={1,3,5,7,8,10,12}\ns2={4,6,9,11}\nprint([\"No\",\"Yes\"][(x in s1 and y in s1) or (x in s2 and y in s2)]) ", "passed": true, "time": 0.15, "memory": 14124.0, "status": "done"}, {"code": "x, y = map(int, input().split())\na = [1, 3, 5, 7, 8, 10, 12]\nb = [4, 6, 9, 11]\nc = [2]\n\nif (x in a and y in a) or (x in b and y in b) or (x in c and y in c):\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "g = [0,1,3,1,2,1,2,1,1,2,1,2,1]\nx, y = map(int,input().split())\n\nprint('Yes') if g[x] == g[y] else print('No')", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "x,y=map(int,input().split())\ndata=[1,3,1,2,1,2,1,1,2,1,2,1]\nif data[x-1]==data[y-1]:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "x,y=list(map(int,input().split()))\na=[1,3,5,7,8,10,12]\nb=[4,6,9,11]\nc=[2]\nif x in a and y in a:\n print(\"Yes\")\nelif x in b and y in b:\n print(\"Yes\")\nelif x in c and y in c:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "passed": true, "time": 0.15, "memory": 14336.0, "status": "done"}, {"code": "a = [1,3,5,7,8,10,12]\nb = [4,6,9,11]\nx,y = list(map(int,input().split()))\nprint((\"Yes\" if (x in a and y in a) or (x in b and y in b) else \"No\"))\n", "passed": true, "time": 0.15, "memory": 14136.0, "status": "done"}, {"code": "x, y = map(int, input().split())\na=[1,3,5,7,8,10,12]\nb=[4,6,9,11]\nif (x==y or (x in a and y in a) or (x in b and y in b)):\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.16, "memory": 14332.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nx = [1,3,5,7,8,10,12]\ny = [4,6,9,11]\nif a == 2 or b == 2:\n print(\"No\")\nelse:\n if a in x and b in x:\n print(\"Yes\")\n elif a in y and b in y:\n print(\"Yes\")\n else:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "x,y = map(int,input().split())\nA = [1,3,5,7,8,10,12]\nB = [4,6,9,11]\nC = [2]\n\nif x in A and y in A:\n check = True\nelif x in B and y in B:\n check = True\nelif x in C and y in C:\n check = True\nelse:\n check = False\n \nprint(\"Yes\" if check else \"No\")", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\nINF = float('inf')\nMOD = 10**9 + 7\n#MOD = 998244353\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lintdec(): return list(map(lambda x:int(x) - 1, input().split()))\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nc = set(lint())\na = set([1, 3, 5, 7, 8, 10, 12])\nb = set([4, 6, 9, 11])\n\nif c & a == c or c & b == c:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "x,y = list(map(int,input().split()))\n\na = [1,3,5,7,8,10,12]\nb = [4,6,9,11]\n\nif x == 2 or y == 2:\n print('No')\nelif x in a and y in a:\n print('Yes')\nelif x in b and y in b:\n print('Yes')\nelse:\n print('No')\n", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "x, y = map(int, input().split())\na = [1, 3, 5, 7, 8, 10, 12]\nb = [4, 6, 9, 11]\nc =[2]\nif x in a and y in a:\n print(\"Yes\")\nelif x in b and y in b:\n print(\"Yes\")\nelif x in c and y in c:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "x, y = map(int, input().split())\na = [4, 6, 9, 11]\nb = 0\nc = 0\nif x == 2 or y == 2:\n print(\"No\")\nelse:\n if x in a:\n b = 1\n if y in a:\n c = 1\n if (b + c) % 2 == 0:\n print(\"Yes\")\n else:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "x, y = list(map(int, input().split()))\n\ngroup_1 = {1, 3, 5, 7, 8, 10, 12}\ngroup_2 = {4, 6, 9, 11}\n\nif (x in group_1) and (y in group_1):\n print('Yes')\nelif (x in group_2) and (y in group_2):\n print('Yes')\nelse:\n print('No')\n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "x,y=map(int,input().split())\nG=\"121313113131\"\nprint([\"No\",\"Yes\"][G[x-1]==G[y-1]])", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "x, y = map(int, input().split())\nd = {1:1, 3:1, 5:1, 7:1, 8:1, 10:1, 12:1, 4:2, 6:2, 9:2, 11:2, 2:3}\nif d[x]==d[y]:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.19, "memory": 14088.0, "status": "done"}, {"code": "s = \"0131212112121\"\nx,y = map(int,input().split())\nprint(\"Yes\" if s[x]==s[y] else \"No\")", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "x,y = map(int,input().split())\ng = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]\ns = 0\nfor i in range(3):\n if x in g[i] and y in g[i]:\n print(\"Yes\")\n s = 1\nif s == 0:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "x,y = map(int, input().split())\na = [1,3,5,7,8,10,12]\nb = [4,6,9,11]\nif (x in a and y in a) or (x in b and y in b):\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "print('YNeos'[len(set([0 if i==2 else [1,2][i in [4,6,9,11]] for i in list(map(int,input().split()))]))!=1::2])", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\ns = {1, 3, 5, 8, 7, 10, 12}\nt = {4, 6, 9, 11}\nu = {2}\nif a in s and b in s:\n print(\"Yes\")\nelif a in t and b in t:\n print(\"Yes\")\nelif a in u and b in u:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "x,y = list(map(int,input().split()))\n\ns = [1,3,5,7,8,10,12]\ns1 = [4,6,9,11]\ns2 = [2]\n\nif x in s:\n if y in s:\n print('Yes')\n return\nelif x in s1:\n if y in s1:\n print('Yes')\n return\nelif x in s2:\n if y in s2:\n print('Yes')\n return\n\nprint('No')\n", "passed": true, "time": 0.14, "memory": 14372.0, "status": "done"}, {"code": "G = [set([1,3,5,7,8,10,12]), set([4,6,9,11]), set([2])]\ndef check(x, y):\n for g in G:\n if x in g and y in g:\n return True\n return False\nx, y = list(map(int, input().split()))\nprint((\"Yes\" if check(x, y) else \"No\"))\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "lst = input().split()\n\nx = int(lst[0])\ny = int(lst[1])\n\nA = [1, 3, 5, 7, 8, 10, 12]\nB = [4, 6, 9, 11]\nC = [2]\n\ndef judge(L):\n if (x in L) and (y in L):\n return True\n else:\n return False\n\nif judge(A) or judge(B) or judge(C):\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "r = list(map(int,input().split()))\na=[1,3,5,7,8,10,12]\nb=[4,6,9,11]\nc=[2]\nif r[0]==2 or r[0]==2:\n print('No')\nelif len(list(set(r) & set(a))) == 2:\n print('Yes')\nelif len(list(set(r) & set(b))) == 2:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "lisa=[1,3,5,7,8,10,12]\nlisb=[4,6,9,11]\nlisc=[2]\nx,y=map(int,input().split())\nif (x in lisa)and(y in lisa):\n print(\"Yes\")\nelif (x in lisb)and(y in lisb):\n print(\"Yes\")\nelif (x in lisc)and(y in lisc):\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.23, "memory": 14292.0, "status": "done"}, {"code": "x, y = map(int, input().split())\n\ng1 = [1, 3, 5, 7, 8, 10, 12]\ng2 = [4, 6, 9, 11]\n\nprint(\"Yes\" if (x in g1 and y in g1) or (x in g2 and y in g2) else \"No\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a = [1, 3, 5, 7, 8, 10, 12]\nb = [4, 6, 9, 11]\nc = [2]\nacount = 0\nbcount = 0\nccount = 0\n\nx, y = input().split()\n\nfor i in range(0, 7):\n if int(x) == a[i] or int(y) == a[i]:\n acount += 1\n\nfor i in range(0, 4):\n if int(x) == b[i] or int(y) == b[i]:\n bcount += 1\n\nif int(x) == c[0]:\n ccount += 1\nif int(y) == c[0]:\n ccount += 1\n\n\nif acount == 2 or bcount == 2 or ccount == 2:\n print(\"Yes\")\nelse:\n print(\"No\")\n\n\n", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "g = [[1, 3, 5, 7, 8, 10, 12], [4, 6, 9, 11], [2]]\nx, y = map(int, input().split())\nfor i in range(len(g)):\n if x in g[i]:\n xg = i\n if y in g[i]:\n yg = i\nif xg == yg:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "x, y = map(int, input().split())\n\ngr1=[1,3,5,7,8,10,12]\ngr2=[4,6,9,11]\ngr3=[2]\n\nif x in gr1 and y in gr1:\n print('Yes')\nelif x in gr2 and y in gr2:\n print('Yes')\nelif x in gr3 and y in gr3:\n print('Yes')\nelse:\n print('No')", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "x, y =map(int, input().split())\nif x in {1,3,5,7,8,10,12}:\n x= 1\nelif x in {4,6,9,11}:\n x =2\nelse:\n x = 3\nif y in {1,3,5,7,8,10,12}:\n y= 1\nelif y in {4,6,9,11}:\n y =2\nelse:\n y = 3\nprint(\"Yes\" if x == y else \"No\")", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "x,y=map(int,input().split())\ng1 = {1,3,5,7,8,10,12}\ng2 = {4,6,9,11}\ng3 = {2}\n\ndef group(z):\n if z in g1:return 1\n elif z in g2:return 2\n else: return 3\n \nif group(x)==group(y):print('Yes')\nelse:print('No')", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "'''\nabc062 A - Grouping\nhttps://atcoder.jp/contests/abc062/tasks/abc062_a\n'''\n\ndirs = [{1, 3, 5, 7, 8, 10, 12}, {4, 6, 9, 11}, {2}]\n\ni = list(map(int, input().split()))\n\nfor dir in dirs:\n if i[0] in dir and i[1] in dir:\n print('Yes')\n return\nelse:\n print('No')\n", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "a,b=input().split()\na=int(a)\nb=int(b)\nl1=[1,3,5,7,8,10,12]\nl2=[4,6,9,11]\nif a in l1 and b in l1:\n print(\"Yes\")\nelif a in l2 and b in l2:\n print(\"Yes\")\nelse:\n print(\"No\")", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "#k = int(input())\n#s = input()\n#a, b = map(int, input().split())\n#s, t = map(str, input().split())\n#l = list(map(int, input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\n#a = [list(input()) for _ in range(n)]\n\nx,y = list(map(int, input().split()))\n\ng1 = [1,3,5,7,8,10,12]\ng2 = [4,6,9,11]\ng3 = [2]\n\n\nif (x in g1 and y in g1):\n print(\"Yes\")\nelif (x in g2 and y in g2):\n print(\"Yes\")\nelif (x in g3 and y in g3):\n print(\"Yes\")\nelse:\n print(\"No\")\n\n\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}]
[{"input": "1 3\n", "output": "Yes\n"}, {"input": "2 4\n", "output": "No\n"}]
4,696
AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd. -----Constraints----- - 1 ≤ a,b ≤ 10000 - a and b are integers. -----Input----- Input is given from Standard Input in the following format: a b -----Output----- If the product is odd, print Odd; if it is even, print Even. -----Sample Input----- 3 4 -----Sample Output----- Even As 3 × 4 = 12 is even, print Even.
introductory
[{"code": "a, b = map(int, input().split())\nif a*b %2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.33, "memory": 14224.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif a % 2 == 0:\n print('Even')\nelif b % 2 == 0:\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.4, "memory": 14280.0, "status": "done"}, {"code": "a,b=map(int, input().split())\n\nif a*b%2==0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 1.03, "memory": 14108.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n \na, b = map(int, input().split())\n \nmul = a * b\n \nresult = 'Even' if (mul % 2 == 0) else 'Odd'\n \nprint(result)", "passed": true, "time": 0.39, "memory": 14324.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint([\"Even\", \"Odd\"][a * b % 2])", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "a,b=(int(x) for x in input().split())\n \nif a*b%2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.95, "memory": 14324.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint('Odd' if a*b % 2 == 1 else 'Even')", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "a, b = map(int,input().split())\n\nadd = (a * b)\n\nif add % 2 != 0:\n print(\"Odd\")\nelse:\n print(\"Even\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a,b = list(map(int, input().split())) \nc =a*b\nif c%2==0:\n print('Even')\nelse:\n print('Odd')\n", "passed": true, "time": 0.29, "memory": 14160.0, "status": "done"}, {"code": "a,b=input().split()\nif int(a)*int(b)%2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "import bisect,collections,copy,heapq,itertools,math,string\nimport sys\ndef I():\n #1 line 1 int\n return int(sys.stdin.readline().rstrip())\ndef LI():\n #1 line n int\n return list(map(int,sys.stdin.readline().rstrip().split()))\ndef S():\n #1 line 1 string\n return sys.stdin.readline().rstrip()\ndef LS():\n #1 line n strings\n return list(sys.stdin.readline().rstrip().split())\n\na,b,=LI()\n\nif (a*b)%2==0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.38, "memory": 14068.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nprint(\"Even\" if a * b % 2 == 0 else \"Odd\")", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\nif a * b % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")\n", "passed": true, "time": 0.32, "memory": 14032.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nc=a*b\n\nif c % 2 ==1:\n print('Odd')\n\nelse:\n print('Even')", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif (a * b) % 2 == 0:\n print(\"Even\")\nelif (a * b) % 2 != 0:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\nc = a * b\nif c%2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif (a*b)%2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "a,b=list(map(int,input().split()))\n\nif(a*b)%2==0:\n print('Even')\nelse:\n print('Odd')\n", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "a, b = map(int,input().split())\nif a * b % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "numbers = input().split(\" \")\nif (int(numbers[0])*int(numbers[1])) % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")\n", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nc = a * b\nif(c % 2):\n print(\"Odd\")\nelse:\n print(\"Even\")", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nprint([\"Odd\",\"Even\"][a*b%2==0])", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif a * b % 2: print('Odd')\nelse: print('Even')", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "a, b = input().split(' ')\n\nc = int(a)*int(b)\nif c % 2 == 0:\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "a,b = map(int, input().split())\nif a * b % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "x,y = map(int,input().split())\n\nseki = x * y\n\nif seki % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif a*b%2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "a, b = map(int,input().split())\nif (a*b)%2==0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nc = a * b\nprint(\"Even\" if c % 2 == 0 else \"Odd\")", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "a,b = map(int, input().split())\n \nif (a*b) % 2 == 0:\n print(\"Even\")\n \nelse :\n print(\"Odd\")", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif (a*b)%2 == 0:\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.16, "memory": 14252.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif a * b % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\nprint((\"Odd\" if a*b%2!=0 else \"Even\"))\n", "passed": true, "time": 0.3, "memory": 14164.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nc = (a*b)%2\n\nif c ==1:\n print('Odd')\nelse:\n print('Even')", "passed": true, "time": 0.91, "memory": 14288.0, "status": "done"}, {"code": "a,b=map(int, input().split())\nprint(\"Odd\" if a*b%2 else \"Even\")", "passed": true, "time": 0.62, "memory": 14060.0, "status": "done"}, {"code": "a,b=(int(xx) for xx in input().split())\nif (a*b)%2==0:\n print('Even')\nelse:\n print(\"Odd\")\n", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "def mapt(fn, *args):\n return tuple(map(fn, *args))\n\n\ndef Input():\n return mapt(int, input().split(\" \"))\n\n\ndef main():\n a, b = Input()\n print(\"Even\" if (a*b)%2==0 else \"Odd\")\n\n\nmain()", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nanswer = a * b\n\nif answer % 2 == 0 :\n print('Even')\nelse : \n print('Odd')", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nc = (a * b) % 2\nif c == 0:\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nmul = a*b\nif mul%2==1:\n print(\"Odd\")\nelse:\n print(\"Even\")", "passed": true, "time": 0.17, "memory": 14212.0, "status": "done"}, {"code": "a,b=map(int,input().split())\n\nif (a*b)%2==0:print('Even')\nelse:print('Odd')", "passed": true, "time": 0.15, "memory": 14168.0, "status": "done"}, {"code": "a,b = list(map(int, input().split()))\nprint('Odd' if a&1 and b&1 else 'Even')", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a * b % 2 == 0:\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.24, "memory": 14316.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif a % 2 == 1 and b % 2 == 1:\n print('Odd')\nelse:\n print('Even')", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a * b % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nS = a*b\n\nif S % 2 == 1:\n print(\"Odd\")\nelse:\n print(\"Even\")", "passed": true, "time": 0.15, "memory": 14048.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nc = a*b\nif c % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "def isEven(a, b):\n if a % 2 == 0:\n return True\n if b % 2 == 0:\n return True\n return False\n\ni = input().split()\na = int(i[0])\nb = int(i[1])\nif isEven(a, b):\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "# coding: utf-8\n# Your code here!\nnum=input().split()\nnum2=int(num[0])*int(num[1])\n\nif num2%2==0:\n\tprint(\"Even\")\nelse:\n \tprint(\"Odd\")", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nprint('Even') if a*b % 2 == 0 else print('Odd')", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint(\"Even\" if a*b % 2 == 0 else \"Odd\")", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "#!/bin/env python3\n# -*- coding: utf-8 -*-\n\nIS = lambda: int(input())\nIA = lambda: [int(x) for x in input().split()]\n\na, b = IA()\nprint((\"Odd\" if (a * b) % 2 else \"Even\"))\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nflag = (a*b %2 ==0)\nif flag:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nprint('EOvdedn'[a*b%2::2])", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "a,b=map(int,input().split(\" \"))\nprint([\"Even\",\"Odd\"][(a*b)%2])", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint('Even' if (a*b % 2) == 0 else 'Odd')", "passed": true, "time": 0.15, "memory": 14252.0, "status": "done"}, {"code": "p = input().split()\n\nprint (\"Even\" if int(p[0]) * int(p[1]) % 2 == 0 else \"Odd\")", "passed": true, "time": 0.16, "memory": 14212.0, "status": "done"}, {"code": "def solve(a, b):\n if a * b % 2 == 0:\n print('Even')\n else:\n print('Odd')\n\n\ndef __starting_point():\n a, b = list(map(int, input().split()))\n solve(a, b)\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "a, b = map(int,input().split())\nif a*b % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.15, "memory": 14068.0, "status": "done"}, {"code": "lst = input().split()\n\nif (int(lst[0]) * int(lst[1])) % 2 == 0:\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.43, "memory": 14076.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a%2 == 0 or b%2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif a * b % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "[a, b] = input().split()\n\nif (int(a) % 2 == 0) or (int(b) % 2 == 0):\n print(\"Even\")\nelse:\n print(\"Odd\")\n", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint(\"Even\" if a * b % 2 == 0 else \"Odd\" )", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a, b = [int(i) for i in input().split()]\n\nprint(('Odd' if a * b % 2 == 1 else 'Even'))\n", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a*b%2==0:\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "a, b = map(int, input().split(' '))\n\nmod_ab = (a*b)%2\n\nif(mod_ab==0) :\n print(\"Even\")\nelse :\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint(\"Odd\" if a*b%2==1 else \"Even\")", "passed": true, "time": 0.21, "memory": 14280.0, "status": "done"}, {"code": "print(\"Odd\" if all(map(lambda x:int(x)%2, input().split())) else \"Even\")", "passed": true, "time": 0.16, "memory": 14212.0, "status": "done"}, {"code": "a,b = map(int,input().split())\n\nif a*b%2 == 0:\n print('Even')\n \nelse:\n print('Odd')", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif (a*b) % 2:\n print(\"Odd\")\nelse:\n print(\"Even\")", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nc = (a * b) % 2\n\nif c == 0:\n print('Even')\nelif c == 1:\n print('Odd')", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a,b = map(int, input().split())\nif (a * b) %2 == 0:\n print('Even')\nelif(a * b) %2 == 1:\n print('Odd')", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint(\"Odd\" if a * b % 2 == 1 else \"Even\")", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "a,b = map(int, input().split())\nif a*b%2 == 1:\n print(\"Odd\")\nelse:\n print(\"Even\")", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "#85A\na,b=map(int,input().split())\nif a*b%2==0:\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "a, b = map(int,input().split())\nc = a * b\nif c % 2 == 0 :\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint('Even' if a*b % 2 == 0 else 'Odd')", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\nif (a * b) % 2 == 0:\n print('Even')\n\nelse:\n print('Odd')\n", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "aa,bb=map(int,input().split())\n\nif aa * bb % 2 == 0:\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.23, "memory": 14084.0, "status": "done"}, {"code": "a, b = map(int,input().split())\nif (a * b) % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.16, "memory": 14208.0, "status": "done"}, {"code": "getints = lambda: list(map(int, input().split()))\na, b = getints()\nif a * b % 2:\n print('Odd')\nelse:\n print('Even')\n", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "# \u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u306e\u6574\u6570\u306e\u5165\u529b\nb, c = map(int, input().split())\n \nif b * c % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "a,b = map(int,input().split())\n\nif (a*b)%2 == 0:\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif 0==(a*b)%2:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nsys.setrecursionlimit(10**6)\n\na, b = list(map(int, input().split()))\n\nif a*b % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "# coding: utf-8\n# Your code here!\n\na, b = map(int, input().split())\n\nif a*b % 2 == 0 : \n print(\"Even\")\nelse : \n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a,b = map(int,input().split())\n\nif a*b % 2 == 0:\n print('Even')\nelse:\n print('Odd')", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "x, y = map(int, input().split())\n \nl = (x*y) % 2\nif l == 0:\n\tprint('Even')\nelse:\n \tprint('Odd')", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "a, b = map(int,input().split())\nif a*b % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.22, "memory": 14080.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif (a * b) % 2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a*b%2==0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "a,b = (int(x) for x in input().split())\n\nmulti = a * b\n\nif multi %2 == 0:\n print(\"Even\")\nelse:\n print(\"Odd\")\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif (a*b) % 2 ==0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\nprint((\"Even\" if a*b%2 == 0 else \"Odd\"))\n\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a*b%2==0:\n print(\"Even\")\nelse:\n print(\"Odd\")", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a % 2 == 1 and b % 2 == 1:\n print('Odd')\nelse:\n print('Even')", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nprint('Even') if a*b % 2 == 0 else print('Odd')", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif (a * b) % 2 == 1:\n print(\"Odd\")\nelse:\n print(\"Even\")", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}]
[{"input": "3 4\n", "output": "Even\n"}, {"input": "1 21\n", "output": "Odd\n"}]
4,697
Snuke loves puzzles. Today, he is working on a puzzle using S- and c-shaped pieces. In this puzzle, you can combine two c-shaped pieces into one S-shaped piece, as shown in the figure below: Snuke decided to create as many Scc groups as possible by putting together one S-shaped piece and two c-shaped pieces. Find the maximum number of Scc groups that can be created when Snuke has N S-shaped pieces and M c-shaped pieces. -----Constraints----- - 1 ≤ N,M ≤ 10^{12} -----Input----- The input is given from Standard Input in the following format: N M -----Output----- Print the answer. -----Sample Input----- 1 6 -----Sample Output----- 2 Two Scc groups can be created as follows: - Combine two c-shaped pieces into one S-shaped piece - Create two Scc groups, each from one S-shaped piece and two c-shaped pieces
introductory
[{"code": "n, m = [int(x) for x in input().split()]\nans = min(n, m // 2)\nans += (m - ans * 2) // 4\nprint(ans)", "passed": true, "time": 1.98, "memory": 14164.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nans=0\nif 2*N<=M:\n ans+=N\n M-=2*N\nelse:\n ans+=(M//2)\n M-=(M//2)*2\nans+=(M//4)\nprint(ans)", "passed": true, "time": 0.19, "memory": 14300.0, "status": "done"}, {"code": "def main():\n n, m = map(int, input().split())\n\n if m - 2 * n >= 0:\n m -= 2 * n\n ans = n\n n = 0\n\n if (m - 2 * n) % 4 == 0:\n tmp = (m - 2 * n) // 4\n else:\n tmp = (m - 2 * n) // 4 + 1\n\n ans += (m - 2 * tmp) // 2\n\n else:\n ans = m // 2\n\n print(ans)\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "s, c = map(int, input().split())\nc = c//2\n\nif s == c:\n print(s)\nelif s > c:\n print(c)\nelif s < c:\n t = c - s\n print(s + t//2)", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\n\nif N <= M/2:\n ans = N + (M - 2*N)//4\nelse:\n ans = M//2\nprint(ans)\n", "passed": true, "time": 0.16, "memory": 14128.0, "status": "done"}, {"code": "n, m = map(int, input().split())\n\nif n >= (m // 2):\n print(m // 2)\nelse:\n total = n * 2 + m\n print(total // 4)", "passed": true, "time": 0.18, "memory": 14132.0, "status": "done"}, {"code": "n,m = map(int,input().split())\n\nans = 0\nif m-n*2>0:\n ans += n\n tmp = m-n*2\n \n ans += tmp//4\nelse:\n ans += m//2\nprint(ans)", "passed": true, "time": 0.15, "memory": 14336.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nif n<m:\n print(n+(m-2*n)//4)\nelse:\n print(m//2)", "passed": true, "time": 1.9, "memory": 14196.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nif N >= M // 2:\n ans = M//2\nelse:\n ans = N + (M-2*N)//4\nprint(ans)", "passed": true, "time": 0.2, "memory": 14172.0, "status": "done"}, {"code": "n,m = map(int, input().split())\nif 0 <= 2*n-m:\n num = m//2\nelse:\n num = n\n num += (m-2*n)//4\nprint(num)", "passed": true, "time": 0.17, "memory": 14240.0, "status": "done"}, {"code": "#!/usr/bin/env python\n\nn, m = list(map(int, input().split()))\n\ncc = m//2\nans = min(n, cc) \nres = cc-min(n, cc) \nif res > 0:\n ans += res//2\nprint(ans)\n", "passed": true, "time": 0.19, "memory": 14200.0, "status": "done"}, {"code": "import math\nN,M = (int(T) for T in input().split())\nif M-2*N>0:\n Convert = int(math.floor((M-2*N)/4))\n N += Convert\n M -= 2*Convert\n print(N)\nelse:\n print(M//2)", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nprint(M//2 if 2*N > M else N + (M-2*N)//4)", "passed": true, "time": 0.16, "memory": 14076.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nprint(min(n,m//2)+(m//2-min(n,m//2))//2)", "passed": true, "time": 0.19, "memory": 14140.0, "status": "done"}, {"code": "# C - Scc Puzzle\ndef main():\n n, m = map(int, input().split())\n\n\n if m-n*2 >= 0:\n print(n+((m-n*2)//4))\n else:\n print(m//2)\n \n \ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.17, "memory": 14196.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nif 2*N < M:\n extra = (M - 2*N) // 4\n ans = N + extra\nelse:\n ans = M // 2\nprint(ans)", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "N,M = (int(T) for T in input().split())\nif 2*N<M:\n print(N+(M-2*N)//4)\nelse:\n print(M//2)", "passed": true, "time": 0.2, "memory": 14288.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nM//=2\nprint(min(M,(N+M)//2))", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "n,m=list(map(int,input().split()))\nif m<2:\n print((0))\n return\nif n>m//2:\n print((m//2))\n return\nc=n%(m//2)\nd=m-2*c\nc+=d//4\nprint(c)\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "s, c = map(int, input().split())\n\nif 2 * s <= c:\n ans = s\n c = c - 2 * s\nelse:\n ans = c // 2\n c = 0\nif c >= 4:\n ans += c // 4\nprint(ans)", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n, m = [int(i) for i in input().split()]\n\nif 2*n >= m:\n print(m // 2)\nelse:\n print(n + (m - 2 * n) // 4)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "N, M = map(int, input().split())\n\nif 2 * N >= M:\n print(M // 2)\nelse:\n print(N + (M - 2 * N) // 4)", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nres = min(n, m // 2) + (m - min(n, m // 2) * 2) // 4\nprint(res)\n", "passed": true, "time": 0.15, "memory": 14236.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\ntotal = 2 * N + M\nans = total // 4\nif ans*2 > M:\n ans = M//2\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "import sys\nN,M = map(int,input().split())\nif not ( 1 <= N <= 10**12 and 1 <= M <= 10**12 ): return\n\ncount_SCC=0\nif M > 2*N : #M\u304c\u3042\u307e\u308b\n M = M - 2*N\n count_SCC = N + M//4\nelif M < 2*N : #N\u304c\u3042\u307e\u308b\n count_SCC = M//2\nprint(count_SCC)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n,m = [int(x) for x in input().split()]\nres = 0\nif 2 * n >= m:\n res = m // 2\nelse:\n res = n\n m -= 2 * n\n res += m // 4\n\nprint(res)", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "N,M = [int(a) for a in input().split()]\n\na1 = min(N,M//2)\na2 = 0\nif M//2 > N:\n a2 = (M - N*2)//4\n \na3 = a1+a2\nprint(a3)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\n\nif 2 * n >= m:\n print(m // 2)\nelse:\n print(n + (m-(2*n))//4)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nif 2*n>=m:\n print(m//2)\nelse:\n ans=n\n ans+=(m-2*n)//4\n print(ans)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nans = min(n, m // 2)\nm -= ans * 2\nans += max(0, m // 4)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "N,M=map(int,input().split())\n \nif N>=M//2:\n print(M//2)\nelse:\n print(N+(M-2*N)//4)", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "n,m=list(map(int,input().split()))\nif n*2>=m:\n ans=m//2\nelse:\n ans=n\n m-=n*2\n ans+=m//4\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "S, C = list(map(int, input().split()))\nans = 0\n\n# \u521d\u671f\u306eS\u3067\u53ef\u80fd\u306a\u9650\u308aSCC\u3092\u4f5c\u308b\nif S*2 <= C:\n C = C - S*2\n ans += S\n ans += C // 4\nelse:\n ans += C // 2\n\nprint((int(ans)))\n", "passed": true, "time": 1.53, "memory": 14132.0, "status": "done"}, {"code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10 ** 9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, M = list(map(int, readline().split()))\n\n if N >= M // 2:\n ans = M // 2\n else:\n ans = N\n L = M - 2 * N\n ans += L // 4\n\n print(ans)\n return\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.22, "memory": 14192.0, "status": "done"}, {"code": "s,c=map(int,input().split())\nif 2*s<=c: print((s+c//2)//2)\nelse: print(c//2)", "passed": true, "time": 0.22, "memory": 14140.0, "status": "done"}, {"code": "N, M = [int(i) for i in input().split()]\nif 2 * N >= M:\n print((M // 2))\nelse:\n print((N + (M - N - N) // 4))\n", "passed": true, "time": 0.18, "memory": 14072.0, "status": "done"}, {"code": "import sys;input = lambda : sys.stdin.readline()\nn,m = list(map(int,input().split()))\nif m-2*n>=0:\n print((n+(m-2*n)//4))\nelse:\n print((m//2))\n", "passed": true, "time": 0.23, "memory": 14192.0, "status": "done"}, {"code": "s,c=map(int,input().split())\np=s*2\nif p <= c:\n print(s + (c-p)//4)\nelse:\n print(c//2)", "passed": true, "time": 0.22, "memory": 14104.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nif n*2>=m:\n print(m//2)\nelse:\n print(n+(m-2*n)//4)", "passed": true, "time": 0.2, "memory": 14248.0, "status": "done"}, {"code": "n, m = map(int, input().split())\n\nc = m - n * 2\nif c > 0:\n print(n + c // 4)\nelse:\n print(m // 2)", "passed": true, "time": 0.15, "memory": 14204.0, "status": "done"}, {"code": "a,b=map(int, input().split())\n\nif a*2 <= b:\n c = (b-a*2)//4\n print(a+c)\nif a*2 > b:\n print(b//2)", "passed": true, "time": 0.24, "memory": 14132.0, "status": "done"}, {"code": "N, M = list(map(int ,input().split()))\n\n# N + x : M - 2x = 1 : 2\n# M - 2x = 2N + 2x\n# x = (M - 2N) / 4\n\nif N * 2 >= M:\n print((int(M / 2)))\nelse:\n x = (M - 2 * N) / 4\n N += int(x)\n M -= 2 * int(x)\n print(N)\n \n \n", "passed": true, "time": 0.23, "memory": 14296.0, "status": "done"}, {"code": "N,M=list(map(int,input().split()))\nif 2*N>M:\n print((M//2))\nelse:\n print(((2*N+M)//4))\n", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "import sys\nn,m = list(map(int,input().split()))\nif m < 2:\n print((0))\n return\nif(1 < m < n) or 2*n > m >= n:\n print((m//2))\n return\nm -= 2*n\nprint((n+(m//4)))\n", "passed": true, "time": 0.24, "memory": 14072.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nif n*2 <= m:\n m += n*2\n print(m//4)\nelse:\n print(m//2)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "import sys\nimport math\n\nN, M = list(map(int, input().split()))\n\ncount = min(M//2, N)\nM -= count*2\nprint(count + M//4)", "passed": true, "time": 0.24, "memory": 14232.0, "status": "done"}, {"code": "import sys\nn,m = map(int,input().split())\nif m < 2:\n print(0)\n return\nif 1 < m < n:\n print(m//2)\n return\nif 2*n > m >= n:\n print(m//2)\n return\nm -= 2*n\nprint(n+(m//4))", "passed": true, "time": 0.24, "memory": 14036.0, "status": "done"}, {"code": "s, c = map(int,input().split())\n\ncnt = 0\nif 2*s <= c:\n cnt += s\n c -= 2*s\nelse:\n cnt += c // 2\n c = 0\n\ncnt += c//4\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14096.0, "status": "done"}, {"code": "S, C = map(int, input().split())\n\nans = min(S, C // 2)\nS -= ans\nC -= ans * 2\nif C >= 4:\n ans += C // 4\nprint(ans)", "passed": true, "time": 0.15, "memory": 14356.0, "status": "done"}, {"code": "n,m = map(int, input().split())\nans = 0\n\nif m >= 2 and n > 0:\n ans += min(n, m // 2)\n m -= 2*ans\n\nif m > 0:\n ans += m // 4\nprint(ans)", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "n,m = list(map(int,input().split()))\nif m//2 >=n:\n print((n+(m//2-n)//2))\nelse:\n print((m//2))\n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nif N*2 >= M:\n print((M // 2))\n return\nans = N + (M - N*2) // 4\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "n,m = map(int, input().split())\n\nif m - 2*n <0:\n print(m//2)\nelse:\n ans = n\n m -= 2*n\n ans += m//4\n print(ans)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "n,m = list(map(int,input().split()))\n\nif(2*n>=m):\n\tprint((m//2))\nelse:\n\tremaining = m- n*2\n\tans = remaining//4 + n\n\tprint(ans)\n", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "N, M= map(int, input().split())\n\nif N >= M // 2:\n print(M // 2)\n\nelse:\n m = M - N * 2\n s = m // 4\n print(N + s)", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "n,m = map(int, input().split())\n\nans = 0\nif n*2 <= m:\n ans += n\n m -= n*2\nelse:\n ans += m//2\n print(ans)\n return\n \nif 4 <= m: ans += m//4\nprint(ans)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nif 2*n >= m:\n print(m // 2)\nelse:\n print(n+((m-2*n) // 4))", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "N,M = map(int,input().rstrip().split(\" \"))\nk = N * 2 + M\nprint(min(k // 4,M//2))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "n,m=map(int,input().split())\n\nif 2*n<m:\n ans=n+(m-(2*n))//4\nelse:\n ans=m//2\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nA = 0\nif 2 * N <= M:\n A += N\n M -= 2 * N\n print((A + M // 4))\nelse:\n print((M // 2))\n", "passed": true, "time": 0.16, "memory": 14144.0, "status": "done"}, {"code": "s, c = list(map(int, input().split()))\n\nif (2 * s == c):\n ans = s\n\nelif (2 * s > c):\n ans = c // 2\n\nelse:\n ans = s\n tar = c - 2 * s\n\n ans += tar // 4\n\n\nprint((int(ans)))\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "N,M=map(int,input().split())\n\nif N >= 2*M:\n print(M//2)\n return\n \ndef f(x):\n return max(min(N+x, (M-2*x)//2),0)\n \ndelta = [-3,-2,-1,0,1,2,3]\nx = (M-2*N)//4\n\nans = 0\nfor i in range(7):\n x_ = max(0,x+delta[i])\n ans = max(ans,f(x_))\n\nprint(ans)", "passed": true, "time": 0.25, "memory": 14272.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\n\nans = 0\nif n < m:\n if 2*n <= m:\n m = m -2*n\n ans += n\n \n ans += m//4\nelse:\n ans += m//2\n\nprint(ans)\n\n", "passed": true, "time": 0.18, "memory": 14080.0, "status": "done"}, {"code": "S, C = [int(n) for n in input().split(\" \")]\n\nif 2 * S >= C:\n print(min([S, int(C/2)]))\nelse:\n print(S + int((C - 2 * S) / 4))", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "N, M = map(int, input().split())\n\nn = N\nm = M // 2\n\nans = 0\nif n >= m:\n ans += m\nelse:\n ans += n\n m -= n\n ans += m // 2\n \nprint(ans)", "passed": true, "time": 0.15, "memory": 14236.0, "status": "done"}, {"code": "s,c=map(int,input().split())\n\nif c>=s*2:\n ans=s+(c-s*2)//4\n \nelse:\n ans=c//2\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nres = 0\nif n > m // 2:\n res = m // 2\n print(res)\nelse:\n res = n\n n -= res\n m -= res * 2\n # \u3053\u3053\u3067n\u306f0\n res += m // 4\n print(res)\n", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "#n = int(input())\nn, m = list(map(int, input().split()))\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\n\nif n >= m//2:\n ans = m//2\nelse:\n m -= n*2\n ans = n + m//4\n\nprint(ans)\n", "passed": true, "time": 0.24, "memory": 14236.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nans = 0\n\nif m < n * 2:\n ans = m//2\nelse:\n ans = n + (m-n*2)//4\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nif m >= 2*n:\n rem = m - 2*n\n print((n+rem//4))\nelse:\n print((m//2))\n", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nans = 0\nif 2*n >= m:\n print(m//2)\nelse:\n ans += n\n m -= 2*n\n ans += m//4\n print(ans)", "passed": true, "time": 0.22, "memory": 14104.0, "status": "done"}, {"code": "s, c = map(int, input().split())\nprint((s + (c - s * 2) // 4, c // 2)[s * 2 >= c])", "passed": true, "time": 0.19, "memory": 14068.0, "status": "done"}, {"code": "N,M = list(map(int,input().split()))\nif 2*N >= M:\n ans = M//2\nelse:\n ans = N\n M = M - 2*N\n ans += M//4\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "n,m=map(int, input().split())\nans=0\nif n>=m//2:\n ans=m//2\nelse:\n ans=n\n m-=n*2\n ans+=m//4\nprint(ans)", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nm = (m//2) * 2\nif n > m//2:\n print(m//2)\nelse:\n print(n+(m-n*2)//4)", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "n,m = map(int, input().split())\n\nif 2*n <= m: print(n + (m-2*n)//4)\nelse: print(m//2)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nprint(min(N,M//2)+max(M-N*2,0)//4)", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nans = 0\n\nif 2*N >= M:\n ans = M//2\nelse:\n ans += N\n C = M-2*N\n ans += C//4\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nans=0\nif m >= 2 and n >= 1:\n if m//2 >= n:\n ans+=n\n m = m - n*2\n ans+= m//4\n else:\n ans+= m//2\nprint(ans)", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "N,M=list(map(int,input().split()))\nif 2*N>=M :\n print((M//2))\n return\nprint((N+(M-2*N)//4))\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 30 00:56:12 2020\n\n@author: liang\n\"\"\"\n\nN, M = map(int, input().split())\n\nif N*2 >= M:\n print(M//2)\nelse:\n print( N + (M-2*N)//4)", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\n\nif n * 2 < m:\n print(n + (m - n * 2) // 4)\nelse:\n print(m // 2)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "#\n# abc055 c\n#\n\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"1 6\"\"\"\n output = \"\"\"2\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"12345 678901\"\"\"\n output = \"\"\"175897\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n N, M = list(map(int, input().split()))\n\n if M >= 2*N:\n print((N+(M-2*N)//4))\n else:\n print((M//2))\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.2, "memory": 14500.0, "status": "done"}, {"code": "#!/usr/bin/env python\n\nn, m = list(map(int, input().split()))\n\nans = 0 \ncc = m//2\nif n >= cc: \n ans = cc\nelse:\n ans = (n+cc)//2\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "def main():\n n, m = list(map(int, input().split()))\n ans = 0\n if m >= 2*n:\n ans += n\n m -= 2*n\n n = 0\n else:\n ans += m // 2\n m -= ans * 2\n ans += m // 4\n print(ans)\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nif n * 2 >= m:\n print(m // 2)\n return\nres = n\nm -= (2 * n)\nres += (m // 4)\nprint(res)", "passed": true, "time": 0.15, "memory": 14192.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nif N <= M // 2:\n print(N + (M - 2 * N) // 4)\nelse:\n print(M // 2)", "passed": true, "time": 0.22, "memory": 14208.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nans=0\nif M>=2*N:\n ans+=N\nelse:\n ans+=M//2\n print(ans)\n return\n\nM-=2*N\nans+=M//4\nprint(ans)", "passed": true, "time": 0.23, "memory": 14196.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nprint(min(M//2,(2*N+M)//4))", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint(min(n,m//2)+(m//2-min(n,m//2))//2)", "passed": true, "time": 0.22, "memory": 14280.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\n\nif N * 2 > M:\n print((M // 2))\nelif N * 2 == M:\n print(N)\nelse:\n count = N\n M -= 2 * N\n count += (M // 4)\n print(count)\n", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "s, c = list(map(int, input().split()))\ni = min(s, c//2)\nm = i\ns -= i\nc -= i*2\nif s == 0:\n m += c//4\n# print(s,c)\nprint(m)\n", "passed": true, "time": 0.14, "memory": 14380.0, "status": "done"}, {"code": "N,M=map(int,input().split())\n#S=N,C=M\nprint(min(((2*N)+M)//4,M//2))", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nif N*2 > M:\n print(M//2)\nelse:\n M -= N*2\n print(N+M//4)", "passed": true, "time": 0.22, "memory": 14296.0, "status": "done"}, {"code": "import sys\n\nN, M=list(map(int,input().split()))\nMh=M//2\n\nif N>Mh:\n print(Mh)\n return\nelse:\n rem=M-2*N\n print((rem//4+N))\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nif 2 * n >= m:\n print((m // 2))\nelse:\n print((n + (m-(2*n))//4))\n", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N, M = map(int, input().split())\n\nif N < M:\n print(N + (M - 2 * N) // 4)\nelse:\n print(M // 2)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "s, c = map(int, input().split())\nans = 0\nans += min(s,c//2)\nres = c-min(s,c//2)*2\nans += res//4\nprint(ans)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "N, M = map(int, input().split())\n\nans = 0\nif(M//2 >= N):\n ans += N\n M = M - N*2 \n ans += M//4\n \nelse:\n ans += M//2\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}]
[{"input": "1 6\n", "output": "2\n"}, {"input": "12345 678901\n", "output": "175897\n"}]
4,698
Joisino is about to compete in the final round of a certain programming competition. In this contest, there are N problems, numbered 1 through N. Joisino knows that it takes her T_i seconds to solve problem i(1≦i≦N). Also, there are M kinds of drinks offered to the contestants, numbered 1 through M. If Joisino takes drink i(1≦i≦M), her brain will be stimulated and the time it takes for her to solve problem P_i will become X_i seconds. It does not affect the time to solve the other problems. A contestant is allowed to take exactly one of the drinks before the start of the contest. For each drink, Joisino wants to know how many seconds it takes her to solve all the problems if she takes that drink. Here, assume that the time it takes her to solve all the problems is equal to the sum of the time it takes for her to solve individual problems. Your task is to write a program to calculate it instead of her. -----Constraints----- - All input values are integers. - 1≦N≦100 - 1≦T_i≦10^5 - 1≦M≦100 - 1≦P_i≦N - 1≦X_i≦10^5 -----Input----- The input is given from Standard Input in the following format: N T_1 T_2 ... T_N M P_1 X_1 P_2 X_2 : P_M X_M -----Output----- For each drink, calculate how many seconds it takes Joisino to solve all the problems if she takes that drink, and print the results, one per line. -----Sample Input----- 3 2 1 4 2 1 1 2 3 -----Sample Output----- 6 9 If Joisino takes drink 1, the time it takes her to solve each problem will be 1, 1 and 4 seconds, respectively, totaling 6 seconds. If Joisino takes drink 2, the time it takes her to solve each problem will be 2, 3 and 4 seconds, respectively, totaling 9 seconds.
introductory
[{"code": "N = int(input())\nT = [int(TN) for TN in input().split()]\nSumT = sum(T)\nM = int(input())\nPX = [[] for TM in range(0,M)]\nfor TM in range(0,M):\n PX[TM] = [int(TPX) for TPX in input().split()]\nfor TM in range(0,M):\n print(SumT-T[PX[TM][0]-1]+PX[TM][1])", "passed": true, "time": 0.15, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\nli = list(map(int,input().split()))\nm = int(input())\nc = sum(li)\nfor i in range(m):\n a,b = map(int,input().split())\n print(c-li[a-1]+b)", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "N=int(input())\nT=list(map(int,input().split()))\nM=int(input())\nP=[list(map(int, input().split())) for i in range(M)]\ntmp=0\nans=0\n\nfor i in range(M):\n tmp=0\n for j in range(len(T)):\n if j == P[i][0]-1:\n tmp +=P[i][1]\n else:\n tmp +=T[j]\n print(tmp)", "passed": true, "time": 0.16, "memory": 14244.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nm = int(input())\ndr = [None] * m\ntime = sum(t)\nfor i in range(m):\n p, x = list(map(int, input().split()))\n p -= 1\n ans = time - t[p] + x\n print(ans)\n", "passed": true, "time": 0.35, "memory": 14140.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nnum_drink = int(input())\n\nfor i in range(num_drink):\n P,X = map(int,input().split())\n A = a.copy()\n A[P-1] = X\n print(sum(A))", "passed": true, "time": 1.68, "memory": 14328.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int,input().split()))\nM = int(input())\nfor i in range(M):\n Pi,Xi=map(int,input().split())\n a = T[Pi-1]\n T[Pi-1] = Xi\n b = 0\n for j in range(N):\n b = b + T[j]\n print(b)\n T[Pi-1] = a", "passed": true, "time": 0.17, "memory": 14128.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nm = int(input())\np = [list(map(int,input().split())) for i in range(m)]\nans = []\nfor num in p:\n print(sum(t) - t[num[0]-1] + num[1])", "passed": true, "time": 0.17, "memory": 14308.0, "status": "done"}, {"code": "n=int(input())\nl=[0]+list(map(int,input().split()))\nans=sum(l)\nfor i in range(int(input())):\n a,s=list(map(int,input().split()))\n print((ans-l[a]+s))\n", "passed": true, "time": 0.86, "memory": 14256.0, "status": "done"}, {"code": "n = int(input())\ndata_1 = list(map(int,input().split()))\nm = int(input())\ndata_2 = [input().split() for i in range(m)]\n\n\nfor i in range(m):\n sum = 0\n b = int(data_2[i][0]) - 1\n a = data_1[b]\n data_1[b] = int(data_2[i][1])\n for j in range(n):\n sum += data_1[j]\n print(sum)\n data_1[b] = a", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "n = int(input())\nT = list(map(int, input().split()))\nm = int(input())\n\nsum_T = sum(T)\n\nfor i in range(m):\n p,x = list(map(int, input().split()))\n ans = sum_T - T[p-1] + x\n print(ans)\n\n", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "num_problems = int(input())\nt = [int(n) for n in input().split()]\ntotal = sum(t)\nnum_drinks = int(input())\n\nfor i in range(num_drinks):\n m_id, m_val = [int(n) for n in input().split()]\n ans = total - t[m_id-1] + m_val\n print(ans)\n", "passed": true, "time": 0.17, "memory": 14292.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nm = int(input())\n\nfor i in range(m):\n p, x = map(int, input().split())\n a = t[p-1]\n t[p-1] = x\n print(sum(t))\n t[p-1] = a", "passed": true, "time": 0.31, "memory": 14296.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int,input().split()))\nM = int(input())\n\nfor m in range(M):\n P,X = list(map(int,input().split()))\n T_ans = T.copy()\n T_ans[P-1] = X\n print((sum(T_ans)))\n", "passed": true, "time": 0.17, "memory": 14040.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int,input().split()))\nm = int(input())\ns = sum(t)\nfor i in range(m):\n p,x = map(int,input().split())\n print(s-t[p-1]+x)", "passed": true, "time": 0.17, "memory": 14264.0, "status": "done"}, {"code": "N = int(input())\ntimes = list(map(int, input().split()))\n\nM = int(input())\ndrinks = [tuple(map(int, input().split()))\n for _ in range(M)]\n\ntime_sum_raw = sum(times)\nfor pi, xi in drinks:\n print((time_sum_raw - times[pi - 1] + xi))\n", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "import copy\nn = int(input())\nt = [int(x) for x in input().split()]\nm = int(input())\nfor i in range(m):\n p, x = map(int, input().split())\n t_temp = copy.copy(t)\n t_temp[p - 1] = x\n print(sum(t_temp))", "passed": true, "time": 0.15, "memory": 14040.0, "status": "done"}, {"code": "n = int(input())\ntimes = list(map(int, input().split()))\nm = int(input())\ndrinks = []\nfor _ in range(m):\n drink = list(map(int, input().split()))\n drinks.append(drink)\n\nfor drink in drinks:\n time = 0\n copy = times.copy()\n copy[drink[0]-1] = drink[1]\n for i in copy:\n time += i\n print(time)", "passed": true, "time": 0.23, "memory": 14160.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nm = int(input())\nfor i in range(m):\n p,x = map(int, input().split())\n print(sum(t)-t[p-1]+x)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nm = int(input())\npx = [list(map(int, input().split())) for _ in range(m)]\nfor i in range(m):\n p, x = px[i][0], px[i][1]\n p -= 1\n cnt = 0\n for j in range(n):\n if p == j:\n cnt += x\n else :\n cnt += t[j]\n print(cnt)\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nm = int(input())\np = [0 for _ in range(m)]\nx = [0 for _ in range(m)]\nfor i in range(m):\n p[i], x[i] = map(int, input().split())\n\ntemp = sum(t)\n\nfor i in range(m):\n print(temp + (x[i] - t[p[i]-1]))", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\ns = sum(t)\nm = int(input())\nfor i in range(m):\n p, x = list(map(int, input().split()))\n print((s - t[p -1] + x))\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n = int(input())\nt_lst = list(map(int, input().split()))\nm = int(input())\n\nfor i in range(m):\n p, x = list(map(int, input().split()))\n count = 0\n for j in range(n):\n if j == p-1:\n count += x\n else:\n count += t_lst[j]\n print(count)\n\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\ntotal = sum(t)\nm = int(input())\nfor i in range(m):\n p, x = map(int, input().split())\n p -= 1\n print(total - t[p] + x)", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "N=int(input())\nT=input()\nM=int(input())\nP=[input() for i in range(M)]\n\ndef ans050(N:int, T:str, M:int, P:list):\n T_list=list(map(int,T.split()))\n ans_list=[]\n for i in range(M):\n T_list = list(map(int, T.split()))\n P_list=list(map(int,P[i].split()))\n del T_list[P_list[0]-1]\n T_list.append(P_list[1])\n ans_list .append(sum(T_list))\n return ans_list\nfor i in range(M):\n print((ans050(N,T,M,P))[i])", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "n=int(input())\nt=list(map(int,input().split()))\nm=int(input())\nfor j in range(m):\n ans=0\n p,x=map(int,input().split())\n for k in range(n):\n if p==k+1:\n ans += x\n else:\n ans += t[k]\n print(ans)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int, input().split()))\nM = int(input())\nfor i in range(M):\n P, X = list(map(int, input().split()))\n Y = T[P-1]\n T[P-1] = X\n print((sum(T)))\n T[P-1] = Y\n", "passed": true, "time": 0.23, "memory": 14340.0, "status": "done"}, {"code": "n = int(input())\narr = list(map(int, input().split()))\nm = int(input())\n\nfor _ in range(m):\n p, x = list(map(int, input().split()))\n print((sum(arr[0:p - 1]) + sum(arr[p:]) + x))\n", "passed": true, "time": 0.23, "memory": 14320.0, "status": "done"}, {"code": "import sys,bisect\n\nfrom sys import stdin,stdout\n\nfrom bisect import bisect_left,bisect_right,bisect,insort,insort_left,insort_right\n\nfrom math import gcd,ceil,floor,sqrt\n\nfrom collections import Counter,defaultdict,deque,OrderedDict\n\nfrom queue import Queue,PriorityQueue\n\nfrom string import ascii_lowercase\n\n\nsys.setrecursionlimit(10**6)\nINF = float('inf')\nMOD = 998244353\nmod = 10**9+7\n\ndef isPrime(n):\n if (n <= 1) :return False\n if (n <= 3) :return True\n if (n%2 == 0 or n%3 == 0):return False\n for i in range(5,ceil(sqrt(n))+1,6):\n if (n%i==0 or n%(i+2)==0):\n return False\n return True\n\ndef st():\n return list(stdin.readline().strip())\n\ndef inp():\n return int(stdin.readline())\n\ndef li():\n return list(map(int,stdin.readline().split()))\n\ndef mp():\n return list(map(int,stdin.readline().split()))\n\ndef pr(n):\n stdout.write(str(n)+\"\\n\")\n \ndef DFS(dictionary,vertex,visited):\n visited[vertex]=True\n stack=[vertex]\n print(vertex)\n while stack:\n a=stack.pop()\n for i in dictionary[a]:\n if not visited[i]:\n print(i)\n visited[i]=True\n stack.append(i)\n\n\ndef BFS(dictionary, vertex,visited):\n visited[vertex]=True\n q=deque()\n q.append(vertex)\n while q:\n a=q.popleft()\n for i in dictionary[a]:\n if not visited[i]:\n visited[i]=True\n q.append(i)\n print(i)\n\n \n\n\ndef soe(limit):\n l=[1]*(limit+1)\n l[0]=0\n l[1]=0\n prime=[]\n for i in range(2,limit+1):\n if l[i]:\n for j in range(i*i,limit+1,i):\n l[j]=0\n \n for i in range(2,limit+1):\n if l[i]:\n prime.append(i)\n return prime\n\ndef segsoe(low,high):\n limit=int(high**0.5)+1\n prime=soe(limit)\n n=high-low+1\n l=[0]*(n+1)\n for i in range(len(prime)):\n lowlimit=(low//prime[i])*prime[i]\n if lowlimit<low:\n lowlimit+=prime[i]\n if lowlimit==prime[i]:\n lowlimit+=prime[i]\n for j in range(lowlimit,high+1,prime[i]):\n l[j-low]=1\n for i in range(low,high+1):\n if not l[i-low]:\n if i!=1:\n print(i)\n \ndef gcd(a,b):\n while b:\n a=a%b\n b,a=a,b\n return a\n\ndef power(a,n):\n r=1\n while n:\n if n&1:\n r=(r*a)\n a*=a\n n=n>>1\n return r\n \n \ndef solve():\n n=inp()\n l=li()\n s=sum(l)\n d={i+1:l[i] for i in range(n)}\n m=inp()\n for i in range(m):\n x=s\n a,b=mp()\n x-=d[a]\n x+=b\n pr(x)\n\n\nfor _ in range(1):\n solve()\n \n", "passed": true, "time": 0.14, "memory": 14400.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int, input().split()))\nM = int(input())\nP = []\nX = []\nfor i in range(M):\n p, x = list(map(int, input().split()))\n P.append(p)\n X.append(x)\n\nSum = sum(T)\nfor i in range(M):\n print((Sum - T[P[i] - 1] + X[i]))\n", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "input();t=list(map(int,input().split()));T=sum(t)\nprint(*[T-t[i-1]+j for i,j in [list(map(int,input().split())) for _ in range(int(input()))]],sep='\\n')", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "n = int(input())\ntl = list(map(int, input().split()))\ntime = sum(tl)\nm = int(input())\n\nfor _ in range(m):\n p, x = list(map(int, input().split()))\n print((time - (tl[p-1]-x)))\n", "passed": true, "time": 0.22, "memory": 14288.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nn=int(input())\nt=list(map(int,input().split()))\nm=int(input())\nfor _ in range(m):\n p,x=map(int,input().split())\n t_true=t[p-1]\n t[p-1]=x\n print(sum(t))\n t[p-1]=t_true", "passed": true, "time": 0.15, "memory": 14280.0, "status": "done"}, {"code": "N = input()\nT = [int(x) for x in input().split()]\nM = int(input())\nDrink = [tuple(map(int,input().split())) for _ in range(M)]\nsumT = sum(T)\nfor p,x in Drink:\n print(sumT-T[p-1]+x)", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n=int(input())\nl=list(map(int,input().split()))\nm=int(input())\n\nsum_l=sum(l)\n\nfor i in range(m):\n p,x=list(map(int,input().split()))\n ans=sum_l-l[p-1]+x\n print(ans)\n", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "n = int(input())\nt_lst = list(map(int, input().split()))\nm = int(input())\npx_lst = [list(map(int, input().split())) for _ in range(m)]\n\ntime_lst = []\nfor i in range(m):\n problem = px_lst[i][0] - 1\n time = px_lst[i][1]\n before = t_lst[problem]\n t_lst[problem] = time\n time_lst.append(sum(t_lst))\n t_lst[problem] = before\n\nfor i in range(m):\n print(time_lst[i])", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "import copy\n\ndef main():\n N = int(input())\n T = list(map(int, input().split()))\n M = int(input())\n PX = []\n for i in range(M):\n P, X = list(map(int, input().split()))\n tmp = copy.copy(T)\n tmp[P-1] = X\n print((sum(tmp)))\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "import copy\nn = int(input())\nli = list(map(int,input().split()))\nlis = copy.copy(li)\nm = int(input())\ndri = [list(map(int,input().split())) for i in range(m)]\nfor i in range(len(dri)):\n lis = copy.copy(li)\n lis[dri[i][0]-1] = dri[i][1]\n print(sum(lis))", "passed": true, "time": 0.22, "memory": 14200.0, "status": "done"}, {"code": "a=int(input())\nb=list(map(int,input().split()))\nc=int(input())\nd=[input().split() for i in range(c)]\nfor i in range(c):\n print(sum(b)-b[int(d[i][0])-1]+int(d[i][1]))", "passed": true, "time": 0.22, "memory": 14096.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nN = int(input())\nT = list(map(int, input().split()))\nM = int(input())\nP = [0] * M\nX = [0] * M\nfor i in range(M):\n P[i], X[i] = list(map(int, input().split()))\n\nfor i in range(M):\n ans = 0\n ans += sum(T[:P[i] - 1])\n ans += X[i]\n ans += sum(T[P[i]:])\n print(ans)\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int,input().split()))\n\nt_sum = sum(T)\n\nM = int(input())\nfor _ in range(M):\n P,X = map(int,input().split())\n print(t_sum - (T[P-1] - X))", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int, input().split()))\nM = int(input())\nfor n in range(M):\n P, X = map(int, input().split())\n T_copied = T.copy()\n T_copied[P-1] = X\n print(sum(T_copied))", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int,input().split()))\nm = int(input())\na,b = 0,0\nfor _ in range(m):\n a,b = map(int,input().split())\n print(sum(t) - t[a-1] + b)", "passed": true, "time": 0.16, "memory": 14272.0, "status": "done"}, {"code": "n = int(input())\nt = tuple(map(int,input().split()))\nm = int(input())\nx = [list(map(int,input().split())) for _ in range(m)]\n\ni = 0\nfor x[i] in x:\n l = list(t)\n j = x[i][0] - 1 #\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\n k = x[i][1] #\u7f6e\u63db\u5143\n i += i\n l[j] = k\n print(sum(l))", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\nt = [int(i) for i in input().split()] #\u5206\u5272\u3057\u305f\u6587\u5b57\u5217\u3092\u9806\u7e70\u308a\u306bint\u306b\u5909\u63db\u3057\u3066\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0\nm = int(input())\n\nfor i in range(m):\n sum = 0\n count = 1\n p, x = list(map(int, input().split()))\n for j in t:\n if(p == count):\n sum += x\n else:\n sum += j\n count += 1\n print(sum)\n", "passed": true, "time": 0.15, "memory": 14140.0, "status": "done"}, {"code": "n = int(input())\nt = [int(s) for s in input().split()]\nm = int(input())\ntotal = sum(t)\nans = []\nfor i in range(m):\n p, x = map(int, input().split())\n ans.append(total - t[p - 1] + x)\n\nfor a in ans:\n print(a)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "a=int(input())\nb=list(map(int,input().split()))\nc=int(input())\nd=[]\nfor i in range(c):\n d.append(list(map(int,input().split())))\n\nfor i in range(c):\n f=b.copy()\n p=d[i][0]-1\n f[p]=d[i][1]\n print((sum(f)))\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nst = sum(t)\nm = int(input())\nfor i in range(m):\n p, x = list(map(int, input().split()))\n print((st - t[p - 1] + x))\n", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "import copy\nn = int(input())\nT = list(map(int,input().split()))\nm = int(input())\n\nfor _ in range(m):\n A = copy.copy(T)\n a,b = map(int,input().split())\n A[a-1] = b\n print(sum(A))", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "# N\u554f\u306e\u554f\u984c\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\nN = int(input())\n# \u554f\u984c\u3092\u89e3\u304f\u306e\u306b\u304b\u304b\u308b\u6642\u9593\nT = list(map(int, input().split()))\n\n# \u30c9\u30ea\u30f3\u30af\u306e\u7a2e\u985eM\nM = int(input())\n# \u30c9\u30ea\u30f3\u30af\u3092\u98f2\u3093\u3060\u5834\u5408\u306e\u6642\u9593\u3092\u30ea\u30b9\u30c8\u306b\u683c\u7d0d\u3059\u308b\nX = []\n\n# \u307e\u305a\u306f\u30c9\u30ea\u30f3\u30af\u3092\u98f2\u3093\u3060\u5834\u5408\u306e\u6642\u9593\u3092X\u306b\u683c\u7d0d\u3059\u308b\nfor i in range(M):\n X.append(list(map(int,input().split())))\n X[i][0] = X[i][0]-1\n\nY = []\n# \u305d\u308c\u305e\u308c\u306e\u554f\u984c\u306e\u89e3\u304f\u6642\u9593\u3092\u53d6\u5f97\u3059\u308b\nfor i in range(N):\n Y.append(T[i])\n \nfor i in range(len(X)):\n Y_copy = Y.copy()\n Y_copy[X[i][0]] = X[i][1]\n print(sum(Y_copy))", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "n = int(input())\np = list(map(int, input().split()))\nk = int(input())\nfor i in range(k):\n a, b = list(map(int, input().split()))\n c = p[a-1]\n p[a-1] = b\n print((sum(p)))\n p[a-1] = c\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "quiznum=int(input())\ntimeline=input().split(\" \")\ntimeline=[int(n) for n in timeline]\n#print(timeline)\ntime_0=0\nfor i in range(quiznum):\n time_0+=timeline[i]\n#print(time_0)\n\nmedinum=int(input())\nfor i in range(medinum):\n temp_line=input().split(\" \")\n a=int(temp_line[0])\n b=int(temp_line[1])\n time=time_0 - timeline[a-1] + b\n print(time)", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "n = int(input())\nts = list(map(int, input().split()))\nm = int(input())\nfor i in range(m):\n p, x = map(int, input().split())\n print(sum(ts) - ts[p-1] + x)", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "n=int(input())\nt=list(map(int,input().split()))\nm=int(input())\nfor i in range(m):\n p,x=map(int,input().split())\n print(sum(t)-(t[p-1]-x))", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nm = int(input())\n\nfor i in range(m):\n p,x = list(map(int, input().split()))\n print((sum(t) - t[p-1] + x))\n", "passed": true, "time": 0.19, "memory": 14216.0, "status": "done"}, {"code": "#-*-coding:utf-8-*-\nimport sys\ninput=sys.stdin.readline\nimport copy\n\ndef main():\n questions=[]\n dp=[]\n n = int(input())\n questions=list(map(int,input().split()))\n m = int(input())\n drinks=[list(map(int,input().split())) for _ in range(m)]\n for drink in drinks:\n dp=copy.deepcopy(questions)\n dp[drink[0]-1]=drink[1]\n print(sum(dp))\n \ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 14124.0, "status": "done"}, {"code": "n = int(input())\nt = [0] + list(map(int, input().split()))\ns = sum(t)\nm = int(input())\nfor _ in range(m):\n p,x = list(map(int, input().split()))\n print((s - t[p] + x))\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int, input().split()))\nM = int(input())\nP, X = [0] * M, [0] * M\nfor i in range(M):\n P[i], X[i] = map(int, input().split())\n\nfor i in range(M):\n t_sum = X[i]\n for j in range(N):\n if j == P[i] - 1:\n continue\n t_sum += T[j]\n print(t_sum)", "passed": true, "time": 0.17, "memory": 14164.0, "status": "done"}, {"code": "n=int(input())\ntl=list(map(int,input().split()))\nm=int(input())\npxl=[list(map(int,input().split())) for _ in range(m)]\ns=sum(tl)\nfor p,x in pxl:\n print((s-tl[p-1]+x))\n", "passed": true, "time": 0.52, "memory": 14076.0, "status": "done"}, {"code": "n=int(input())\nt=list(map(int,input().split()))\nfor _ in range(int(input())):\n p,x=map(int,input().split())\n ans=0\n for i in range(n):\n if p-1==i:\n ans+=x\n else:\n ans+=t[i]\n print(ans)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "n=int(input())\nt=list(map(int,input().split()))\nm=int(input())\nfor i in range(m):\n p,x=map(int,input().split())\n y=t[p-1]\n t[p-1]=x\n print(sum(t))\n t[p-1]=y", "passed": true, "time": 0.22, "memory": 14196.0, "status": "done"}, {"code": "input();t=[*map(int,input().split())];T=sum(t)\nprint(*[T-t[i-1]+j for i,j in [[*map(int,input().split())] for _ in range(int(input()))]],sep='\\n')", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int, input().split()))\nM = int(input())\nfor i in range(M):\n p, x = list(map(int, input().split()))\n s = sum(T) - T[p-1] + x\n print(s)\n \n", "passed": true, "time": 0.15, "memory": 14328.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nm = int(input())\nfor i in range(m):\n p, x = map(int, input().split())\n s = t[p-1]\n t[p-1] = x\n print(sum(t))\n t[p-1] = s", "passed": true, "time": 0.22, "memory": 14192.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int, input().split()))\nans = sum(T)\nM = int(input())\nfor i in range(M):\n P, X = map(int, input().split())\n print(ans - T[P-1] + X)", "passed": true, "time": 0.18, "memory": 14304.0, "status": "done"}, {"code": "N=int(input())\nT=list(map(int,input().split()))\nM=int(input())\ndrink=[]\nfor i in range(M):\n P,X=map(int,input().split())\n drink.append([P,X])\n \nfor j in range(len(drink)):\n P,X=drink[j]\n time=X+sum(T)-T[P-1]\n print(time)", "passed": true, "time": 0.16, "memory": 14076.0, "status": "done"}, {"code": "import copy\n\nn = int(input())\nt = [int(x) for x in input().split()]\nm = int(input())\np = []\nfor i in range(m):\n p.append([int(x) for x in input().split()])\n\nfor i in range(m):\n r = copy.copy(t)\n r[p[i][0]-1] = p[i][1]\n print(sum(r))", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "import copy\nn=int(input())\nt=list(map(int,input().split()))\nm=int(input())\nfor i in range(m):\n a,b=map(int,input().split())\n total=copy.copy(t)\n total[a-1]=b\n print(sum(total))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int,input().split()))\nm = int(input())\nfor i in range(m):\n p,x = list(map(int,input().split()))\n save = t[p-1]\n t[p-1] = x\n print((sum(t)))\n t[p-1] = save\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n=int(input())\nt =list(map(int, input().split()))\nm=int(input())\nfor i in range(m):\n p,x=map(int,input().split())\n q = sum(t) - (t[p-1] - x)\n print(q)", "passed": true, "time": 0.16, "memory": 14116.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nm = int(input())\nfor i in range(m):\n p, x = map(int, input().split())\n print(sum(t) - t[p-1] + x)", "passed": true, "time": 0.22, "memory": 14212.0, "status": "done"}, {"code": "N=int(input())#\u554f\u984c\u306e\u6570\nT=list(map(int,input().split()))#\u554f\u984c\u3092\u89e3\u304f\u306e\u306b\u304b\u304b\u308b\u6642\u9593\nM=int(input())#\u30c9\u30ea\u30f3\u30af\u306e\u7a2e\u985e\u306e\u6570\nfor i in range(1,M+1):\n tmp=list(map(int,input().split()))\n tmp2=T[tmp[0]-1]\n T[tmp[0]-1]=tmp[1]\n print(sum(T))\n T[tmp[0]-1]=tmp2", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int, input().split()))\nsumT = sum(T)\nM = int(input())\nfor i in range(M):\n P, X = map(int, input().split())\n ans = sumT-T[P-1]+X\n print(ans)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "N = int(input())\nT = input().split()\nM = int(input())\n\nfor i in range(N):\n T[i] = int(T[i])\n\nS = sum(T)\n\nfor i in range(M):\n l = input().split()\n print(S - (T[int(l[0]) - 1] - int(l[1])))", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int, input().split()))\nM = int(input())\nL = []\nres = []\nfor i in range(M):\n P, X = list(map(int, input().split()))\n buf = []\n for j in range(len(T)):\n if P == j+1:\n buf.append(X)\n else:\n buf.append(T[j])\n res.append(sum(buf))\n\nfor i in res:\n print(i)\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nm = int(input())\na = []\nfor _ in range(m):\n p, x = map(int, input().split())\n u = t[:]\n u[p - 1] = x\n a.append(sum(u))\nfor i in range(m):\n print(a[i])", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "n=int(input())\nt=list(map(int,input().split()))\nm=int(input())\npx=[]\nfor _ in range(m):\n p,x=map(int,input().split())\n px.append((p-1,x))\nfor i in range(m):\n ans=0\n p,x=px[i]\n for j in range(n):\n if j==p:\n ans+=x\n else:\n ans+=t[j]\n print(ans)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n,t=int(input()),list(map(int,input().split()));T=sum(t)\nprint(*[T-t[i-1]+j for i,j in [list(map(int,input().split())) for _ in range(int(input()))]],sep='\\n')", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "n = input()\nt_raw = list(map(int, input().split()))\nm = int(input())\nfor _ in range(m):\n t = t_raw.copy()\n p, x = map(int, input().split())\n t[p-1] = x\n print(sum(t))", "passed": true, "time": 0.15, "memory": 14068.0, "status": "done"}, {"code": "N = int(input())\n*T, = map(int, input().split())\nM = int(input())\npx = [list(map(int, input().split())) for _ in range(M)]\n\nfor i in range(M):\n pi = px[i][0] - 1\n print(sum(T) - T[pi] + px[i][1])", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "N = int(input())\ntimes = list(map(int,input().split()))\nM = int(input())\ndrinks = []\nfor _ in range(M):\n drinks.append(list(map(int,input().split())))\n\nfor drink in drinks:\n total = 0\n for j in range(N):\n if drink[0] == j+1:\n total += drink[1]\n else:\n total += times[j]\n print(total)", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "n=int(input())\nt=list(map(int,input().split()))\nm=int(input())\ns=sum(t)\nfor i in range(m):\n p,x=map(int,input().split())\n print(s+x-t[p-1])", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int, input().split()))\nm = int(input())\ndrink = [list(map(int, input().split())) for _ in range(m)]\nfor p, x in drink:\n print((sum(t) - t[p - 1] + x))\n", "passed": true, "time": 0.23, "memory": 14124.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int, input().split()))\nM = int(input())\nL = []\nfor _ in range(M):\n p, x = list(map(int, input().split()))\n L.append([p, x])\n\nfor i in range(M):\n sum_num = 0\n for j in range(N):\n if L[i][0] - 1 == j:\n sum_num += L[i][1]\n else:\n sum_num += T[j]\n print(sum_num)\n", "passed": true, "time": 0.22, "memory": 14232.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int,input().split()))\nM =int(input())\npx = [list(map(int,input().split())) for i in range(M)]\n\nsumTime = sum(T)\n\nfor i in range(M):\n print(sumTime-T[px[i][0]-1]+px[i][1])", "passed": true, "time": 0.24, "memory": 14220.0, "status": "done"}, {"code": "n = int(input())\ntimeList = list(map(int, input().split()))\nm = int(input())\nargList = [list(map(int, input().split())) for _ in range(m)]\n\n#\u666e\u901a\u306b\u3084\u308b\u3068\nres_time = sum(timeList)\n\nfor a in argList:\n\n #a[0]\u554f\u76ee\u3092\u89e3\u304f\u306e\u306b\u3000a[1]\u79d2\u304b\u304b\u308b\u3088\n print((res_time - timeList[a[0]-1] + a[1]))\n\n", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "n = int(input())\n\nt = list(map(int,input().split()))\n\nm = int(input())\n\nfor i in range(m):\n\tp,x = list(map(int,input().split()))\n\ttmpt = t[p-1] \n\tt[p-1] = x\n\tprint((sum(t)))\n\tt[p-1] = tmpt\n\t\n", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "N = int(input())\nli = list(map(int, input().split()))\nM = int(input())\nan = sum(li)\nfor i in range(M):\n p,x = map(int, input().split())\n h = x - li[p-1]\n print(sum(li) + h)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "N=int(input())\nT=list(map(int,input().split()))\nM=int(input())\nx=sum(T)\nfor _ in range(M):\n P,X=list(map(int,input().split()))\n print((x+X-T[P-1]))\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lint_dec(): return list(map(lambda x:int(x) - 1, input().split()))\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nN = ii()\nT = lint()\nM = ii()\ntotal = sum(T)\n\nfor _ in range(M):\n P, X = lint()\n print(total - T[P - 1] + X)", "passed": true, "time": 0.45, "memory": 14196.0, "status": "done"}, {"code": "n = int(input())\nt_l = list(map(int, input().split()))\nm = int(input())\nimport copy\nfor _ in range(m):\n k, v = map(int, input().split())\n tmp_t = copy.deepcopy(t_l)\n tmp_t[k-1] = v\n print(sum(tmp_t))", "passed": true, "time": 0.15, "memory": 14048.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int,input().split()))\nm = int(input())\npx = [list(map(int,input().split())) for _ in range(m)]\nfor i in px:\n print((sum(t) - t[i[0]-1] + i[1]))\n", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int,input().split()))\nm = int(input())\nfor i in range(m):\n a,b = map(int,input().split())\n T = sum(t) - t[a-1] + b\n print(T)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int,input().split()))\nM = int(input())\nans = sum(T)\ncopy = ans\nfor i in range(M):\n p,x = list(map(int,input().split()))\n p -= 1\n ans -= T[p]\n ans += x\n print(ans)\n ans = copy\n\n \n", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "N = int(input())\n\nT = list(map(int, input().split()))\nM = int(input())\n\nfor _ in range(M):\n p, x = tuple(map(int, input().split()))\n tmp_num = T[p-1]\n T[p-1] = x\n print(sum(T))\n T[p-1] = tmp_num", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "N = int(input())\nT = list(map(int,input().split()))\nsum = 0\nfor _ in range(N):\n sum += T[_] \nM = int(input())\nfor i in range(M):\n a,b = list(map(int,input().split()))\n print((sum + b - T[a - 1]))\n \n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n = int(input())\nt = list(map(int,input().split()))\ns = sum(t)\nm = int(input())\nfor i in range(m):\n p,x = map(int,input().split())\n print(s+(x-t[p-1]))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "from typing import List\n\n\ndef answer(n: int, t: List[int], m: int, pxs: List[List[int]]) -> str:\n result = []\n for px in pxs:\n t_copy = t.copy()\n t_copy[px[0] - 1] = px[1]\n result.append(str(sum(t_copy)))\n\n return '\\n'.join(result)\n\n\ndef main():\n n = int(input())\n t = list(map(int, input().split()))\n m = int(input())\n pxs = [list(map(int, input().split())) for _ in range(m)]\n print((answer(n, t, m, pxs)))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 15156.0, "status": "done"}, {"code": "n = int(input())\nT = list(map(int, input().split()))\nm = int(input())\nD = [tuple(map(int, input().split())) for _ in range(m)]\n\nsum_T = sum(T)\nfor i in range(m):\n print((sum_T - T[D[i][0] - 1] + D[i][1]))\n", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}]
[{"input": "3\n2 1 4\n2\n1 1\n2 3\n", "output": "6\n9\n"}, {"input": "5\n7 2 3 8 5\n3\n4 2\n1 7\n4 13\n", "output": "19\n25\n30\n"}]
4,699
Iroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K. She is shopping, and now paying at the cashier. Her total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change). However, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money. Find the amount of money that she will hand to the cashier. -----Constraints----- - 1 ≦ N < 10000 - 1 ≦ K < 10 - 0 ≦ D_1 < D_2 < … < D_K≦9 - \{D_1,D_2,...,D_K\} ≠ \{1,2,3,4,5,6,7,8,9\} -----Input----- The input is given from Standard Input in the following format: N K D_1 D_2 … D_K -----Output----- Print the amount of money that Iroha will hand to the cashier. -----Sample Input----- 1000 8 1 3 4 5 6 7 8 9 -----Sample Output----- 2000 She dislikes all digits except 0 and 2. The smallest integer equal to or greater than N=1000 whose decimal notation contains only 0 and 2, is 2000.
introductory
[{"code": "import itertools\n\ndef cal(N, target_num, keta):\n answer = float('inf')\n for p in itertools.product(target_num, repeat=keta):\n temp = 0\n for i, num in enumerate(p):\n temp += num * 10**i\n \n if temp >= N:\n answer = min(answer, temp)\n\n return answer\n\ndef __starting_point():\n N, K = map(int, input().split()) # N\u5186\u306e\u54c1\u7269\u3001K\u500b\u306e\u5acc\u3044\u306a\u6570\u5b57\n D = set(list(map(int, input().split()))) # \u5acc\u3044\u306a\u6570\u5b57\u306e\u30ea\u30b9\u30c8\n base = set(range(10))\n\n target_num = base - D\n keta = len(str(N))\n\n answer = min(cal(N, target_num, keta), cal(N, target_num, keta+1))\n\n print(answer)\n__starting_point()", "passed": true, "time": 0.33, "memory": 14132.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nunlike_list = set(map(str, input().split()))\n\ndef judge(num):\n for i in str(num):\n if i in unlike_list:\n return False\n return True\n\nans = False\nwhile not ans:\n if judge(N):\n ans = True\n else:\n N += 1\n\nprint(N)", "passed": true, "time": 0.15, "memory": 14096.0, "status": "done"}, {"code": "n, k = list(map(int,input().split()))\nd = list(map(int,input().split()))\n\nwhile n < 10**5:\n x = str(n)\n if all(int(i) not in d for i in x):\n print(n)\n return\n n += 1\n", "passed": true, "time": 1.64, "memory": 14212.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nd = list(input().split())\nans = n\nfind = False\nwhile find == False:\n p = str(ans)\n find = True\n for i in range(len(p)):\n if p[i] in d:\n find = False\n break\n if find == False:\n ans += 1\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "import sys\n\nN,K=list(map(int,input().split()))\nD=list(map(int,input().split()))\n\n\nwhile True:\n for x in [int(n) for n in str(N)]:\n if x in D:\n break\n else:\n print(N)\n return\n N+=1\n", "passed": true, "time": 0.21, "memory": 14252.0, "status": "done"}, {"code": "total, k = list(map(int, input().split()))\n\nd = list(map(int, input().split()))\n\ndef total_to_digits(total):\n return list(map(int, list(str(total))))\n\ndef find_lowest_denomination(total, d):\n res = None\n for i in range(total, 99999):\n digits = list(total_to_digits(i))\n if not (set(digits) & set(d)):\n print(i)\n return\n\n\nfind_lowest_denomination(total, d)\n", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "n, k = list(map(int,input().split()))\na = list(map(str,input().split()))\n\n\nwhile True:\n \n for j in str(n):\n \n if j in a:\n break\n else:\n break\n n += 1 \n \nprint(n)", "passed": true, "time": 0.38, "memory": 14280.0, "status": "done"}, {"code": "def dfs(A: list):\n if len(A) > len(str(n))+1:\n return\n if len(A) and (x := int(\"\".join(A))) >= n and ans[0] > x:\n ans[0] = x\n return\n\n for v in d:\n if v == \"0\" and len(A) == 0:\n next\n A.append(v)\n dfs(A)\n A.pop()\n\n\nn, k = list(map(int, input().split()))\nd = sorted(list(set([str(i) for i in range(10)]) - set(input().split())))\nans = [10**10]\ndfs([])\nprint((ans[0]))\n", "passed": true, "time": 0.48, "memory": 14324.0, "status": "done"}, {"code": "n, k= input().split()\nl = list(map(int,input().split()))\ncheckNum=[i for i in range(11)]\n\ndef find(x):\n while x!=checkNum[x]:\n checkNum[x]=checkNum[checkNum[x]]\n x=checkNum[x]\n return x\n\nfor i in l:\n checkNum[find(i)]=checkNum[find(i+1)]\n\nfin=\"\"\nfor i in range(len(n)):\n first=int(n[i])\n k=find(first)\n if k==first:\n fin+=str(k)\n else:\n if k!=10:\n fin=str(k)+str(find(0))*(len(n)-i-1)\n else:\n fin=str(find(1))+str(find(0))*len(n)\n break\n\nprint(fin)\n", "passed": true, "time": 0.14, "memory": 14408.0, "status": "done"}, {"code": "N,K=list(map(int,input().split()))\nD=[int(x) for x in input().split()]\nD=set(D)\nkouho=N\nwhile(1):\n lenkouho=len(str(kouho))\n flag=1\n for i in range(lenkouho):\n if int(str(kouho)[i]) in D:\n flag=0\n if flag==1:\n print(kouho)\n break\n kouho+=1\n", "passed": true, "time": 1.66, "memory": 14276.0, "status": "done"}, {"code": "#\n# abc042 c\n#\n\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"1000 8\n1 3 4 5 6 7 8 9\"\"\"\n output = \"\"\"2000\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"9999 1\n0\"\"\"\n output = \"\"\"9999\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n N, K = list(map(int, input().split()))\n D = list(input().split())\n\n for i in range(N, 10*N+1):\n for d in D:\n if str(i).count(d) != 0:\n break\n else:\n print(i)\n break\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.16, "memory": 14360.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nD = list(map(int, input().split()))\nnum = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\nnum = str(list(set(num) ^ set(D)))\n\nans = str(N)\nclear = 0\n\nwhile clear == 0:\n for i in range(len(ans)):\n if not ans[i] in num:\n break\n if i == len(ans) - 1:\n clear += 1 \n ans = str(int(ans) + 1)\n\nprint(int(ans) - 1)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nD = list(input().split())\n\nwhile True:\n n = str(N)\n for i in range(K):\n f = 0\n if D[i] in n:\n N += 1\n f = 1\n break\n if f == 0:\n break\n\nprint(N)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "#\u5024\u6bb5\u3001\u5acc\u3044\u306a\u6570\u5b57\u306e\u6570\nN, K = map(int, input().split())\n#\u5acc\u3044\u306a\u6570\u5b57\nhate_num = list(map(int, input().split()))\n#\u30eb\u30fc\u30d7\u7528\ni = N\n\nwhile 1:\n #\u652f\u6255\u3046\u91d1\u984d\u306b\u5165\u3063\u3066\u3044\u308b\u6570\u5b57\u306e\u629c\u304d\u51fa\u3057\n ans = list({int(i) for i in list(str(i))})\n #\u652f\u6255\u3046\u91d1\u984d\u306b\u5acc\u3044\u306a\u6570\u5b57\u304c\u5165\u3063\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\n for j in ans:\n #\u5acc\u3044\u306a\u6570\u5b57\u304c\u3042\u3063\u305f\u6642\n if j in hate_num: \n break\n #\u5acc\u3044\u306a\u6570\u5b57\u304c\u306a\u304b\u3063\u305f\u6642\n else:\n print(i)\n break\n i += 1", "passed": true, "time": 0.22, "memory": 14224.0, "status": "done"}, {"code": "n, k = input().split()\nd = list(map(int, input().split()))\n\na = []\n\nfor i in range(10):\n if i not in d:\n a.append(i)\n\nn = list(map(int, list(n)))\n\nfor i in range(len(n)):\n if n[i] in d:\n ind = i\n\n done = False\n while not done:\n for j in range(n[ind]+1, 10):\n if j in a:\n n[ind] = j\n done = True\n break\n\n if not done:\n ind -= 1\n\n if ind < 0:\n n.insert(0, a[1] if a[0] == 0 else a[0])\n ind = 0\n done = True\n\n for j in range(ind+1, len(n)):\n n[j] = a[0]\n\n break\n\nprint(\"\".join(list(map(str, n))))", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "n,k = list(map(int,input().split()))\nif k == 0:\n print(n)\n return\ndislike = list(input().split())\n \nans = n-1\nflag = 1\nwhile flag == 1:\n ans+=1\n flag = 0\n for i in str(ans):\n if i in dislike:\n flag = 1\n break\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "def testa(n,d):\n for i in d:\n if str(i) in str(n): return 0\n return 1\n\nn,k = [int(i) for i in input().split()]\nd = [int(i) for i in input().split()]\n\nwhile not testa(n,d): n+=1\nprint(n)\n", "passed": true, "time": 0.21, "memory": 14080.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nbl = set(input().split())\n\nwhile True:\n if len(set(str(N)) & bl) != 0:\n N += 1\n else:\n print(N)\n break", "passed": true, "time": 0.24, "memory": 14048.0, "status": "done"}, {"code": "N, K = list(map(int,input().split()))\nD = set(input().split())\n\nfor k in range(N,10**9):\n f = 1\n for e in str(k):\n if e in D:\n f = 0\n break\n if f == 1:\n print(k)\n return\n", "passed": true, "time": 0.97, "memory": 14292.0, "status": "done"}, {"code": "def dfs(i,num_str):\n nonlocal ans_list\n if i==len(str(n)):\n ans_list.append(int(num_str))\n if len(num_list)==1:\n ans_list.append(int(num_list[0]+num_str))\n else:\n if num_list[0]=='0':\n ans_list.append(int(num_list[1]+num_str))\n else: \n ans_list.append(int(num_list[0]+num_str))\n return\n else:\n for j in num_list:\n dfs(i+1,num_str+j)\n\nn,k = map(int,input().split())\nd = list(map(int,input().split()))\n\nans_list = []\nnum_list = []\nfor i in range(10):\n if i not in d:\n num_list.append(str(i))\n \n#print(num_list)\n\ndfs(0,'')\nsort_list = sorted(ans_list)\n#print(sort_list[10:])\n\nfor i in sort_list:\n if n<=i:\n print(int(i))\n break", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nD = set(input())\nfor i in range(n, 10**5):\n if set(str(i)) & D == set():\n print(i)\n return", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "#\u5024\u6bb5\u3001\u5acc\u3044\u306a\u6570\u5b57\u306e\u6570\nN, K = map(int, input().split())\n#\u5acc\u3044\u306a\u6570\u5b57\nhate_num = list(map(int, input().split()))\n#\u30eb\u30fc\u30d7\u7528\ni = N\n\nwhile 1:\n #\u652f\u6255\u3046\u91d1\u984d\u306b\u5165\u3063\u3066\u3044\u308b\u6570\u5b57\u306e\u629c\u304d\u51fa\u3057\n ans = list({int(x) for x in list(str(i))})\n #\u652f\u6255\u3046\u91d1\u984d\u306b\u5acc\u3044\u306a\u6570\u5b57\u304c\u5165\u3063\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\n for j in ans:\n #\u5acc\u3044\u306a\u6570\u5b57\u304c\u3042\u3063\u305f\u6642\n if j in hate_num: \n break\n #\u5acc\u3044\u306a\u6570\u5b57\u304c\u306a\u304b\u3063\u305f\u6642\n else:\n print(i)\n break\n i += 1", "passed": true, "time": 0.24, "memory": 14164.0, "status": "done"}, {"code": "i3=lambda : map(int,input().split())\n\nN,K=i3()\n*D,=i3()\n\nD=set(D)\n\nfor i in range(N,10**5):\n ans=1\n for s in str(i):\n if int(s) in D:\n ans=0\n break\n if ans : break\nprint(i)", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "import sys\n\n\ndef check(pay, like):\n str_pay = str(pay)\n like = ''.join(like)\n for p in str_pay:\n for lk in like:\n if p == lk:\n return False\n\n return True\n\nN, K = list(map(int, input().split()))\n\nD = []\nD = list(map(int, input().split()))\nstr_D = []\n\nfor s in D:\n str_D.append(str(s))\n\npay = N\n\nwhile True:\n if check(pay, str_D):\n print(pay)\n return\n pay += 1\n", "passed": true, "time": 0.14, "memory": 14004.0, "status": "done"}, {"code": "def dfs(A: list):\n if len(A) > nn:\n return\n if len(A) and (x := int(\"\".join(A))) >= n and ans[0] > x:\n ans[0] = x\n return\n\n for v in d:\n if v == \"0\" and len(A) == 0:\n next\n A.append(v)\n dfs(A)\n A.pop()\n\n\nn, k = list(map(int, input().split()))\nd = sorted(list(set([str(i) for i in range(10)]) - set(input().split())))\nnn = len(str(n))+1\nans = [10**7]\ndfs([])\nprint((ans[0]))\n", "passed": true, "time": 0.26, "memory": 14248.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nd = list(input().split())\n#n = 1000\nflag = True\nwhile flag:\n flag2 = True\n for si in str(n):\n if si in d:\n n += 1\n flag2 = False\n break\n if flag2:\n break\n else:\n flag = True\n \nprint(n)\n", "passed": true, "time": 0.18, "memory": 14092.0, "status": "done"}, {"code": "def check(n, D):\n N = []\n while n != 0:\n N.append(n % 10)\n n //= 10\n for d in D:\n if d in N:\n return False\n return True\n\ndef __starting_point():\n n, k = [int(x) for x in input().split(' ')]\n D = [int(x) for x in input().split(' ')]\n res = n\n while True:\n if check(res, D):\n break\n else:\n res += 1\n print(res)\n\n__starting_point()", "passed": true, "time": 0.23, "memory": 14216.0, "status": "done"}, {"code": "def is_dislike(N, ds):\n num = N\n while(True):\n if (num % 10) in ds:\n return True\n else:\n num = int(num / 10)\n if num == 0:\n break\n return False\n\n\nnk = list(map(int,input().split()))\nN = nk[0]\nK = nk[1]\nds = list(map(int,input().split()))\nwhile(True):\n if is_dislike(N, ds):\n N = N+1\n else:\n print(N)\n break", "passed": true, "time": 0.24, "memory": 14100.0, "status": "done"}, {"code": "#from statistics import median\n#import collections\n#aa = collections.Counter(a) # list to list || .most_common(2)\u3067\u6700\u5927\u306e2\u500b\u3068\u308a\u3060\u305b\u308b\u304a a[0][0]\nfrom math import gcd\nfrom itertools import combinations,permutations,accumulate, product # (string,3) 3\u56de\n#from collections import deque\nfrom collections import deque,defaultdict,Counter\nimport decimal\nimport re\nimport math\nimport bisect\nimport heapq\n#\n#\n#\n# python\u3067\u7121\u7406\u306a\u3068\u304d\u306f\u3001pypy\u3067\u3084\u308b\u3068\u6b63\u89e3\u3059\u308b\u304b\u3082\uff01\uff01\n#\n#\n# my_round_int = lambda x:np.round((x*2 + 1)//2)\n# \u56db\u6368\u4e94\u5165g\n#\n# \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u7cfb\n# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);\n# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);\n#\n#\nimport sys\nsys.setrecursionlimit(10000000)\nmod = 10**9 + 7\n#mod = 9982443453\n#mod = 998244353\nINF = float('inf')\nfrom sys import stdin\nreadline = stdin.readline\ndef readInts():\n return list(map(int,readline().split()))\ndef readTuples():\n return tuple(map(int,readline().split()))\ndef I():\n return int(readline())\n\n#dic = defaultdict(int)\nn,k = readInts()\nD = Counter(readInts())\ndef ok(n):\n while n:\n v = n%10\n if D[v]:\n return False\n n //= 10\n return True\nans = n\nfor i in range(n, 100000):\n if ok(i):\n ans = i\n break\nprint(ans)\n", "passed": true, "time": 0.17, "memory": 14224.0, "status": "done"}, {"code": "n, k = map(int, input().split())\narr = list(map(int, input().split()))\n\ninf = float('inf')\nmin_cost = inf\nfor amount in range(n, 100000):\n for i, e in enumerate(arr):\n if str(e) in str(amount):\n break\n if i == len(arr)-1:\n min_cost = min(min_cost, amount)\n\nprint(min_cost)", "passed": true, "time": 0.29, "memory": 14168.0, "status": "done"}, {"code": "#\n# abc042 c\n#\n\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"1000 8\n1 3 4 5 6 7 8 9\"\"\"\n output = \"\"\"2000\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"9999 1\n0\"\"\"\n output = \"\"\"9999\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n N, K = list(map(int, input().split()))\n D = list(input().split())\n\n for i in range(100000):\n if i < N:\n continue\n for d in D:\n if str(i).count(d) != 0:\n break\n else:\n print(i)\n break\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14504.0, "status": "done"}, {"code": "n,k = input().split()\nhate = list(input().split())\nexi = True\nt = True\n\nwhile True:\n for c in hate:\n t = True\n if c in list(n):\n t = False\n break\n if t:\n print(n)\n break\n\n intN = int(n) + 1\n n = str(intN)", "passed": true, "time": 0.15, "memory": 14108.0, "status": "done"}, {"code": "import itertools\n\ndef main():\n\tN, K = [int(n) for n in input().split(\" \")]\n\tD = [1] * 10\n\tfor d in input().split(\" \"):\n\t\tD[int(d)] = 0\n\tL = [str(i) for i, v in enumerate(D) if v == 1]\n\n\tdigit = len(str(N))\n\tcand = []\n\tfor n in list(itertools.product(L, repeat=digit)):\n\t\tp = int(\"\".join(list(n)))\n\t\tif p >= N:\n\t\t\tcand.append(p)\n\tif len(cand):\n\t\tprint(min(cand))\n\telse:\n\t\tif L[0] == \"0\":\n\t\t\tprint(str(L[1]) + \"0\" * digit)\n\t\telse:\n\t\t\tprint(str(L[0]) * (digit + 1))\n\n\nmain()", "passed": true, "time": 0.15, "memory": 14140.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\n\ndef find_ok( x , Oks ):\n for i in Oks:\n if int(i) > int(x):\n break\n return i\n\ndef main():\n n,k = map( int , input().split() )\n Nos = set(map( int , input().split() ))\n while(1):\n x = str(n)\n set_n= set()\n for digit in x:\n set_n.add( int(digit) )\n if len(set_n & Nos) == 0:\n break\n n += 1\n print(n)\n\n\n\nmain()", "passed": true, "time": 0.15, "memory": 14252.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\nd=set(input().split())\n\nwhile True:\n if len(set(str(n))&d) != 0:\n n+=1\n \n else:\n print(n)\n break\n", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "#!/usr/bin/env python\n# coding: utf-8\n\n# In[21]:\n\n\nimport itertools\n\ndef main():\n\tN, K = [int(n) for n in input().split(\" \")]\n\tD = [1] * 10\n\tfor d in input().split(\" \"):\n\t\tD[int(d)] = 0\n\tL = [str(i) for i, v in enumerate(D) if v == 1]\n\n\tdigit = len(str(N))\n\tcand = []\n\tfor n in list(itertools.product(L, repeat=digit)):\n\t\tp = int(\"\".join(list(n)))\n\t\tif p >= N:\n\t\t\tcand.append(p)\n\tif len(cand):\n\t\tprint((min(cand)))\n\telse:\n\t\tif L[0] == \"0\":\n\t\t\tprint((str(L[1]) + \"0\" * digit))\n\t\telse:\n\t\t\tprint((str(L[0]) * (digit + 1)))\n\n\nmain()\n\n\n# In[ ]:\n\n\n\n\n", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "N,K = map(int,input().split())\nD = list(map(int,input().split()))\nE = []\nfor i in range(10):\n if i not in D:\n E.append(i)\nE = sorted(E)\nN = str(N)\nind = len(N)\nfor i in range(len(N)):\n if int(N[i]) not in E:\n ind = i\n break\nif ind==len(N):\n print(N)\nelse:\n flag = 0\n x = \"\"\n for i in range(ind,-1,-1):\n n = int(N[i])\n for e in E:\n if e>n:\n x = N[:i]+str(e)+str(E[0])*(len(N)-i-1)\n flag = 1\n break\n if flag==1:break\n if flag==0:\n if E[0]>0:\n a = E[0]\n else:\n a = E[1]\n x = str(a)+str(E[0])*len(N)\n print(x)", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nds = [d for d in input().split()]\nwhile any(c in ds for c in str(n)): n += 1\nprint(n)", "passed": true, "time": 0.15, "memory": 14272.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nd = list(input().split())\nflg = True\nwhile flg:\n flg = False\n m = list(str(n))\n for i in m:\n if i in d:\n flg = True\n break\n if flg:\n n += 1\nprint(n)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "n,k = map(int,input().split())\na = list(map(int,input().split()))\nb = set()\nfor i in range(10):\n if i in a:\n b.add(str(i))\nwhile n > 0:\n c = set(list(str(n)))\n if c.isdisjoint(b):\n print(n)\n return\n n += 1", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "# coding:UTF-8\nimport sys\n\n\ndef resultSur97(x):\n return x % (10 ** 9 + 7)\n\ndef __starting_point():\n # ------ \u5165\u529b ------#\n nk = list(map(int, input().split())) # \u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u9023\u7d9a\u6570\u5b57\n\n x = nk[1]\n dList = list(map(int, input().split())) # \u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u9023\u7d9a\u6570\u5b57\n\n # ------ \u51e6\u7406 ------#\n f = 0\n n = nk[0]\n while f == 0:\n nList = [int(c) for c in str(n)] # \u6570\u5b57\u2192\u5358\u6570\u5b57\u30ea\u30b9\u30c8\u5909\u63db\n b = 1\n for i in nList:\n for j in dList:\n if i == j:\n b = 0\n break\n if b == 1:\n break\n else:\n n += 1\n\n # ------ \u51fa\u529b ------#\n print((\"{}\".format(n)))\n # if flg == 0:\n # print(\"YES\")\n # else:\n # print(\"NO\")\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14344.0, "status": "done"}, {"code": "import re\nimport sys\nimport math\nimport itertools\nimport bisect\nfrom copy import copy\nfrom collections import deque,Counter\nfrom decimal import Decimal\nimport functools\ndef v(): return input()\ndef k(): return int(input())\ndef S(): return input().split()\ndef I(): return list(map(int,input().split()))\ndef X(): return list(input())\ndef L(): return list(input().split())\ndef l(): return list(map(int,input().split()))\ndef lcm(a,b): return a*b//math.gcd(a,b)\nsys.setrecursionlimit(10 ** 9)\nmod = 10**9+7\ncnt = 0\nans = 0\ninf = float(\"inf\")\nal = \"abcdefghijklmnopqrstuvwxyz\"\nAL = al.upper()\n\nn,k = I()\nd = l()\nuse = [i for i in range(11) if i not in d ]\na = True\nprice = n\n\nwhile a:\n cnt = 0\n for i in str(price):\n a = len(str(price))\n if int(i) not in d:\n cnt += 1\n else:\n cnt = inf\n if a == cnt:\n print(price)\n return\n price += 1\n \n \n \n\n", "passed": true, "time": 0.16, "memory": 14232.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nd=list(map(str,input().split()))\ne=set(d)\nfor i in range(n,100001):\n v = set(str(i))&e\n if len(v)== 0:\n print(i);return", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "import itertools\nn,k = map(int, input().split())\nd = list(map(int, input().split()))\nsafe = [i for i in range(10) if i not in d]\n\nn_l = list(map(int, list(str(n))))\nif len(set(safe)&set(n_l)) == len(set(n_l)):\n print(n)\n return\n\nfor v in itertools.product(safe, repeat=len(str(n))):\n if v[0] == 0: continue\n x = int(\"\".join(list(map(str, v))))\n if int(x) >= n:\n print(x)\n return\n\nfor v in itertools.product(safe, repeat=len(str(n))+1):\n if v[0] == 0: continue\n x = int(\"\".join(list(map(str, v))))\n if int(x) >= n:\n print(x)\n return", "passed": true, "time": 0.16, "memory": 14396.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nd=set(input().split())\n \nwhile True:\n if len(set(str(n))&d) != 0:\n n+=1\n \n else:\n print(n)\n break", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nD = set(input().split())\n\nfor i in range(N, 100001):\n for d in str(i):\n if d in D:\n break\n else:\n print(i)\n break", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nd = list(map(int, input().split()))\n\nv = n\nwhile True:\n f = True\n for t in list(str(v)):\n if int(t) in d:\n f = False\n continue\n if f:\n print(v)\n return\n v+=1\n", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "n,k = [int(x) for x in input().split()]\na = input().split()\n\ndef check(p):\n p = list(str(p))\n for i in range(len(p)):\n if p[i] in a:\n return False\n return True\n\nfor i in range(n,n * 10000):\n if check(i):\n print(i)\n break", "passed": true, "time": 0.2, "memory": 14160.0, "status": "done"}, {"code": "N,K=map(int,input().split())\n*D,=input().split()\nok=1\nwhile ok:\n ans=list(str(N))\n ok=0\n for a in ans:\n if a in D:\n ok=1\n N+=1\nprint(''.join(ans))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nD = list(map(int, input().split()))\n\nfor i in range(n, 100000):\n m = str(i)\n count = 0\n for j in range(len(m)):\n if int(m[j]) in D:\n break\n else:\n count += 1\n if count == len(m):\n print(i)\n return\n \nprint(0)", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\nl=list(map(int,input().split()))\nfor v in range(n,10**5):\n for c in str(v):\n if int(c) in l:\n break\n else:\n print(v)\n return\n", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "N, K = map(int,input().split())\nmat = input().split()\nwhile True:\n FIN = 0\n for i in range(len(str(N))):\n for j in range(K):\n if mat[j] == str(N)[i]:\n FIN += 1\n break\n if FIN == 0:\n break \n else:\n N += 1\nprint(N)", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "n,k = [int(x) for x in input().split()]\nds = {int(x) for x in input().split()}\nns = {0,1,2,3,4,5,6,7,8,9} -ds\n#print(ds)\n#print(ns-ds)\ntemp=0\nd ={}\na=1\nb = {}\nm = len(str(n)) +1 \nover=False\nwhile(a<=m and not over ):\n c = []\n d = 10**(a-1) \n for v in ns:\n if a>1:\n for bv in b[a-1]:\n t = v*d + bv\n c += [t]\n if t >= n:\n print(t)\n over=True\n break\n if over:\n break\n else:\n t = v*d\n c += [t]\n if t >= n:\n print(t)\n over=True\n break\n \n b[a] = c\n a+=1\n \n#for j in b: \n# print(j,b[j])\n\n", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "# N, K\u306e\u5165\u529b\u53d7\u4ed8\nN, K = map(int, input().split())\n# D\u306e\u5165\u529b\u53d7\u4ed8\nD = set(input().split())\n# 0-9\u3068D\u306e\u5dee\u96c6\u5408\u4f5c\u6210\u3001\u30ea\u30b9\u30c8\u5316\u3057\u3066E\u306b\u4ee3\u5165\nE = {\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"} - D\n# N\u306b1\u305a\u3064\u8db3\u3057\u3066\u6761\u4ef6\u306b\u5408\u3046\u6700\u521d\u306e\u6570\u5b57\u3092\u7279\u5b9a\u3059\u308b\nresult = False\nwhile result == False:\n for i in str(N):\n if not i in E:\n N = N + 1\n result = False\n break\n else:\n result = True\nprint(N)", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "n, k = map(int,input().split())\na = list(input().split())\n\nfor i in range(n, 100001):\n flg = True\n s = str(i)\n for j in range(len(s)):\n if s[j] in a:\n flg = False\n break\n if flg:\n break\nprint(i)", "passed": true, "time": 0.18, "memory": 14328.0, "status": "done"}, {"code": "# bsdk idhar kya dekhne ko aaya hai, khud kr!!!\n# import math\n# from itertools import *\n# import random\n# import calendar\nimport datetime\n# import webbrowser\n\n# f = open(\"input.txt\", 'r')\n# g = open(\"output.txt\", 'w')\n# n, m = map(int, f.readline().split())\n\nn, k = list(map(int, input().split()))\ndislike = list(map(int, input().split()))\nwhile True:\n for i in str(n):\n if int(i) not in dislike:\n continue\n else:\n break\n else:\n break\n n += 1\nprint(n)\n", "passed": true, "time": 0.16, "memory": 16376.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\nd = list(map(int,input().split()))\n#print(d)\nfor i in range(n,10**5):\n count=0\n for j in range(k):\n u = str(d[j])\n if(str(i).count(u)==0):\n count+=1\n #print(\"count:\"+str(count))\n if(count==k):\n print(i)\n break\n", "passed": true, "time": 0.18, "memory": 14056.0, "status": "done"}, {"code": "def is_bad_nums(j: int, d: []) -> bool:\n while j:\n if j % 10 in d:\n return True\n j //= 10\n return False\n\n\ndef answer(n: int, k: int, d: []) -> int:\n for i in range(n, 100000):\n if is_bad_nums(i, d):\n continue\n return i\n\n\ndef main():\n n, k = map(int, input().split())\n d = list(map(int, input().split()))\n print(answer(n, k, d))\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.27, "memory": 14300.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nD = list(map(int, input().split()))\ns = set(D)\n\nfor i in range(N, 10**6+1):\n l = [j for j in str(i)]\n flag = True\n for n in l:\n if int(n) in s:\n flag = False\n break\n if flag:\n ans = i\n break\nprint(ans)", "passed": true, "time": 0.15, "memory": 14364.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nd = list(input().split())\nwhile True:\n flag2 = True\n for si in str(n):\n if si in d:\n n += 1\n flag2 = False\n break\n if flag2:\n break \nprint(n)", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "def price(N,K):\n Kn = input().split()\n Flag = False\n\n for i in range(N,10*N,1):\n value = str(i)\n for j in range(K):\n if(Kn[j] not in value):\n Flag = True\n elif(Kn[j] in value):\n Flag = False\n break\n\n if(Flag == True):\n print(i)\n break\n\nN,K = (int(x) for x in input().split())\nprice(N,K)", "passed": true, "time": 0.17, "memory": 14240.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\ndl = list(map(int, input().split()))\n\ni = n\nwhile True:\n money = list(map(int, str(i)))\n for m in money:\n if dl.count(m) != 0:\n break\n else:\n print(i)\n break\n i += 1\n \n", "passed": true, "time": 0.27, "memory": 14312.0, "status": "done"}, {"code": "import sys\nsys.setrecursionlimit(10**7)\narr = [\"a\",\"b\",\"c\"]\nsavelis = [0]*10\ndef main():\n N,K = list(map(int,input().split()))\n Flis = list(map(int,input().split()))\n Tlis = [i for i in range(10)]\n Tlis = [i for i in Tlis if i not in Flis]\n str_flis = [str(i) for i in Flis]\n ANS = []\n for i in range(N*10):\n stri = str(i)\n TF = True\n for j in stri:\n if j in str_flis:\n TF = False\n break\n if(TF):ANS.append(i)\n for item in ANS:\n if(item>=N):\n print(item)\n break\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.34, "memory": 15872.0, "status": "done"}, {"code": "import itertools\n\nN, K = map(int, input().split()) # N\u5186\u306e\u54c1\u7269\u3001K\u500b\u306e\u5acc\u3044\u306a\u6570\u5b57\nD = set(list(map(int, input().split()))) # \u5acc\u3044\u306a\u6570\u5b57\u306e\u30ea\u30b9\u30c8\nbase = set(range(10))\n\ntarget_num = base - D\nketa = len(str(N))\n\nanswer = float('inf')\nfor p in itertools.product(target_num, repeat=keta):\n temp = 0\n for i, num in enumerate(p):\n temp += num * 10**i\n \n if temp >= N:\n answer = min(answer, temp)\n\nfor p in itertools.product(target_num, repeat=keta+1):\n temp = 0\n for i, num in enumerate(p):\n temp += num * 10**i\n \n if temp >= N:\n answer = min(answer, temp)\n\nprint(answer)", "passed": true, "time": 0.26, "memory": 14288.0, "status": "done"}, {"code": "n,k = list(map(int,input().split()))\n\na = list(input().split())\n\nwhile not set(list(str(n)[0:k])).isdisjoint(a):\n\tn += 1\n\nprint(n)\n", "passed": true, "time": 0.17, "memory": 14112.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nD = list(input().split())\n\nans = str(n)\nwhile not all([c not in D for c in ans]) and int(ans) >= n:\n ans = str(int(ans) + 1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nd = list(map(int, input().split()))\nng = [False] * 10\nfor i in d:\n ng[i] = True\ndef ok(n):\n nonlocal ng\n while n > 0:\n if ng[n%10]:\n return False\n n //= 10\n return True\nwhile not ok(n):\n n += 1\nprint(n)", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nd = set(map(int, input().split()))\n\nwhile True:\n tmp_str = set(str(n))\n for i in tmp_str:\n if int(i) in d:\n n += 1\n break\n else:\n print(n)\n break\n", "passed": true, "time": 0.15, "memory": 14348.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nd=list(map(int,input().split()))\nx=list(range(1,100001))\ny=[0]*100000\nfor i in range(100000):\n s=str(i)\n S=len(s)\n for j in range(S):\n if int(s[j]) in d:\n y[i-1]=1\n break\nfor i in range(100000):\n if i>=n-1:\n if y[i]==0:\n print(i+1)\n break", "passed": true, "time": 0.33, "memory": 17972.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nD = set(map(int, input().split()))\nfrom itertools import count\nfor ans in count(n,1):\n for c in str(ans):\n if int(c) in D:\n break\n else:\n print(ans)\n break", "passed": true, "time": 0.15, "memory": 14200.0, "status": "done"}, {"code": "def iparse():\n return list(map(int, input().split()))\n\nn, k = iparse()\nd = iparse()\n\nfor i in range(n, 5000000):\n tmp = i\n f = True\n while tmp > 0:\n x = tmp % 10\n if x in d:\n f = False\n break\n tmp //= 10\n if f:\n print(i)\n return\n\n", "passed": true, "time": 0.2, "memory": 14128.0, "status": "done"}, {"code": "from sys import stdin\ninput = stdin.readline\n\nN, K = map(int, input().split())\nD = set(map(int, input().split()))\n\nwhile True:\n tmp = set(str(N))\n b = True\n for x in tmp:\n if int(x) in D:\n b = False\n break \n if b == True:\n break\n else:\n N += 1\n\nprint(N)", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "N,K = input().split()\nD =list(map(int,input().split()))\nans = []\na = int(N[0])\nx = 0\nb = 0\nwhile b in D:\n b += 1\nc = 2\nwhile c in D:\n c += 1\ny = 0\nwhile a == int(N[x]) and x <= len(N)-1:\n while a in D and a <= 9:\n a += 1\n if a == 10:\n y = x\n if 0 in D:\n a += b\n if 1 in D:\n if b != 0:\n a += (b-1)*10\n else:\n a += (c-1)*10\n ans.append(str(a))\n if a != int(N[x]):\n for i in range(len(N)-1-x):\n ans.append(str(b))\n elif x <= len(N)-2:\n x += 1\n a = int(N[x])\n else:\n a = int(N[x])-1\nwhile y > 0:\n s = ans[y][0]\n t = ans[y][1]\n r = ans[y]\n ans[y] = t\n ans[y-1] = str(int(ans[y-1]) + 1)\n if int(ans[y-1]) in D:\n u = int(ans[y-1])\n while u in D:\n u += 1\n ans[y-1] = str(u)\n if ans[y-1] != \"10\":\n y = 0\n else:\n y -= 1\n ans[y] = r\nprint(\"\".join(ans))", "passed": true, "time": 0.14, "memory": 14396.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nd = list(input().split())\nnum = [str(i) for i in range(10)]\nfor i in range(k):\n num.remove(d[i])\n \nimport itertools, heapq\nans = []\nheapq.heapify(ans)\nfor i in itertools.product(num, repeat=len(str(n))):\n s = int(''.join(i))\n if s >= n:\n heapq.heappush(ans, s)\n \nif len(ans) == 0:\n for i in itertools.product(num, repeat=len(str(n)) + 1):\n s = int(''.join(i))\n if s >= n:\n heapq.heappush(ans, s)\n print(heapq.heappop(ans))\n \nelse:\n print(heapq.heappop(ans))", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nd = list(map(int, input().split()))\ns = {'0','1','2','3','4','5','6','7','8','9'} - set(str(d))\nans = n\n\nwhile (s >= set(str(n))) == False:\n n += 1\n if (s >= set(str(n))) == True:\n ans = n\n break\n \nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14232.0, "status": "done"}, {"code": "def main():\n N, K = map(int, input().split())\n A_list = list(map(str, input().split()))\n use_list = [\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"]\n list_A = list(set(use_list) - set(A_list))\n #print(\"list_A\", list_A)\n for i in range(100000) :\n ans = N + i\n #print(\"ans\", ans)\n ans_str = str(ans)\n frag = 0\n for val in ans_str :\n #print(\"val\", val)\n if str(val) in list_A :\n pass\n #print(\"frag\", frag)\n else :\n frag = 1\n break\n\n if frag == 0 :\n break\n print(ans)\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "def main():\n N, K = list(map(int, input().split()))\n D = set(map(int, input().split()))\n numset = set(range(0,10))\n d = numset.difference(D)\n\n for n in range(N, pow(10, 6) + 10):\n check = set(list(str(n)))\n ngflag = False\n for i in check:\n if int(i) in D:\n ngflag = True\n break\n if not ngflag:\n break\n print(n)\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.22, "memory": 14212.0, "status": "done"}, {"code": "N, K = [int(x) for x in input().split()]\nD = input().split()\n\nfor payment in range(N, 10*N+1):\n if all(char not in D for char in str(payment)):\n print(payment)\n break", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nd = list(input().split())\nnum = [str(i) for i in range(10)]\nfor i in range(k):\n num.remove(d[i])\n \nimport itertools\nans = []\nfor i in itertools.product(num, repeat=len(str(n))):\n s = int(''.join(i))\n if s >= n:\n ans.append(s)\n \nif len(ans) == 0:\n for i in itertools.product(num, repeat=len(str(n)) + 1):\n s = int(''.join(i))\n if s >= n:\n ans.append(s)\n print(min(ans))\n \nelse:\n print(min(ans))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nS = set(input().split())\nwhile True:\n L = list(str(N))\n for i in L:\n if i in S:\n break\n else:\n break\n N += 1\nprint(N)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nd = list(map(int, input().split()))\n\nwhile True:\n for i in str(n):\n if int(i) in d:\n n += 1\n break\n \n else:\n print(n)\n break", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "n,t = [int(x) for x in input().split()]\nd = [int(x) for x in input().split()]\n\ndef check(x) -> bool:\n while x>0:\n a = x%10\n if a in d:\n return False\n x//=10\n return True\n\nwhile check(n)==False:\n n+=1\nprint(n)", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nd=set(input().split())\nwhile True:\n if len(set(str(n))&d)!=0:\n n+=1\n else:\n break\nprint(n)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "def minN(N:int, usable:list, restrict=True):\n usable.sort()\n keta = False\n if restrict:\n for i in usable:\n if i >= N:\n return str(i)\n # \u6841\u304c\u5897\u3048\u308b\n return '1'+str(usable[0])\n else:\n return str(usable[0])\n\ndef rote(N:list, D:set, d:set):\n ans = []\n flag = True\n lenNstr = len(N)\n for i, n in enumerate(N):\n n = int(n)\n keta = 10**(len(N) - i - 1)\n if flag:\n if n in D:\n ans.append(int(minN(n, d)) * keta)\n flag = False\n else:\n ans.append(keta * n)\n else:\n ans.append(keta * min(d))\n return sum(ans)\n\ndef main():\n N, K = list(map(int, input().split()))\n D = set(map(int, input().split()))\n numset = set(range(0,10))\n d = list(numset.difference(D))\n d.sort()\n for _ in range(10):\n Nstr = list(str(N))\n ans = rote(Nstr, D, d)\n N = ans \n print(ans)\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "N,K = list(map(int,input().split()))\n\nD = list(map(int,input().split()))\n\ndef ok(x):\n while x:\n if x % 10 in D:\n return False\n x //= 10\n return True\n\nfor i in range(N,100000):\n if ok(i):\n print(i)\n return\n", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "N,K=map(int,input().split())\nD=list(map(int,input().split()))\n\nwhile True:\n S=str(N)\n flag=True\n for x in S:\n if int(x) in D:\n flag=False\n if flag==True:\n break;\n N+=1\nprint(N)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n,k=map(int,input().split());a=set(input().split())\nwhile True:\n if not set(str(n))&a: print(n);break\n n+=1", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\nkirai = list(map(int, input().split()))\nwhile True:\n bara = [int(x) for x in list(str(N))]\n diff = set(kirai) & set(bara)\n if diff == set():\n print(N)\n break\n else:\n N = N + 1\n", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}]
[{"input": "1000 8\n1 3 4 5 6 7 8 9\n", "output": "2000\n"}, {"input": "9999 1\n0\n", "output": "9999\n"}]
4,700
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road. Note that Obs. i is also good when no observatory can be reached from Obs. i using just one road. How many good observatories are there? -----Constraints----- - 2 \leq N \leq 10^5 - 1 \leq M \leq 10^5 - 1 \leq H_i \leq 10^9 - 1 \leq A_i,B_i \leq N - A_i \neq B_i - Multiple roads may connect the same pair of observatories. - All values in input are integers. -----Input----- Input is given from Standard Input in the following format: N M H_1 H_2 ... H_N A_1 B_1 A_2 B_2 : A_M B_M -----Output----- Print the number of good observatories. -----Sample Input----- 4 3 1 2 3 4 1 3 2 3 2 4 -----Sample Output----- 2 - From Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good. - From Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good. - From Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good. - From Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good. Thus, the good observatories are Obs. 3 and 4, so there are two good observatories.
introductory
[{"code": "N,M = map(int,input().split())\nhigh = list(map(int,input().split()))\nans = [0]*N\ncnt = 0\nfor i in range(M):\n a,b = map(int,input().split())\n ans[a-1] = max(high[b-1],ans[a-1])\n ans[b-1] = max(ans[b-1],high[a-1])\n\nfor j in range(N):\n if ans[j] < high[j]:\n cnt += 1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14032.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nH = [int(a) for a in input().split()]\nX = [1] * N\nfor _ in range(M):\n a, b = list(map(int, input().split()))\n a, b = a-1, b-1\n if H[a] <= H[b]:\n X[a] = 0\n if H[b] <= H[a]:\n X[b] = 0\nprint((sum(X)))\n", "passed": true, "time": 1.04, "memory": 14232.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nh=list(map(int,input().split()))\nc=0\nd=[0]*n\nfor i in range(m):\n a,b=map(int,input().split())\n d[a-1]=max(d[a-1],h[b-1])\n d[b-1]=max(d[b-1],h[a-1])\nfor i in range(n):\n if h[i]>d[i]:\n c+=1\nprint(c)", "passed": true, "time": 0.16, "memory": 14168.0, "status": "done"}, {"code": "from collections import deque\nn,m = map(int,input().split())\nh=list(map(int,input().split()))\ng = [[] for _ in range(n)]\nfor _ in range(m):\n a,b = map(int,input().split())\n a-=1\n b-=1\n g[a].append(b)\n g[b].append(a)\nans=0\nfor j in range(n):\n for i in g[j]:\n if h[j]<=h[i]:\n break\n else:\n ans+=1\nprint(ans)", "passed": true, "time": 0.18, "memory": 14324.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nheights = list(map(int, input().split()))\n\nneighbors = [[] for i in range(n)]\n\nfor i in range(m):\n a, b = list(map(int, input().split()))\n neighbors[a - 1].append(b - 1)\n neighbors[b - 1].append(a - 1)\n\ncount = 0\nfor i in range(n):\n hanamaru = True\n for j in neighbors[i]:\n if heights[i] > heights[j]:\n continue\n else:\n hanamaru = False\n break\n if hanamaru is True:\n count += 1\n\nprint(count)\n", "passed": true, "time": 1.71, "memory": 14108.0, "status": "done"}, {"code": "n, m = [int(i) for i in input().split()]\nh = [int(i) for i in input().split()]\nedges = [[] for i in range(n)]\nfor _ in range(m):\n edge = [int(i)-1 for i in input().split()]\n edges[edge[0]].append(edge[1])\n edges[edge[1]].append(edge[0])\ncnt = 0\n\nfor i in range(n):\n flg = True\n for j in edges[i]:\n if h[i] <= h[j]:\n flg = False\n break\n if flg:\n cnt += 1\nprint(cnt)", "passed": true, "time": 0.28, "memory": 14300.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nH = list(map(int, input().split()))\n\ngood = [1] * N\nfor i in range(M):\n A, B = list(map(int, input().split()))\n A, B = A - 1, B - 1\n HA = H[A]\n HB = H[B]\n if HA == HB:\n if good[A]:\n good[A] = 0\n if good[B]:\n good[B] = 0\n elif HA < HB and good[A]:\n good[A] = 0\n elif HB < HA and good[B]:\n good[B] = 0\n\nprint((sum(good)))\nreturn\n", "passed": true, "time": 0.19, "memory": 14356.0, "status": "done"}, {"code": "N,M=list(map(int,input().split()))\nH=list(map(int,input().split()))\ncnt=[1 for _ in range(N)]\nfor _ in range(M):\n A,B=list(map(int,input().split()))\n A-=1\n B-=1\n if H[A]>H[B]:\n cnt[B]=0\n elif H[A]<H[B]:\n cnt[A]=0\n else:\n cnt[A]=0\n cnt[B]=0\nprint((cnt.count(1)))\n", "passed": true, "time": 1.29, "memory": 14208.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nHlist=list(map(int,input().split()))\nABlist=[]\nfor _ in range(M):\n ABlist.append(list(map(int,input().split())))\nflaglist=[1]*N\nfor row in ABlist:\n one=row[0]-1 #index\u3068\u756a\u53f7\u306e\u8abf\u6574\n two=row[1]-1\n if Hlist[one]<=Hlist[two]:\n flaglist[one]=0\n if Hlist[one]>=Hlist[two]:\n flaglist[two]=0\nprint(sum(flaglist))", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "N, M = map(int,input().split())\nH = list(map(int,input().split()))\nA, B = [], []\nfor _ in range(M):\n a, b = map(int,input().split())\n A.append(a)\n B.append(b)\n\nL = [1] * N\n\nfor i in range(M):\n ai = A[i] - 1\n bi = B[i] - 1\n if H[ai] > H[bi]:\n L[bi] = 0\n elif H[bi] > H[ai]:\n L[ai] = 0\n else:\n L[ai], L[bi] = 0, 0\n\nprint(L.count(1))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "n, m = list(map(int,input().split()))\n\nh = list(map(int,input().split()))\n\ncnt = [0] * n\n\nfor i in range(m):\n a,b = list(map(int,input().split()))\n cnt[a-1] = max(cnt[a-1], h[b-1])\n cnt[b-1] = max(cnt[b-1], h[a-1])\n\n\n \nres = sum([h[i] > cnt[i] for i in range(n)])\n\n\nprint(res)\n", "passed": true, "time": 0.18, "memory": 14308.0, "status": "done"}, {"code": "N,M = list(map(int, input().split()))\n\nH=list(map(int,input().split()))\n\ngraph=[[0] for _ in range(N)]\n\nfor i in range(M):\n A, B = list(map(int, input().split()))\n graph[A-1].append(H[B-1])\n graph[B-1].append(H[A-1])\n\nans=0\n\nfor i in range(N):\n if H[i]>max(graph[i]):\n ans+=1\n \nprint(ans)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n \n \n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n \n\n \n\n\n\n\n\n\n\n\n\n \n\n \n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n \n\n\n\n\n\n \n\n\n\n\n\n\n \n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n\n\n \n\n\n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n", "passed": true, "time": 0.17, "memory": 14276.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nh = list(map(int,input().split()))\n\ng = [[] for _ in range(n)]\nfor _ in range(m):\n a,b = map(int,input().split())\n g[a-1].append(b-1)\n g[b-1].append(a-1)\n\ncnt = n\nfor i in range(n):\n for j in g[i]:\n if h[i] <= h[j]:\n cnt -= 1\n break\nprint(cnt)", "passed": true, "time": 0.17, "memory": 14292.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nheight_list = list(map(int, input().split()))\nroad_list_1 = [list(map(int, input().split())) for i in range(M)]\nroad_list = [[road_list_1[j][i] - 1 for i in range(2)] for j in range(M)]\nobservation_deck = list(range(N))\n\nfor i in range(M):\n if height_list[road_list[i][0]] >= height_list[road_list[i][1]]:\n observation_deck[road_list[i][1]] = -1\n if height_list[road_list[i][0]] <= height_list[road_list[i][1]]:\n observation_deck[road_list[i][0]] = -1\n\nanswer = 0\n\nfor i in range(N):\n if observation_deck[i] != -1:\n answer += 1\n\nprint(answer)", "passed": true, "time": 0.19, "memory": 14260.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nH=list(map(int,input().split()))\nA=[0]*M;B=[0]*M\nC=[0]*N\nfor i in range(M):\n A[i],B[i]=map(int,input().split())\n\nfor i in range(M):\n if H[A[i]-1]<H[B[i]-1]:C[A[i]-1]+=1\n elif H[A[i]-1]>H[B[i]-1]:C[B[i]-1]+=1\n else:C[A[i]-1]+=1;C[B[i]-1]+=1\nprint(C.count(0))", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "\nn, m = list(map(int, input().split()))\nl = list(map(int, input().split()))\ncor = [[] for i in range(n)]\n\nfor i in range(m):\n a, b = list(map(int, input().split()))\n a -= 1\n b -= 1\n cor[a].append(b)\n cor[b].append(a)\n\nans = 0\nfor i in range(n):\n max_h = l[i]\n cnt = 1\n co = list(set(cor[i]))\n for j in range(len(co)):\n if l[co[j]] >= max_h:\n cnt = 0\n break\n ans += cnt\n\nprint(ans)\n\n\n\n", "passed": true, "time": 0.19, "memory": 14348.0, "status": "done"}, {"code": "n,m=map(int, input().split())\nh=list(map(int, input().split()))\nnear=[[0] for i in h]\nfor i in range(m):\n a,b=map(int, input().split())\n near[a-1].append(h[b-1])\n near[b-1].append(h[a-1])\ncnt=0\nfor i in range(n):\n if max(near[i])<h[i]:\n cnt+=1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14340.0, "status": "done"}, {"code": "def main() -> None:\n n, m = list(map(int, input().split()))\n heights = tuple(map(int, input().split()))\n\n good = [1] * n\n for _ in range(m):\n a, b = list(map(int, input().split()))\n height_a, height_b = heights[a-1], heights[b-1]\n if height_a == height_b:\n good[a-1], good[b-1] = 0, 0\n elif height_a < height_b:\n good[a-1] = 0\n else:\n good[b-1] = 0\n print((good.count(1)))\n return\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.19, "memory": 14252.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nH=list(map(int,input().split()))\nroad=[[] for i in range(N)]\nfor i in range(M):\n a,b=map(int,input().split())\n road[a-1].append(b)\n road[b-1].append(a)\nc=0\nfor i in range(N):\n T=True\n for j in road[i]:\n if H[i]<=H[j-1]:\n T=False\n if T:\n c+=1\nprint(c)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\n\ndef main():\n n , m = map( int , input().split() )\n h = list( map( int , input().split() ) )\n goods = [ 1 for i in range(n) ]\n for i in range( m ):\n a , b = map( lambda x : int(x) - 1 , input().split() )\n if ( h[a] > h[b] ):\n goods[ b ] = 0\n if ( h[a] < h[b] ):\n goods[ a ] = 0\n if ( h[a] == h[b] ):\n goods[ a ] = 0\n goods[ b ] = 0\n print( sum(goods) )\nmain()", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "n, m = map(int,input().split())\nh = list(map(int,input().split()))\nl = [1]*n\nfor i in range(m):\n a, b = map(int,input().split())\n if h[a-1] == h[b-1]:\n l[a-1] = 0\n l[b-1] = 0\n if h[a-1] > h[b-1]:\n l[b-1] = 0\n if h[a-1] < h[b-1]:\n l[a-1] = 0\nprint(l.count(1))", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nH = list(map(int, input().split()))\n\ngood = [1] * N\nfor i in range(M):\n A, B = list(map(int, input().split()))\n HA = H[A - 1]\n HB = H[B - 1]\n if HA == HB:\n if good[A - 1]:\n good[A - 1] = 0\n if good[B - 1]:\n good[B - 1] = 0\n elif HA < HB and good[A - 1]:\n good[A - 1] = 0\n elif HB < HA and good[B - 1]:\n good[B - 1] = 0\n\nprint((sum(good)))\nreturn\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nHlist = list(map(int,input().split()))\n\nanslist = [1]*N\nfor i in range(M):\n A,B = map(int,input().split())\n #print (Hlist[A-1])\n #print (Hlist[B-1])\n if Hlist[A-1]<Hlist[B-1]:\n anslist[A-1]=0\n elif Hlist[A-1]>Hlist[B-1]:\n anslist[B-1]=0\n elif Hlist[A-1]==Hlist[B-1]:\n anslist[A-1]=0\n anslist[B-1]=0\n \n#print (anslist)\nprint (sum(anslist))", "passed": true, "time": 0.21, "memory": 14224.0, "status": "done"}, {"code": "import sys\npin=sys.stdin.readline\n\ndef main():\n N,M=map(int,pin().split())\n H=list(map(int,pin().split()))\n d=[True]*N\n ans=0\n for _ in [0]*M:\n A,B=map(int,pin().split())\n if H[A-1]>H[B-1]:\n d[B-1]=False\n elif H[B-1]>H[A-1]:\n d[A-1]=False\n else:\n d[A-1]=False\n d[B-1]=False\n for i in d:\n if i:\n ans+=1\n print(ans)\n return\nmain()", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "import sys\nn,m=map(int,sys.stdin.readline().split())\n\ndata={}\nh=[int(i) for i in sys.stdin.readline().split()]\nfor i in range(1,n+1):\n data[i]=set()\n\nfor i in range(1,m+1):\n a,b=map(int,sys.stdin.readline().split())\n data[a].add(b)\n data[b].add(a)\n\n\nans=0\nfor i in data:\n if len(data[i])==0:\n ans+=1\n elif all(h[i-1]>h[j-1] for j in data[i]):\n ans+=1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "n, m = map(int,input().split())\nH = list(map(int,input().split()))\nAB = []\nans = 0\nfor i in range(m):\n AB.append(list(map(int,input().split())))\n AB[-1][0] -= 1\n AB[-1][1] -= 1\nok = [1]*n\nfor i in range(m):\n if H[AB[i][0]] >= H[AB[i][1]]:\n ok[AB[i][1]] = 0\n if H[AB[i][0]] <= H[AB[i][1]]:\n ok[AB[i][0]] = 0\nfor i in ok:\n if i:\n ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nlist_h = list(map(int, input().split()))\ntable = [1] * N\n\nfor i in range(M):\n A, B = list(map(int, input().split()))\n if list_h[B-1] < list_h[A-1]:\n table[B-1] = 0\n elif list_h[A-1] < list_h[B-1]:\n table[A-1] = 0\n else:\n table[A-1] = 0\n table[B-1] = 0\n\nprint(str(sum(table)))", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "N,M = map(int,input().split())\narray = list(map(int,input().split()))\nans = [1]*N\nfor i in range (M):\n A,B = map(int,input().split())\n if array[A - 1] < array[B - 1]:\n ans[A - 1] = 0\n elif array[A - 1] > array[B - 1]:\n ans[B - 1] = 0\n else:\n ans[A-1],ans[B-1] = 0,0\nprint( sum(ans) )", "passed": true, "time": 0.3, "memory": 14320.0, "status": "done"}, {"code": "n,m=list(map(int,input().split()))\nH=list(map(int,input().split()))\nans = [1]*n\nfor i in range(m):\n a,b=list(map(int,input().split()))\n if H[a-1]>=H[b-1]:\n ans[b-1] = 0\n if H[a-1]<=H[b-1]:\n ans[a-1] = 0\nprint((sum(ans)))\n", "passed": true, "time": 0.15, "memory": 14144.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nH = list(map(int,input().split()))\nL = [1]*n\nfor _ in range(m):\n a,b = map(int,input().split())\n a -= 1\n b -= 1\n if H[a] == H[b]:\n L[a] = 0\n L[b] = 0\n elif H[a] < H[b]:\n L[a] = 0\n elif H[a] > H[b]:\n L[b] = 0\nprint(sum(L))", "passed": true, "time": 0.16, "memory": 14200.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\n\nh = list(map(int, input().split()))\nall_dict = {}\nfor m in range(M):\n a, b = list(map(int, input().split()))\n \n a -= 1\n b -= 1\n \n all_dict.setdefault(a, [])\n all_dict.setdefault(b, [])\n\n all_dict[a].append(b)\n all_dict[b].append(a)\n\ntotal_good = 0\n\nfor i in range(N):\n is_good = 1\n all_dict.setdefault(i, [])\n for around_h in all_dict[i]:\n if h[around_h] >= h[i]:\n is_good = 0\n total_good += is_good\n\nprint(total_good)\n\n\n", "passed": true, "time": 0.16, "memory": 14244.0, "status": "done"}, {"code": "N,M = map(int, input().split())\n\nH=list(map(int,input().split()))\n\ngraph=[[0] for _ in range(N)]\n\nfor i in range(M):\n A, B = map(int, input().split())\n graph[A-1].append(H[B-1])\n graph[B-1].append(H[A-1])\n\nans=0\n\nfor i in range(N):\n if H[i]>max(graph[i]):\n ans+=1\n \nprint(ans)", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "def main():\n import collections\n n, m = list(map(int, input().split()))\n hs = list(map(int, input().split()))\n nmap = [0] * n\n cnt = 0\n\n for j in range(m):\n v = input().split()\n v0 = int(v[0]) - 1\n v1 = int(v[1]) - 1\n if hs[v0] < hs[v1]:\n nmap[v0] += 1\n elif hs[v0] == hs[v1]:\n nmap[v0] += 1\n nmap[v1] += 1\n else:\n nmap[v1] += 1\n for i in nmap:\n if i == 0:\n cnt += 1\n return cnt\n\n\ndef __starting_point():\n print((main()))\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "import copy\nN,M=list(map(int, input().split()))\nnum_list = list(map(int, input().split()))\nlist1=copy.copy(num_list)\nfor i in range(M):\n A,B=list(map(int, input().split()))\n if num_list[A-1]<num_list[B-1]:\n list1[A-1]=0\n elif num_list[A-1]>num_list[B-1]:\n list1[B-1]=0\n else:\n list1[A-1]=0\n list1[B-1]=0\n\ns=0\nfor j in list1:\n if j>0:\n s=s+1\n\nprint(s)\n", "passed": true, "time": 0.16, "memory": 14160.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nh = [int(s) for s in input().split()]\nab = []\n\nfor i in range(m):\n ab.append([int(s) for s in input().split()])\n\nh2 = []\nfor p in ab:\n if h[p[0] - 1] <= h[p[1] - 1]:\n h2.append(p[0] - 1)\n if h[p[0] - 1] >= h[p[1] - 1]:\n h2.append(p[1] - 1)\n\nprint((len(h) - len(list(set(h2)))))\n", "passed": true, "time": 0.27, "memory": 14244.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nH = list(map(int,input().split()))\n\nmiti = []\nfor i in range(M):\n miti.append(list(map(int,input().split())))\n\ncount = []\nfor i in range(N):\n count.append(1)\n\nfor i in range(M):\n if H[miti[i][0]-1] < H[miti[i][1]-1]:\n count[miti[i][0]-1]=0\n\n if H[miti[i][0]-1] > H[miti[i][1]-1]:\n count[miti[i][1]-1]=0\n\n if H[miti[i][0]-1] == H[miti[i][1]-1]:\n count[miti[i][0]-1]=0\n count[miti[i][1]-1]=0\n\nans = 0\nfor i in range(N):\n ans += count[i]\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "n,m = list(map(int,input().split()))\nh = [0]+list(map(int,input().split()))\n\nroute = [[0] for _ in range(n+1)]\nfor _ in range(m):\n a,b = list(map(int,input().split()))\n route[a].append(h[b])\n route[b].append(h[a])\n\ncnt=0\nfor i in range(1,n+1):\n if h[i]>max(route[i]):\n cnt+=1\nprint(cnt)\n", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\nH.insert(0, 0)\nt = [True] * (N+1)\n\nfor i in range(M):\n a, b = map(int, input().split())\n if H[a] <= H[b]:\n t[a] = False\n if H[b] <= H[a]:\n t[b] = False\n\nc = 0\nfor i in range(1, N+1, 1):\n if t[i]:\n c += 1\n\nprint(c)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n, m = map(int, input().split())\n\nh = list(map(int, input().split()))\n\nans = [0] * n\n\nfor i in range(m):\n a, b = map(int, input().split())\n ans[a - 1] = max(ans[a - 1], h[b - 1])\n ans[b - 1] = max(ans[b - 1], h[a - 1])\n\nanser = 0\n\nfor i in range(n):\n if ans[i] < h[i]:\n anser += 1\n\nprint(anser)", "passed": true, "time": 0.15, "memory": 14164.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nH = list(map(int, input().split()))\nadj_max = [0]*N\nans = 0\nfor _ in range(M):\n tmp1, tmp2 = list(map(int, input().split()))\n adj_max[tmp1-1] = max(adj_max[tmp1-1], H[tmp2-1])\n adj_max[tmp2-1] = max(adj_max[tmp2-1], H[tmp1-1])\nfor num in range(N):\n if H[num] > adj_max[num]:\n ans += 1\nprint(ans)\n\n", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "#ABC166\nN,M=map(int,input().split())\nH =list(map(int,input().split())) #\u5c55\u671b\u53f0\u306e\u6a19\u9ad8\nA = list(range(1,N+1))\nfor i in range(M):\n a, b = map(int, input().split())\n if H[a-1] > H[b-1]:\n A[b-1] = 0\n elif H[a-1] < H[b-1]:\n A[a-1] = 0\n else:\n A[a-1] = 0\n A[b-1] = 0\nprint(N-A.count(0))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "n,m = list(map(int,input().split()))\nh = list(map(int,input().split()))\nab = [list(map(int,input().split())) for _ in range(m)]\n\ngood = [True]*n\n\nfor i in range(m):\n if h[ab[i][0]-1] < h[ab[i][1]-1]:\n good[ab[i][0]-1] = False\n elif h[ab[i][0]-1] > h[ab[i][1]-1]:\n good[ab[i][1]-1] = False\n else:\n good[ab[i][0]-1] = False\n good[ab[i][1]-1] = False\n\n#print(good)\nprint((good.count(True)))\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\n\n# N,M=O(10^5)\u306a\u306e\u3067\u3001O(N+M)\u3067\u89e3\u304f\n# \u5404\u30ce\u30fc\u30c9\u306b\u3064\u3044\u3066\u3001\u96a3\u63a5\u3059\u308b\u5c55\u671b\u53f0\u306e\u9ad8\u3055\u306e\u6700\u5927\u5024\u3092\u66f4\u65b0\u3059\u308b\nneighbor_max = [0] * N\nfor _ in range(M):\n A, B = map(int, input().split())\n neighbor_max[A - 1] = max(neighbor_max[A - 1], H[B - 1])\n neighbor_max[B - 1] = max(neighbor_max[B - 1], H[A - 1])\n\n# \u5404\u30ce\u30fc\u30c9\u306b\u3064\u3044\u3066\u3001\u81ea\u8eab\u306e\u9ad8\u3055\u3068\u3001\u96a3\u63a5\u3059\u308b\u5c55\u671b\u53f0\u306e\u9ad8\u3055\u306e\u6700\u5927\u5024\u3092\u6bd4\u8f03\u3059\u308b\n# \u63a5\u7d9a\u3092\u4e00\u3064\u3082\u6301\u305f\u306a\u3044\u30ce\u30fc\u30c9\u306b\u3064\u3044\u3066\u3082\u3001\u8a08\u7b97\u306f\u6b63\u3057\u3044\nans = 0\nfor i in range(N):\n if H[i] > neighbor_max[i]: ans += 1\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nheight = [0] + list(map(int, input().split()))\nmawari = [0] * (n+1) \nans = 0\n\nfor _ in range(m):\n a, b = map(int, input().split())\n mawari[a] = max(mawari[a], height[b])\n mawari[b] = max(mawari[b], height[a])\n \n\nfor i in range(1,n+1):\n if height[i]> mawari[i]:\n ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "def i_input(): return int(input())\n\n\ndef i_map(): return list(map(int, input().split()))\n\n\ndef i_list(): return list(map(int, input().split()))\n\n\ndef i_row(N): return [int(input()) for _ in range(N)]\n\n\ndef i_row_list(N): return [list(map(int, input().split())) for _ in range(N)]\n\n\nn,m= i_map()\nhh=i_list()\nab=i_row_list(m)\nt=[1]*n\nfor a,b in ab:\n if hh[a-1]<=hh[b-1]:\n t[a-1]=0\n if hh[b-1]<=hh[a-1]:\n t[b-1]=0\nprint((sum(t)))\n\n", "passed": true, "time": 0.15, "memory": 14212.0, "status": "done"}, {"code": "\ndef main():\n n, m = map(int, input().split(\" \"))\n ls=[{} for _ in range(n)]\n h = list(map(int, input().split(\" \")))\n for i in range(n):\n ls[i] = [h[i]]\n ab = []\n for i in range(m):\n ab.append(list(map(lambda i:int(i)-1, input().split(\" \"))))\n for i in range(m):\n if ls[ab[i][0]][0] >= ls[ab[i][1]][0]:\n ls[ab[i][1]].append(ls[ab[i][0]][0]+1)\n if ls[ab[i][1]][0] >= ls[ab[i][0]][0]:\n ls[ab[i][0]].append(ls[ab[i][1]][0] + 1)\n cnt = 0\n for i in range(n):\n if ls[i][0] == max(ls[i]):\n cnt += 1\n print(cnt)\n\n \n\n \n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14420.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nway=[[] for i in range(n)]\nH = list(map(int,input().split()))\nfor i in range(m):\n a,b=map(int,input().split())\n way[a-1].append(b-1)\n way[b-1].append(a-1)\n\nfor i in range(n):\n way[i]=list(set(way[i]))\n\nans=0\nfor i in range(n):\n high=True\n for j in way[i]:\n if H[i]<=H[j]:\n high=0\n break\n if high:\n ans+=1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\n\ngraph = [[] for _ in range(N)]\n\nfor query in range(M):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n graph[a].append(b)\n graph[b].append(a)\n\nans = 0\n\nfor now in range(N):\n good = True\n for neighbor in graph[now]:\n if H[now] <= H[neighbor]:\n good = False\n if good:\n ans += 1\n #print(now)\n\nprint(ans)", "passed": true, "time": 0.22, "memory": 14356.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\nways = [list(map(int, input().split())) for i in range(M)]\nobservatoryList = [1] * N\nfor i in range(M):\n if H[ways[i][0] - 1] <= H[ways[i][1] - 1]:\n observatoryList[ways[i][0] - 1] = 0\n if H[ways[i][0] - 1] >= H[ways[i][1] - 1]:\n observatoryList[ways[i][1] - 1] = 0\ngoodObservatoryCount = observatoryList.count(1)\nprint(goodObservatoryCount)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "# n\u306f\u5c55\u671b\u53f0\u306e\u6570\u3000m\u306f\u9053\u306e\u6570\nn,m = list(map(int,input().split()))\nhigh = list(map(int,input().split()))\n\na = []\n\nfor x in range(m):\n b = list(map(int,input().split()))\n a.append(b)\n\n\nloser = []\n\nfor y in a:\n high1 = high[y[0]-1]\n high2 = high[y[1]-1]\n if high1 > high2:\n loser.append(y[1])\n elif high1 == high2:\n loser.append(y[0])\n loser.append(y[1])\n else:\n loser.append(y[0])\n\nnew_loser = list(set(loser))\nprint((n-len(new_loser)))\n", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nh = list(map(int, input().split()))\nc = [[] for _ in range(n)]\nfor _ in range(m):\n a, b = map(int, input().split())\n a, b = a-1, b-1\n c[a].append(b)\n c[b].append(a)\n\nans = 0\nfor i in range(n):\n high = h[i]\n for j in c[i]:\n if h[j] >= high:\n break\n else:\n ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nh = list(map(int,input().split()))\nflg = [1]*n\nfor _ in range(m):\n a,b = map(int,input().split())\n if h[a-1] > h[b-1]:\n flg[b-1] = 0\n elif h[a-1] == h[b-1]:\n flg[a-1],flg[b-1] = 0,0\n else:\n flg[a-1] = 0\nprint(flg.count(1))", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n,m = [int(x) for x in input().split()]\nh = [int(x) for x in input().split()]\na,b = [],[]\nfor i in range(m):\n a1,b1 = [int(x) for x in input().split()]\n a.append(a1-1)\n b.append(b1-1)\nans = [1] * n\nfor i in range(m):\n if h[a[i]] < h[b[i]]:\n ans[a[i]] = 0\n elif h[a[i]] > h[b[i]]:\n ans[b[i]] = 0\n else:\n ans[a[i]] = 0\n ans[b[i]] = 0\nc = 0\nfor i in range(n):\n if ans[i] == 1:\n c += 1\n#print(ans)\nprint(c)", "passed": true, "time": 0.37, "memory": 14236.0, "status": "done"}, {"code": "n,m=map(int,input().split()) \nh =list(map(int,input().split()))\ncnt = 0\nl = [[] for i in range(n)]\nfor i in range(m):\n a,b=map(int,input().split()) \n l[a-1].append(h[b-1])\n l[b-1].append(h[a-1])\n\nfor i in range(n):\n if l[i] == []:\n cnt+=1\n\n elif h[i] > max(l[i]):\n cnt +=1\n \n\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "import sys\nimport math\nfrom collections import defaultdict, deque, Counter\nfrom copy import deepcopy\nfrom bisect import bisect, bisect_right, bisect_left\nfrom heapq import heapify, heappop, heappush\n \ninput = sys.stdin.readline\ndef RD(): return input().rstrip()\ndef F(): return float(input().rstrip())\ndef I(): return int(input().rstrip())\ndef MI(): return map(int, input().split())\ndef MF(): return map(float,input().split())\ndef LI(): return list(map(int, input().split()))\ndef TI(): return tuple(map(int, input().split()))\ndef LF(): return list(map(float,input().split()))\ndef Init(H, W, num): return [[num for i in range(W)] for j in range(H)]\n \n \ndef main():\n N, M = MI()\n H = LI()\n G = [[] for i in range(N)]\n for i in range(M):\n a, b = MI()\n G[a-1].append(b-1)\n G[b-1].append(a-1)\n res = [-1] * N\n for i in range(N):\n if res[i] != -1:\n continue\n h = H[i]\n ans = True\n for index in G[i]:\n temp_H = H[index]\n if h > temp_H:\n res[index] = 0\n else:\n ans = False\n break\n if ans:\n res[i] = 1\n else:\n res[i] = 0\n ans = 0\n for i in res:\n if i != 0:\n ans+=1\n print(ans)\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.39, "memory": 14280.0, "status": "done"}, {"code": "N,M = map(int,input().split())\n\nH = list(map(int,input().split()))\n\nans = 0\n\nH2 = []\nfor i in range(N):\n H2.append([0])\n\nfor i in range(M):\n A,B = map(int,input().split())\n \n H2[A-1].append(H[B-1])\n H2[B-1].append(H[A-1])\n\nfor i in range(N):\n H2[i] = max(H2[i])\n\nfor i in range(N):\n if H2[i] < H[i]:\n ans += 1\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nh=list(map(int,input().split()))\nl=[1]*n\nfor i in range(m):\n a,b=map(int,input().split())\n if h[a-1]==h[b-1]:\n l[a-1]=0\n l[b-1]=0\n if h[a-1]>h[b-1]:\n l[b-1]=0\n if h[a-1]<h[b-1]:\n l[a-1]=0\nprint(l.count(1))", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n,m = map(int, input().split())\nH = list(map(int, input().split()))\ng = [1]*n\n\nfor i in range(m):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n if H[a]<H[b]:\n g[a] = 0\n elif H[a]>H[b]:\n g[b] = 0\n else:\n g[a] = g[b] = 0\nprint(sum(g))", "passed": true, "time": 0.23, "memory": 14292.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\nA = [True for i in range(N)]\nfor i in range(M) :\n a,b = map(int, input().split())\n a -= 1\n b -= 1\n if(H[a] <= H[b]) :\n A[a] = False\n if(H[b] <= H[a]) :\n A[b] = False\n\nans = 0\nfor i in range(N) :\n if(A[i]) :\n ans += 1\nprint(ans)", "passed": true, "time": 0.16, "memory": 14348.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nH = list(map(int,input().split()))\nglaph = [[] for _ in range(N)]\n\nfor i in range(M):\n A,B = map(int,input().split())\n A -= 1\n B -= 1\n glaph[A].append(B)\n glaph[B].append(A)\n \nans = 0\nfor j in range(N):\n check = True\n for k in glaph[j]:\n if H[j] <= H[k]:\n check = False\n break\n if check:\n ans += 1\n \nprint(ans)", "passed": true, "time": 0.23, "memory": 14288.0, "status": "done"}, {"code": "[N, M] = [int(i) for i in input().split()]\nH = [int(i) for i in input().split()]\ndic = {}\nfor i in range(M):\n [a, b] = [int(i) for i in input().split()]\n if a in dic:\n dic[a].append(b)\n else:\n dic[a] = [b]\n if b in dic:\n dic[b].append(a)\n else:\n dic[b] = [a]\n\nans = 0\nfor i in range(1, N+1):\n s = H[i-1]\n t = 0\n if i in dic:\n for j in range(len(dic[i])):\n if s <= H[dic[i][j]-1]:\n t += 1\n break\n if t == 0:\n ans += 1\n else:\n ans += 1\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14372.0, "status": "done"}, {"code": "n,m = list(map(int,input().split()))\nh = list(map(int,input().split()))\nab = [list(map(int,input().split())) for _ in range(m)]\n\nplace = [True]*n\n\nfor i in range(m):\n a,b = ab[i][0],ab[i][1]\n if h[a-1] < h[b-1]:\n place[a-1] = False\n elif h[a-1] == h[b-1]:\n place[a-1] = False\n place[b-1] = False\n else:\n place[b-1] = False\n\nprint((place.count(True)))\n", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\narray = [0] * N\nans = 0\n\nfor i in range(M):\n A, B = map(int, input().split())\n A -= 1\n B -= 1\n array[A] = max(array[A], H[B])\n array[B] = max(array[B], H[A])\n\nfor j in range(N):\n if array[j] < H[j]:\n ans += 1\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nh = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(m)]\na, b = [list(i) for i in zip(*ab)]\nl = [1 for _ in range(n)]\n\nfor i in range(m):\n if h[a[i]-1] < h[b[i]-1]:\n l[a[i]-1] = 0\n elif h[a[i]-1] > h[b[i]-1]:\n l[b[i]-1] = 0\n else:\n l[b[i]-1] = 0\n l[a[i]-1] = 0\n\nprint((l.count(1))) \n", "passed": true, "time": 0.15, "memory": 14356.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nH = [int(i) for i in input().split()]\nA = []\nB = []\nfor i in range(M):\n a,b = map(int,input().split())\n A.append(a)\n B.append(b)\nI = []\nans = 0\nfor i in range(1,N+1):\n I.append([i])\nfor i in range(M):\n I[A[i]-1].append(B[i])\n I[B[i]-1].append(A[i])\nfor i in range(N):\n count = 0\n a = H[i]\n if(count < 2):\n for j in range(len(I[i])):\n if(H[I[i][j]-1] >= a):\n count += 1\n if(count < 2):\n ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "def __starting_point():\n\n #\u96a3\u63a5\u30ea\u30b9\u30c8(graph)\n n,m = list(map(int,input().split()))\n H = [int(h) for h in input().split()]\n\n graph = [[]for _ in range(n)]\n\n for _ in range(m):\n a,b = list(map(int,input().split()))\n graph[a-1].append(b-1)\n graph[b-1].append(a-1)\n\n #\u3053\u306e\u30ea\u30b9\u30c8\u304b\u3089\u76f8\u624b\u3068\u306e\u95a2\u4fc2\u3092\u8abf\u3079\u3066\u3088\u3044\u5c55\u671b\u53f0\u304b\u3069\u3046\u304b\u8abf\u3079\u308b\uff1f\n good = 0\n for i,g in enumerate(graph):\n moto = H[i]\n flg = True\n for sk in g:\n saki = H[sk]\n if moto <= saki:\n flg = False\n break\n if flg:\n good += 1\n print(good)\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "# C - Peaks\n\nn,m = list(map(int, input().split()))\nh = list(map(int,input().split()))\nab = []\nfor i in range(m):\n ab.append(list(map(int,input().split())))\n\npeak = [1]*n\nfor i in range(m):\n if h[ab[i][0]-1] >= h[ab[i][1]-1]:\n peak[ab[i][1]-1] = 0\n if h[ab[i][0]-1] <= h[ab[i][1]-1]:\n peak[ab[i][0]-1] = 0\nprint((sum(peak)))\n", "passed": true, "time": 0.24, "memory": 14100.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nh = list(map(int,input().split()))\nla = [0] * n\nfor i in range(m):\n a,b = map(int,input().split())\n a -= 1\n b -= 1\n la[a] = max(la[a],h[b])\n la[b] = max(la[b],h[a])\n\nans = 0\n \nfor i in range(n):\n if la[i] < h[i]:\n ans += 1\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nh = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(m)]\nans = [1]*n\nfor i in range(m):\n if h[ab[i][0]-1] == h[ab[i][1]-1]:\n ans[ab[i][0]-1] = 0\n ans[ab[i][1]-1] = 0\n elif h[ab[i][0]-1] > h[ab[i][1]-1]:\n ans[ab[i][1]-1] = 0\n else:\n ans[ab[i][0]-1] = 0\nprint((sum(ans)))\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "N, M = list(map(int,input().split()))\nH = list(map(int,input().split()))\nAB = [list(map(int,input().split())) for _ in range(M)]\n\npath = [[] for _ in range(N)]\nfor a,b in AB:\n a,b = a-1, b-1\n path[a].append(b)\n path[b].append(a)\n \nans = 0\nfor i,p in enumerate(path):\n h = H[i]\n tmp = 0\n for pp in p:\n tmp = max(tmp, H[pp])\n if tmp<h:\n ans+=1\n \nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\nN, M = list(map(int, input().split()))\nh_list = list(map(int, input().split()))\nh_dict = {i + 1: h for i, h in enumerate(h_list)}\nh_set = set(h_dict.keys())\nno_list = []\n\nfor _ in range(M):\n a, b = list(map(int, input().split()))\n if h_dict[a] == h_dict[b]:\n no_list.append(a)\n no_list.append(b)\n elif h_dict[a] > h_dict[b]:\n no_list.append(b)\n else:\n no_list.append(a)\n\nno_set = set(no_list)\nans = len(h_set - no_set)\n\nprint(ans)\n", "passed": true, "time": 0.24, "memory": 14128.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nh = list(map(int, input().split()))\nD = dict()\nfor i in range(1, n+1):\n D[i] = h[i-1]\nL = [1 for i in range(n)]\nfor _ in range(m):\n a, b =map(int, input().split())\n if D[a] > D[b]:\n L[b-1] = 0\n elif D[a] == D[b]:\n L[a-1] = 0\n L[b-1] = 0\n else:\n L[a-1] = 0\nans = 0\nfor e in L:\n ans += e\nprint(ans)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "\n\nN, M = map(int,input().split())\nH = list(map(int, input().split()))\nA = [0]*M\nB = [0]*M\nLists = [[] for _ in range(N)]\nfor i in range(M):\n A[i], B[i] = map(lambda x: int(x)-1, input().split())\n Lists[A[i]].append(B[i]) \n Lists[B[i]].append(A[i]) \n\n#print(Lists)\nans = 0\nfor i in range(N):\n Heighest = 0\n #print(Lists[i])\n #print(\"H[i]:\", H[i])\n for j in range(len(Lists[i])):\n #print(\"H[List[i][j]]:\", H[Lists[i][j]]) \n Heighest = max(Heighest, H[ Lists[i][j] ])\n #print(Heighest)\n #print(H[i])\n if Heighest <H[i]:\n #print(\"Heighest = \", Heighest)\n ans += 1\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nh=list(map(int,input().split()))\nr=[]\n\nt=['W']*n\n\nfor i in range(m):\n a,b=list(map(int,input().split()))\n if h[a-1]>=h[b-1]:\n t[b-1]='L'\n if h[a-1]<=h[b-1]:\n t[a-1]='L'\nprint(t.count('W'))", "passed": true, "time": 0.24, "memory": 14064.0, "status": "done"}, {"code": "n, m = list(map(int,input().split()))\nlst = list(map(int,input().split()))\nlst2 = []\nfor i in range(n):\n lst3 = [lst[i]]\n lst2.append(lst3)\n\nfor i in range(m):\n a, b = list(map(int,input().split()))\n a = a - 1\n b = b - 1\n lst2[a].append(lst2[b][0])\n lst2[b].append(lst2[a][0])\n\nans = 0\nfor i in range(n):\n x = lst2[i][0]\n lst2[i].sort()\n lst2[i].reverse()\n if (len(lst2[i]) == 1):\n ans = ans + 1\n elif (x == lst2[i][0]):\n lst2[i].pop(0)\n y = lst2[i][0]\n if (x != y):\n ans = ans + 1\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "n,m = list(map(int, input().split()))\nh = list(map(int, input().split()))\nhoge = [[] for _ in range(n)]\nfor i in range(m):\n a,b = list(map(int, input().split()))\n hoge[a - 1].append(b - 1)\n hoge[b - 1].append(a - 1)\n \ncnt = 0\nfor i in range(n):\n if hoge[i]:\n flag = True\n for j in hoge[i]:\n if h[i] <= h[j]:\n flag = False\n if flag:\n cnt += 1\n else:\n cnt += 1\n \nprint(cnt)", "passed": true, "time": 0.24, "memory": 14264.0, "status": "done"}, {"code": "import copy\n\nn,m = list(map(int, input().split()))\nh = [0] + list(map(int, input().split()))\n\ntowers = [[] for _ in range(n + 1)]\n\nfor i in range(m):\n a, b = list(map(int, input().split()))\n towers[a].append(b)\n towers[b].append(a)\n\ncnt = 0\nfor i in range(1, n + 1):\n for j in towers[i]:\n if h[i] <= h[j]:\n break\n else:\n cnt += 1\n\nprint(cnt)\n \n", "passed": true, "time": 0.25, "memory": 14176.0, "status": "done"}, {"code": "n,m=list(map(int,input().split()))\nh=list(map(int,input().split()))\nA=[[] for i in range(n)]\nfor i in range(m) :\n a,b=list(map(int,input().split()))\n A[a-1].append(h[b-1])\n A[b-1].append(h[a-1])\n\ncount=0\nfor i in range(n) :\n if A[i]==[] :\n count+=1\n elif max(A[i])<h[i] :\n count+=1\n else :\n continue\n\nprint(count) \n\n", "passed": true, "time": 0.25, "memory": 14108.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nh = list(map(int, input().split()))\nneighbor = [[] for _ in range(n)]\n\nfor i in range(m):\n a, b = list(map(int, input().split()))\n neighbor[a - 1].append(b - 1)\n neighbor[b - 1].append(a - 1)\n\ncnt = 0\nfor i in range(n):\n if all([h[i] > h[j] for j in neighbor[i]]):\n cnt += 1\nprint(cnt)", "passed": true, "time": 0.6, "memory": 14244.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nH = list(map(int, input().split()))\npeaks = [1] * N\nfor i in range(M):\n A, B = list(map(int, input().split()))\n if H[A - 1] > H[B - 1]:\n peaks[B - 1] = 0\n elif H[B - 1] > H[A - 1]:\n peaks[A - 1] = 0\n else:\n peaks[A - 1] = 0\n peaks[B - 1] = 0\n\nprint((sum(peaks)))\n", "passed": true, "time": 0.15, "memory": 14156.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nH = list(map(int,input().split()))\nL = [1]*n\nfor _ in range(m):\n a,b = map(int,input().split())\n if H[a-1] == H[b-1]:\n L[a-1] = 0\n L[b-1] = 0\n elif H[a-1] < H[b-1]:\n L[a-1] = 0\n elif H[a-1] > H[b-1]:\n L[b-1] = 0\nprint(sum(L))", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "from collections import defaultdict\n\nN, M = map(int, input().split())\nH = list(map(int, input().split()))\n\nedge = defaultdict(list)\n\nfor i in range(M):\n a, b = map(int, input().split())\n edge[a - 1].append(H[b - 1])\n edge[b - 1].append(H[a - 1])\n\nans = 0\nfor i in range(N):\n if len(edge[i]) == 0 or H[i] > max(edge[i]):\n ans += 1\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14104.0, "status": "done"}, {"code": "def main():\n n, m = list(map(int, input().split()))\n h = list(map(int, input().split()))\n hf = [0] * n\n for i in range(m):\n a, b = list(map(int, input().split()))\n if h[a-1] > h[b-1]:\n hf[b-1] = 1\n elif h[a-1] == h[b-1]:\n hf[a-1] = 1\n hf[b-1] = 1\n else:\n hf[a-1] = 1\n print(hf.count(0))\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nfrom itertools import chain\n\n\ndef solve(\n N: int, M: int, H: \"List[int]\", A: \"List[int]\", B: \"List[int]\"\n):\n ok = [1 for _ in range(N)]\n for a, b in zip(A, B):\n if H[a - 1] <= H[b - 1]:\n ok[a - 1] = 0\n if H[b - 1] <= H[a - 1]:\n ok[b - 1] = 0\n\n return sum(ok)\n\n\ndef main():\n tokens = chain(*(line.split() for line in sys.stdin))\n N = int(next(tokens)) # type: int\n M = int(next(tokens)) # type: int\n H = [int(next(tokens)) for _ in range(N)] # type: \"List[int]\"\n A = [int()] * (M) # type: \"List[int]\"\n B = [int()] * (M) # type: \"List[int]\"\n for i in range(M):\n A[i] = int(next(tokens))\n B[i] = int(next(tokens))\n answer = solve(N, M, H, A, B)\n print(answer)\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14168.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nway=[[] for i in range(n)]\nH = list(map(int,input().split()))\nfor i in range(m):\n a,b=map(int,input().split())\n way[a-1].append(b-1)\n way[b-1].append(a-1)\nans=0\nfor i in range(n):\n high=True\n for j in way[i]:\n if H[i]<=H[j]:\n high=0\n break\n if high:\n ans+=1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14112.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = [0] + list(map(int, input().split()))\n\ng = [[] for _ in range(N+1)]\nfor i in range(M):\n a, b = map(int, input().split())\n g[a].append(b)\n g[b].append(a)\n\nans = 0\nfor j in range(1, N+1):\n for k in g[j]:\n if H[j] <= H[k]:\n break\n else:\n ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "# coding=utf-8\n\ndef __starting_point():\n N, M = list(map(int, input().split()))\n Hli = list(map(int, input().split()))\n\n #road = [[0] * 2 for i in range(M)]\n\n ans = [0] * N\n\n for i in range(M):\n A, B = list(map(int, input().split()))\n\n if Hli[A-1] < Hli[B-1]:\n ans[A-1] += 1\n\n elif Hli[A-1] == Hli[B-1]:\n ans[A - 1] += 1\n ans[B - 1] += 1\n \n else:\n ans[B-1] +=1\n\n #print(ans)\n print((ans.count(0)))\n\n__starting_point()", "passed": true, "time": 0.16, "memory": 14232.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\nOK = [True] * N\nfor _ in range(M):\n A, B = map(lambda x: int(x)-1, input().split())\n if H[A] < H[B]:\n OK[A] = False\n elif H[A] > H[B]:\n OK[B] = False\n else:\n OK[A] = False\n OK[B] = False\n\nans = sum(OK)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\narr = [0] + list(map(int, input().split()))\ng = [[] for _ in range(n + 1)]\nfor _ in range(m):\n a, b = list(map(int, input().split()))\n g[a].append(b)\n g[b].append(a)\n\nans = 0\nfor i in range(1, n + 1):\n for j in g[i]:\n if arr[j] >= arr[i]:\n break\n else:\n ans += 1\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nH = list(map(int,input().split()))\nmx = [0 for i in range(N)]\nfor _ in range(M):\n a,b = map(int,input().split())\n a -= 1\n b -= 1\n mx[a] = max(mx[a], H[b])\n mx[b] = max(mx[b], H[a])\nans = 0\nfor i in range(N):\n if H[i] > mx[i]:\n ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nh = list(map(int,input().split()))\nl = list({i} for i in range(n+1))\nfor i in range(m):\n a,b = map(int,input().split())\n l[a].add(b)\n l[b].add(a)\n \nfor i in range(len(l)):\n l[i] = list(l[i])\ngood = set()\nfor i in range(1,len(l)):\n l[i].remove(i)\n for j in range(len(l[i])):\n if h[l[i][j]-1] >= h[i-1]:\n break\n else:\n good.add(i)\nprint(len(good))", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "n,m=list(map(int,input().split()))\nl=list(map(int,input().split()))\nans=[1]*n\nfor i in range(m):\n a,b=list(map(int,input().split()))\n if l[a-1]<l[b-1]:\n ans[a-1]=0\n elif l[a-1]>l[b-1]:\n ans[b-1]=0\n else:\n ans[a-1]=0\n ans[b-1]=0\nprint((sum(ans)))\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nh=list(map(int,input().split()))\n\nt=['W']*n\n\nfor i in range(m):\n a,b=map(int,input().split())\n if h[a-1]>=h[b-1]:\n t[b-1]='L'\n if h[a-1]<=h[b-1]:\n t[a-1]='L'\nprint(t.count('W'))", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "n,m = map(int, input().split())\nh = list(map(int, input().split()))\nab = [map(int, input().split()) for _ in range(m)]\na,b = [list(i) for i in zip(*ab)]\nMax = []\nfor i in range(n):\n Max.append(0)\n# print(Max)\nans = 0\nfor i in range(m):\n Max[a[i]-1] = max(Max[a[i]-1],h[b[i]-1])\n Max[b[i]-1] = max(Max[b[i]-1],h[a[i]-1])\n\nfor i in range(n):\n if h[i] > Max[i]:\n ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split())) #\u5c55\u671b\u53f0i\u306e\u6a19\u9ad8\nassert len(H) == N\npaths = [[] for i in range(N)]\nfor m in range(M):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n paths[a].append(b)\n paths[b].append(a) # \u5c55\u671b\u53f0A\u304b\u3089B\u3078\u306e\u9053\u3001\u305d\u306e\u9006\n\ncount = 0\nfor a in range(N):\n for b in paths[a]:\n if H[b] >= H[a]:\n break\n else:\n count += 1\nprint(count)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}]
[{"input": "4 3\n1 2 3 4\n1 3\n2 3\n2 4\n", "output": "2\n"}, {"input": "6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n", "output": "3\n"}]
4,701
Square1001 has seen an electric bulletin board displaying the integer 1. He can perform the following operations A and B to change this value: - Operation A: The displayed value is doubled. - Operation B: The displayed value increases by K. Square1001 needs to perform these operations N times in total. Find the minimum possible value displayed in the board after N operations. -----Constraints----- - 1 \leq N, K \leq 10 - All input values are integers. -----Input----- Input is given from Standard Input in the following format: N K -----Output----- Print the minimum possible value displayed in the board after N operations. -----Sample Input----- 4 3 -----Sample Output----- 10 The value will be minimized when the operations are performed in the following order: A, A, B, B. In this case, the value will change as follows: 1 → 2 → 4 → 7 → 10.
introductory
[{"code": "#!/usr/bin/env python3\nimport sys\nsys.setrecursionlimit(10**6)\n\nn = int(input())\nk = int(input())\n\nans = 1\nfor i in range(n):\n if ans*2 <= (ans+k):\n ans *= 2\n else:\n ans += k\n # print(ans)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\nvalue = 1\n\nfor i in range(N):\n if(value * 2 <= value + K):\n value = value * 2\n else:\n value = value + K\n\nprint(value)", "passed": true, "time": 0.18, "memory": 14184.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\ncnt = 1\nfor _ in range(n):\n cnt = min(cnt*2, cnt+k)\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nans = 1\nfor _ in range(N):\n if ans * 2 <= ans + K:\n ans *= 2\n else:\n ans += K\nprint(ans)\n", "passed": true, "time": 0.18, "memory": 14284.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nans=1\nfor _ in range(n):\n if(ans*2 < ans+k):\n ans=ans*2\n else:\n ans=ans+k\n \nprint(ans)", "passed": true, "time": 0.43, "memory": 13872.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\nstart = 1\n\nfor n in range(N):\n start = min(start*2, start+K)\n\nprint(start)\n", "passed": true, "time": 0.48, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\nans = 1\nfor _ in range(N):\n ans = min(ans * 2, ans + K)\nprint(ans)", "passed": true, "time": 0.43, "memory": 13800.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nc=1\nfor i in range(a):\n if 2*c<=c+b:\n c=2*c\n else:\n c=c+b\nprint(c)", "passed": true, "time": 0.22, "memory": 14180.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\nans = 1\nfor _ in range(N):\n ans = min(ans*2,ans+K)\nprint(ans)", "passed": true, "time": 0.32, "memory": 14052.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nref = 1\n\nfor i in range(n):\n if ref * 2 < ref + k:\n ref *= 2\n else:\n ref += k\n\nprint(ref)", "passed": true, "time": 0.22, "memory": 14176.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\ndis = 1\nfor i in range(n):\n if dis*2 <= dis+k:\n dis *= 2\n else:\n dis += k\nprint(dis)", "passed": true, "time": 0.3, "memory": 14152.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\ntmp = 1\nfor i in range(n):\n tmp = min(tmp * 2, tmp + k)\nprint(tmp)\n", "passed": true, "time": 0.32, "memory": 14264.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\na = 1\nfor i in range(n):\n if a <= k:\n a *= 2\n else:\n a += k\nprint(a)", "passed": true, "time": 0.24, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\na = 1\nfor i in range(n):\n a = min(2*a,a+k)\nprint(a)", "passed": true, "time": 0.15, "memory": 14200.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\n\nans=1\nfor i in range(N):\n if ans<=K:\n ans*=2\n else:\n ans+=K\n\nprint(ans)", "passed": true, "time": 0.23, "memory": 14212.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nstart=1\nfor i in range(N):\n start_a=start*2\n start_b=start+K\n if start_a<=start_b:\n start=start_a\n else:\n start=start_b\n\nprint(start)", "passed": true, "time": 0.15, "memory": 14276.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\nn = int(input())\nk = int(input())\nans = 1\nfor i in range(n):\n ans = min(ans*2, ans+k)\n\nprint(ans)\n", "passed": true, "time": 0.21, "memory": 14184.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nc = 1\nfor i in range(n):\n if c > k:\n c += k\n else:\n c *= 2\nprint(c)", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "N,K = [int(input()) for _ in range(2)]\n\nans = 1\n\nfor _ in range(N):ans = min(ans+K,ans*2)\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nans = 1\nfor i in range(N):\n ans = min(ans*2, ans+K)\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nnum = 1\n\nfor i in range(n):\n num = min(num + k, num * 2)\n \nprint(num)", "passed": true, "time": 0.18, "memory": 14048.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\nans = 1\n\ndef A(n):\n return 2 * n\n\ndef B(n):\n return n + K\n\nfor i in range(N):\n if A(ans) <= B(ans):\n ans = A(ans)\n else:\n ans = B(ans)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\na=1\nfor _ in range(n):\n if a<k:\n a*=2\n else:\n a+=k\nprint(a)", "passed": true, "time": 0.15, "memory": 14048.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\nx = 1\nfor i in range(n):\n x = min(x * 2, x + k)\nprint(x)\n", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\nans = 1\nfor i in range(n):\n if ans >= k:\n ans += k\n else:\n ans *= 2\nprint(ans)", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nans=1\nfor _ in range(n):\n if ans<k:ans*=2\n else:ans+=k\nprint(ans)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "n,k=int(input()),int(input());a=1\nwhile a<=k:\n if n==0:\n print(a)\n return\n a*=2\n n-=1\nwhile n>0:\n a+=k\n n-=1\nprint(a)", "passed": true, "time": 0.13, "memory": 14252.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\ngiven_integer=1\n#Option A:-To Increase The Value By double\n#Option B:-To Increase Value By K\n\nfor i in range(0,n):\n\tgiven_integer=min(given_integer*2,given_integer+k)\n\nprint((int(given_integer)))\n", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n,k = int(input()),int(input())\n# Greedy\nans = 1\nfor i in range(n):\n ans = min(ans+k, ans*2)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nans = 1\nfor _ in range(n):\n if ans < k:\n ans *= 2\n else:\n ans += k\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\ncnt = 1\ntmp = 0\nfor i in range(n):\n cnt = min(cnt*2, cnt + k)\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nans = 1\nfor i in range(n):\n ans = min(ans*2,ans+k)\nprint(ans)", "passed": true, "time": 0.16, "memory": 14152.0, "status": "done"}, {"code": "n, k = [int(input()) for _ in range(2)]\n\nresult = 10 ** 9\n\nfor bit in range(2 ** n):\n \n tmp = 1\n for i in range(n):\n if bit & (1 << i):\n tmp *= 2\n else:\n tmp += k\n \n result = min(result, tmp)\n \nprint(result)", "passed": true, "time": 0.24, "memory": 14100.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\na=1\nfor i in range(n):\n if a<=k:\n a*=2\n else:\n a+=k\n\nprint(a)", "passed": true, "time": 0.16, "memory": 14136.0, "status": "done"}, {"code": "n, k = (int(input()) for i in range(0, 2))\nans = 1\nfor i in range(0, n):\n if ans * 2 <= ans + k: ans *= 2\n else: ans += k\nprint(ans)", "passed": true, "time": 0.15, "memory": 14176.0, "status": "done"}, {"code": "n,k = [int(input()) for i in range(2)]\n\nnumber=1\n\nfor i in range(n):\n number = min(2*number, number+k)\nprint(number)", "passed": true, "time": 0.16, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nans = 1\nfor _ in range(n):\n if ans * 2 > ans + k:\n ans += k\n else:\n ans *= 2\nprint(ans)", "passed": true, "time": 0.27, "memory": 14020.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\nres = 1\nfor i in range(N):\n if(K >= res):\n res *= 2\n else:\n res += K\nprint(res)\n", "passed": true, "time": 0.16, "memory": 14264.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nnum = 1\nfor i in range(n):\n if num*2 <= num+k:\n num *= 2\n else:\n num += k\n\nprint(num)", "passed": true, "time": 0.16, "memory": 14144.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\na = 1\nfor i in range(n):\n if a <= k:\n a *= 2\n else:\n a += k\nprint(a)", "passed": true, "time": 0.24, "memory": 14148.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = 1\nfor i in range(N):\n if X<K:\n X += X\n else:\n X += K\n\nprint(X)\n", "passed": true, "time": 0.15, "memory": 14040.0, "status": "done"}, {"code": "# coding: utf-8\nimport math\n\nans = 1\ncount = 0\nnum1 = int(input())\nnum2 = int(input())\nfor i in range(num1):\n if ans < num2:\n ans *= 2\n else:\n ans += num2\nprint(ans)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "ans=float('inf')\nn,k=int(input()),int(input())\nfor i in range(2**n):\n ans=min(ans,eval('('*n+'1'+\"\".join('*2)'if (i>>j)%2 else '+'+str(k)+')' for j in range(n))))\nprint(ans)", "passed": true, "time": 0.16, "memory": 14172.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\na = 1\nfor i in range(n):\n if a<k:\n a = a*2\n else:\n a+=k\nprint(a)", "passed": true, "time": 0.22, "memory": 14280.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = 1\nfor i in range(n):\n if x + k <= 2*x:\n x += k\n else:\n x *= 2\nprint(x)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\nstart = 1\nfor i in range(N):\n start = min(start * 2, start + K)\n\nprint(str(start))", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nj = 1\ndef func(x, y):\n r = (x * 2) if (x * 2) < (x + y) else (x + y)\n return r\n\nfor i in range(N):\n j = func(j, K)\nprint(j)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\nans = 1\n\nfor i in range (0 , n):\n ans = min(2 * ans, ans + k)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nnumb = 1\nfor i in range(n):\n if 2*numb < numb+k:\n numb *= 2\n else:\n numb += k\nprint(numb)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nx=1\nfor _ in range(N):\n x=min(2*x,x+K)\nprint(x)\n", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\nout = 1\nflg = 0\nfor i in range(N):#A\u306e\u56de\u6570\u3092\u6570\u3048\u308b\u305f\u3081\u306e\u30eb\u30fc\u30d7\n if not flg:#\u30d5\u30e9\u30b0\u304c\u7acb\u3063\u3066\u306a\u304b\u3063\u305f\u3089\u64cd\u4f5cA\n out *= 2\n if out > K:\n flg = 1\n else:#\u30d5\u30e9\u30b0\u304c\u7acb\u3063\u305f\u3089\u64cd\u4f5cB\n out += K\n\nprint(out)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "def main():\n n = int(input())\n k = int(input())\n\n ans = 1\n for i in range(n):\n ans = min(2*ans, ans+k)\n print(ans)\n\n\nmain()", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\ns=1\nfor i in range(n):\n s=min(s*2,s+k)\nprint(s)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nans=1000\nfor i in range(N+1):\n num=1\n for s in range(i):\n num = num*2\n \n for t in range(N-i):\n num += K\n \n if num < ans:\n ans = num\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "#76B\nn=int(input())\nk=int(input())\nf=1\nfor i in range(0,n):\n if f*2<f+k:\n f=f*2\n else:\n f=f+k\nprint(f)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "n,k=int(input()),int(input())\nans=1\ni=0\nwhile i!=n:\n if ans>=k:\n ans+=k\n else:\n ans*=2\n i+=1\nprint(ans)", "passed": true, "time": 0.26, "memory": 14300.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\nN = int(input())\nK = int(input())\n\nans = 1\nfor i in range(N):\n a = ans * 2\n b = ans + K\n ans = min(a, b)\nprint(ans)\n", "passed": true, "time": 0.23, "memory": 14248.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\na=1\nfor i in range(N):\n if a < K:\n a *= 2\n else:\n a += K\nprint(a)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\nx = 1\nfor _ in range(N):\n x += min(x, K)\n\nprint(x)", "passed": true, "time": 0.32, "memory": 14260.0, "status": "done"}, {"code": "n, k = [int(input()) for i in range(2)]\na = 1\nfor i in range(n):\n if a * 2 > a + k:\n a += k\n else:\n a *= 2\nprint(a)", "passed": true, "time": 0.37, "memory": 14252.0, "status": "done"}, {"code": "n,k = int(input()),int(input())\nans = 1\nfor i in range(n):\n ans = min(ans+k,ans*2)\nprint(ans)\n", "passed": true, "time": 0.37, "memory": 14024.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\nans = 1\n\nfor i in range(n):\n ans = min(ans*2, ans+k)\n\nprint(ans)", "passed": true, "time": 0.38, "memory": 14212.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nstart = 1\nfor i in range(N):\n start = min(start*2, start+K)\nprint(start)", "passed": true, "time": 0.37, "memory": 14044.0, "status": "done"}, {"code": "def answer(n: int, k: int) -> int:\n current_num = 1\n for _ in range(n):\n current_num = min(current_num * 2, current_num + k)\n\n return current_num\n\n\ndef main():\n n =int(input())\n k = int(input())\n print((answer(n, k)))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.21, "memory": 14064.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\nres = 1\nfor i in range(n):\n if res >= k:\n res += k\n else:\n res *= 2\nprint(res)\n", "passed": true, "time": 0.18, "memory": 14048.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\n\n#A+B=N\n#A:C[i]*2 \n#B:C[i]+K\n \nC=1\nfor i in range(N):\n if C*2>C+K:\n C=C+K\n else:\n C=C*2\n \nprint(C)\n \n\n", "passed": true, "time": 0.21, "memory": 14184.0, "status": "done"}, {"code": "def solve():\n n = int(input())\n k = int(input())\n ans = 1\n for i in range(n):\n if ans < k:\n ans *= 2\n else:\n ans += k\n\n print(ans)\n\n\ndef __starting_point():\n solve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n \nnum = 1\ncount = 0\n \nwhile count < n:\n num = min(num * 2, num + k)\n count += 1\n \nprint(num)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\nans = 1\nfor r in range(n):\n if ans <= k:\n ans *= 2\n else:\n ans += k\n\nprint(ans)", "passed": true, "time": 0.25, "memory": 14228.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\ninit = 1\nfor i in range(N):\n init = min(init*2, init + K)\nprint(init)", "passed": true, "time": 0.25, "memory": 14064.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\na = 1\nfor _ in range(N):\n if a*2 < a+K:\n a *= 2\n else:\n a += K\nprint(a)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\n\nnum=1\nfor i in range(n):\n num=min(num*2,num+k)\n\nprint(num)", "passed": true, "time": 0.16, "memory": 14216.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nans=1\nfor i in range(n):\n if ans<k:\n ans*=2\n else:\n ans+=k\nprint(ans)", "passed": true, "time": 0.15, "memory": 14040.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\nans = 1\nfor _ in range(N):\n if ans + K < 2 * ans:\n ans += K\n else:\n ans *= 2\nprint(ans)", "passed": true, "time": 0.15, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\ni=1\nfor _ in range(n):\n i = i+min(i,k)\nprint(i)", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\n\nfrom itertools import product\n\npr = list(product([0,1],repeat=n))\n\nans=float('inf')\nfor p in pr:\n\n tmp=1\n for i in p:\n if i==0:\n tmp*=2\n else:\n tmp+=k\n\n ans= min(ans,tmp)\n\n\nprint(ans)\n\n", "passed": true, "time": 0.23, "memory": 14324.0, "status": "done"}, {"code": "n = int(input())\nk = int(input()) \nmn = 1\nfor i in range(n):\n if mn + k <= mn *2:\n mn += k\n else:\n mn = mn * 2\nprint(mn)\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\ns = 1\nfor _ in range(N):\n s = min(s * 2, s + K)\nprint(s)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\ncnt = 1\nfor _ in range(n):\n if cnt <= k:\n cnt *= 2\n else:\n cnt += k\nprint(cnt)", "passed": true, "time": 0.13, "memory": 14208.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\n\nans = float(\"inf\")\nfor i in range(N+1):\n num = 1 * (2 ** i) + K * (N - i)\n ans = min(ans, num)\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nans = 1\nfor i in range(N):\n ans = min(2*ans,ans+K)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "N = int (input ())\nK = int (input ())\ns = 1\nfor i in range (N):\n if s < K:\n s = s*2\n else:\n s += K\nprint (s)", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\na = 1\nfor _ in range(N):\n a = min(a*2, a+K)\nprint(a)", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nx = 1\nfor _ in range(N):\n\tx = min(x * 2, x + K)\nprint(x)", "passed": true, "time": 0.22, "memory": 14064.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nans = 1\nfor _ in range(n):\n ans = min(ans*2, ans+k)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\ndisplay = 1\n\nfor i in range(N):\n display = min(display*2, display + K)\nprint(display)\n", "passed": true, "time": 0.23, "memory": 14084.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\n\nans = 1\nfor i in range(n):\n ans = min(ans * 2, ans + k)\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "import sys\n\ninput = sys.stdin.readline\nN = int(input())\nK = int(input())\n\nc = 0\ntmp = 1\nwhile c < N:\n if tmp < K:\n tmp *= 2\n else:\n tmp += K\n c += 1\n # print(tmp)\n\nprint(tmp)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nx = 1\nfor i in range(a):\n if x + b > x * 2:\n x = x * 2\n else:\n x = x + b\nprint(x)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "n,k=int(input()),int(input());a=1\nfor _ in range(n): a=min(2*a,k+a)\nprint(a)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nres=1\nfor i in range(N) :\n if res*2<=res+K :\n res*=2\n else :\n res+=K\nprint(res)", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nans = 1\nfor i in range(n):\n ans = min(ans*2,ans+k)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nans=1\nfor i in range(n):\n ans=min(ans+k,ans*2)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14060.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nnow=1\nfor i in range(N):\n now=min(now*2,now+K)\nprint(now)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nc = 1\nfor i in range(n):\n c = min(2*c, c+k)\nprint(c)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "import bisect, collections, copy, heapq, itertools, math, string, sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = float('inf')\ndef I(): return int(input())\ndef F(): return float(input())\ndef SS(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LSS(): return input().split()\n\ndef resolve():\n N = I()\n K = I()\n\n ans = 1\n while ans < K and N > 0:\n ans *= 2\n N -= 1\n ans += N * K\n\n print(ans)\n\ndef __starting_point():\n resolve()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14140.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nans = 1\n\nfor i in range(N):\n if ans > K:\n ans += K\n else:\n ans *= 2\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nv = 1\nfor _ in range(N):\n if v <= K:\n v *= 2\n else:\n v += K\nprint(v)", "passed": true, "time": 0.14, "memory": 14020.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nans=1\nfor i in range(n):\n if ans*2 >= ans+k:\n ans=ans+k\n else:\n ans=ans*2\nprint(ans)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}]
[{"input": "4\n3\n", "output": "10\n"}, {"input": "10\n10\n", "output": "76\n"}]
4,702
Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. -----Constraints----- - 0 \leq x \leq 1 - x is an integer -----Input----- Input is given from Standard Input in the following format: x -----Output----- Print 1 if x is equal to 0, or 0 if x is equal to 1. -----Sample Input----- 1 -----Sample Output----- 0
introductory
[{"code": "X=int(input())\nprint(1-X)", "passed": true, "time": 0.27, "memory": 14060.0, "status": "done"}, {"code": "x = int(input())\nprint(1 if x == 0 else 0)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "num = int(input())\nif num == 0:\n print(1)\nelif num == 1:\n print(0)", "passed": true, "time": 0.15, "memory": 14016.0, "status": "done"}, {"code": "x=int(input())\n\nif x==0:\n print((1))\nelse:\n print((0))\n\n", "passed": true, "time": 1.92, "memory": 14132.0, "status": "done"}, {"code": "x=int(input())\nprint(1 if x==0 else 0)", "passed": true, "time": 0.22, "memory": 14160.0, "status": "done"}, {"code": "x=int(input())\nif x==0:\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.26, "memory": 14132.0, "status": "done"}, {"code": "X = int(input())\n\nprint(1-X)", "passed": true, "time": 0.22, "memory": 14084.0, "status": "done"}, {"code": "x = int(input())\nif x==1:\n print((0))\nif x==0:\n print((1))\n", "passed": true, "time": 0.27, "memory": 14096.0, "status": "done"}, {"code": "print(1-int(input()))", "passed": true, "time": 0.19, "memory": 14172.0, "status": "done"}, {"code": "x = int(input())\nif x == 1:\n print(0)\nelse :\n print(1)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "x = int(input())\n\nif x == 0:\n x = 1\nelse:\n x = 0\n\nprint(x)", "passed": true, "time": 0.19, "memory": 14128.0, "status": "done"}, {"code": "x = int(input())\nif x == 0 :\n print(\"1\")\nelse :\n print(\"0\")", "passed": true, "time": 0.19, "memory": 14204.0, "status": "done"}, {"code": "print(int(input())^1)", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "a=input()\nprint(0) if a=='1' else print(1)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "a = int(input())\n\nif a == 0:\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "print(1 if int(input()) == 0 else 0)", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "x=int(input())\nprint(1 if x==0 else 0)", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "x = int(input())\n\nif x == 0:\n print(1)\nif x == 1:\n print(0)", "passed": true, "time": 0.14, "memory": 13984.0, "status": "done"}, {"code": "x = int(input())\nprint(1 - x)", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "x = input()\nans = 1 if x == '0' else 0\nprint(ans)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "print(int(not int(input())))", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "print(int(input())^1)", "passed": true, "time": 0.2, "memory": 14208.0, "status": "done"}, {"code": "print(1-int(input()))", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "x = int(input())\nif x == 0:\n print(1)\nelif x == 1:\n print(0)", "passed": true, "time": 0.24, "memory": 13996.0, "status": "done"}, {"code": "x = int(input())\n\nif x == 1:\n print(0)\nelse:\n print(1)", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "a=int(input())\n\nif a == 1:\n ans = 0\nelse:ans = 1\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "n = input()\nif n == '0':\n print('1')\nelse:\n print('0')", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "x = int(input())\n\nif x==0:\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "n=int(input())\nif n==0:\n print('1')\nelif n==1:\n print('0')", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "x = int(input())\n\nif x == 0:\n print(\"1\")\nelse:\n print(\"0\")", "passed": true, "time": 0.14, "memory": 13980.0, "status": "done"}, {"code": "x = input()\nif x == '0': print((1))\nelse: print((0))\n", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "x = int(input())\nif(x == 0):\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "x=int(input())\nif x==0:\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.38, "memory": 14260.0, "status": "done"}, {"code": "x=int(input())\nif x==1:\n print(0)\nelse:\n print(1)", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "print(\"0\" if input() == \"1\" else \"1\")", "passed": true, "time": 0.26, "memory": 14328.0, "status": "done"}, {"code": "A = int(input())\n\nif A == 0:\n print(\"1\")\nelse :\n print(\"0\")", "passed": true, "time": 0.18, "memory": 14196.0, "status": "done"}, {"code": "x = int(input())\nif x ==0:\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "x = int(input())\n\nif x == 1:\n print(0)\nelse:\n print(1)", "passed": true, "time": 0.27, "memory": 14304.0, "status": "done"}, {"code": "inp = input()\nif(inp == '0'):\n print('1')\nelse:\n print('0')", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "A = input()\nA = int(A)\nif A == 1:\n print(\"0\")\nelse:\n print(\"1\")\n", "passed": true, "time": 0.14, "memory": 13996.0, "status": "done"}, {"code": "i = int (input())\nif i == 1:\n print(0)\nelse:\n print(1)", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "x = int(input())\nprint((1 if x == 0 else 0))", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "print(int(input())^1)", "passed": true, "time": 0.49, "memory": 14300.0, "status": "done"}, {"code": "x=int(input())\nif x==0:\n print(1)\nif x==1:\n print(0)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "x=int(input())\nif x==0:\n\tprint(1)\nelse:\n\tprint(0)", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "x = int(input())\nif x == 0:\n print(1)\nelif x == 1:\n print(0)", "passed": true, "time": 0.23, "memory": 13952.0, "status": "done"}, {"code": "def __starting_point():\n x = int(input())\n if x == 1:\n print(0)\n elif x == 0:\n print(1)\n__starting_point()", "passed": true, "time": 0.23, "memory": 14288.0, "status": "done"}, {"code": "print(int(input()) ^ 1)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "x = int(input())\n\nif (x == 0):\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "x=int(input())\nif x ==0:\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "x = input()\nif x == '1':\n print(\"0\")\nelif x == '0': \n print(\"1\")", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "a=int(input())\nif a==1:\n print(0)\nelse:\n print(1)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "x = int(input())\nprint(1-x)", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "print('10'[int(input())])", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "import sys\nimport heapq\nimport math\nimport fractions\nimport bisect\nimport itertools\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\ndef input(): return sys.stdin.readline().strip()\ndef mp(): return map(int,input().split())\ndef lmp(): return list(map(int,input().split()))\n\nx = int(input())\nif x == 0:\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "n = int(input())\nif n == 1:\n print((0))\nelse:\n print((1))\n", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "if int(input()) == 0:\n print((1))\nelse:\n print((0))\n", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "print(int(input())^1)", "passed": true, "time": 0.25, "memory": 14152.0, "status": "done"}, {"code": "print(int(input())^1)", "passed": true, "time": 0.25, "memory": 14132.0, "status": "done"}, {"code": "print(1-int(input()))", "passed": true, "time": 0.93, "memory": 14044.0, "status": "done"}, {"code": "print(int(input())^1)", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "x=int(input())\nprint(1 if x==0 else 0)", "passed": true, "time": 0.19, "memory": 14264.0, "status": "done"}, {"code": "from sys import stdin\nx = int(stdin.readline().rstrip())\nif x == 1:\n print(0)\nelse:\n print(1)", "passed": true, "time": 0.19, "memory": 14320.0, "status": "done"}, {"code": "x=int(input())\nprint((1-x))\n \n", "passed": true, "time": 0.2, "memory": 14052.0, "status": "done"}, {"code": "x=input()\nif int(x) == 0:\n print(1) \nelse :\n print(0)", "passed": true, "time": 0.16, "memory": 14300.0, "status": "done"}, {"code": "x = int(input())\n\nif x == 1:\n print(0)\nelif x == 0:\n print(1)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "print((1+(int(input())))%2)", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "x = int(input())\nif x == 0:\n print(1)\nelif x == 1:\n print(0)", "passed": true, "time": 0.24, "memory": 13984.0, "status": "done"}, {"code": "print(1 if input()==\"0\" else 0)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "print(1 - int(input()))", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}, {"code": "N, =map(int,input().split())\nprint(1^N)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "x=int(input())\nif x==0:\n print(1)\nelif x==1:\n print(0)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "x = int(input())\nprint(int(x == 0))", "passed": true, "time": 0.23, "memory": 14160.0, "status": "done"}, {"code": "x=int(input())\nprint(1-x)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "x = int(input())\n\nprint(1 if x == 0 else 0)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "x = input()\nprint(0 if x == \"1\" else 1)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "a = int(input())\nif a == 0:\n print(a+1)\nelse:\n print(a-1)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "a = int(input())\nif a == 1:\n print(0)\nelse:\n print(1)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "x = int(input())\n\nans = 1 - x\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "x = int(input())\nprint((x+1)%2)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "print(int(input()) ^ 1)", "passed": true, "time": 0.23, "memory": 14188.0, "status": "done"}, {"code": "x = int(input())\nif x == 1:\n print(\"0\")\nelif x == 0:\n print(\"1\")\nelse:\n print(\"error\")", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "print(1-int(input()))", "passed": true, "time": 0.16, "memory": 14072.0, "status": "done"}, {"code": "x = int(input())\nif x == 1:\n print(\"0\")\nelse:\n print(\"1\")", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "x = int(input())\n\nif x == 0:\n print((1))\nelse:\n print((0))\n", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "x = int(input())\n\nif x == 0:\n print(\"1\")\nelse :\n print(\"0\")", "passed": true, "time": 0.22, "memory": 13980.0, "status": "done"}, {"code": "x = int(input())\nif x == 0:\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.25, "memory": 14340.0, "status": "done"}, {"code": "x = int(input())\nif x == 0:\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.25, "memory": 14128.0, "status": "done"}, {"code": "if int(input())==1:\n print(0)\nelse:\n print(1)", "passed": true, "time": 0.25, "memory": 14232.0, "status": "done"}, {"code": "x = int(input())\n\nif x:\n print((0))\nelse:\n print((1))\n", "passed": true, "time": 0.25, "memory": 13992.0, "status": "done"}, {"code": "x = int(input())\nif x == 0:\n print(1)\nelif x == 1:\n print(0)", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "x = int(input())\n\nif x == 0:\n print(1)\n \nelse:\n print(0)", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "print(abs(int(input())-1))", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "x =int(input())\n\nif(x == 0):\n print(1)\n return\nprint(0)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "x_str = input()\nx = int(x_str)\n\nif x == 1:\n print(0)\nelif x == 0:\n print(1)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "x = int(input())\n\nif(x==0):\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.15, "memory": 14108.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\nx=int(input())\nif x==0:\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.13, "memory": 14264.0, "status": "done"}, {"code": "x=int(input())\nif x == 0:\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "print(1 if int(input()) == 0 else 0)", "passed": true, "time": 0.13, "memory": 14152.0, "status": "done"}]
[{"input": "1\n", "output": "0\n"}, {"input": "0\n", "output": "1\n"}]
4,703
You are given a string S consisting of digits between 1 and 9, inclusive. You can insert the letter + into some of the positions (possibly none) between two letters in this string. Here, + must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. Evaluate all possible formulas, and print the sum of the results. -----Constraints----- - 1 \leq |S| \leq 10 - All letters in S are digits between 1 and 9, inclusive. -----Input----- The input is given from Standard Input in the following format: S -----Output----- Print the sum of the evaluated value over all possible formulas. -----Sample Input----- 125 -----Sample Output----- 176 There are 4 formulas that can be obtained: 125, 1+25, 12+5 and 1+2+5. When each formula is evaluated, - 125 - 1+25=26 - 12+5=17 - 1+2+5=8 Thus, the sum is 125+26+17+8=176.
introductory
[{"code": "import copy\n\ns=input()\nl=len(s)\nans=0\n\nif l==1:\n ans+=int(s)\n print(ans)\n \nelse:\n for i in range(2**(l-1)):\n t=copy.deepcopy(s)\n f=[]\n ch=0\n for j in range(l-1):\n if ((i>>j)&1):\n t=t[:j+1+ch]+'+'+t[j+1+ch:]\n ch+=1\n \n if '+' in t:\n \n y=list(map(int,t.split('+')))\n for u in y:\n ans+=u\n else:\n ans+=int(t)\n \n print(ans)", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "s = input()\nL = []\nsigma = 0\ndef sprit_sum(string, sprit, num):\n nonlocal sigma\n for i in range(1,len(string)+num-sprit):\n str_front = string[:i]\n str_back = string[i:]\n L.append(int(str_front)) \n if num < sprit:\n sprit_sum(str_back, sprit, num+1)\n else:\n L.append(int(str_back))\n for x in L:\n sigma += x\n L.pop()\n L.pop()\n \nfor j in range(len(s)):\n sprit_sum(s, j+1, 1)\nsigma += int(s)\nprint(sigma)\n", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "S = input()\nn = len(S)\n\ndef dfs(i, f):\n if i == n - 1:\n return sum(list(map(int, f.split('+'))))\n\n return dfs(i+1, f+S[i+1]) + dfs(i+1, f+'+'+S[i+1])\n\nprint((dfs(0, S[0])))\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "s = input()\nl = len(s)-1\nres = 0\nfor i in range(2**l):\n t = s[0]\n for j in range(l):\n if i&(1<<j):\n t += \"+\"\n t+=s[j+1]\n res += eval(t)\nprint(res)", "passed": true, "time": 0.14, "memory": 14000.0, "status": "done"}, {"code": "S = input()\nl = len(S)\nans = 0\nfor i in range(l):\n for j in range(i+1,l+1):\n temp = int(S[i:j])\n ans += temp * max(1,pow(2,i-1)) * max(1,pow(2,l-j-1))\nprint(ans)", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "import itertools\nS = input()\nnpm = len(S) - 1\nsum = eval(S)\npcomb = []\nfor i in range(npm):\n pcomb.append(list(itertools.combinations(list(range(1, npm + 1)), i + 1)))\nfor j in pcomb:\n k = 0\n for l in range(len(j)):\n pcomb2 = j[k]\n npmc = 0\n F = S\n for m in pcomb2:\n F = F[:m + npmc] + \"+\" + F[m + npmc:]\n npmc += 1\n sum += eval(F)\n k += 1\nprint(sum)\n", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "S=input()\nN=len(S)\nans=0\nfor i in range(2**(N-1)):\n Bit = list(i+1 for i in range(N-1))\n for j in range(N-1):\n if (i >> j) & 1:\n Bit[j] = 0\n Bit=[b for b in Bit if b>0]\n L=0\n for b in Bit:\n ans+=int(S[L:b])\n L=b\n ans+=int(S[L:])\nprint(ans)", "passed": true, "time": 0.2, "memory": 14304.0, "status": "done"}, {"code": "def dfs(i, f):\n if i == n - 1:\n return sum(list(map(int, f.split('+'))))\n\n return dfs(i + 1, f + a[i + 1]) + dfs(i + 1, f + '+' + a[i + 1])\n\n\na = input()\nn = len(a)\n\nprint((dfs(0, a[0])))\n", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "s = input()\nlen_s = len(s)\n\ntotal = int(s)\neval_s = \"\"\ninsert_list = []\nfor i in range(1, 2 ** (len_s - 1)):\n # print(i)\n for j in range(len_s):\n eval_s += s[j]\n if ((i >> j) & 1):\n # print(i, j)\n eval_s += \"+\"\n # print(eval_s)\n total += eval(eval_s)\n eval_s = \"\"\nprint(total)\n", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "a=list(input())\nans=0\nfor i in range(2**(len(a)-1)):\n s=a[0]\n for j in range(len(a)-1):\n if i%2:s+='+'\n s+=a[j+1]\n i//=2\n ans+=eval(s)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "S = input()\nn = len(S)\n \nans = 0\n \nfor i in range(2**(n-1)):\n t = S[0]\n for j in range(n-1):\n if (i>>j)&1:\n t += \"+\"\n t += S[j+1]\n ans += eval(t)\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "s=input()\nn=len(s)\nans=0\nfor i in range(2**(n-1)):\n x=[0]*(n-1)\n k=i\n for j in range(n-1):\n x[j]+=k//(2**(n-2-j))\n k-=2**(n-2-j)*(k//(2**(n-2-j)))\n a=s[0]\n for j in range(n-1):\n if x[j]==0:\n a=a+s[j+1]\n else:\n ans+=int(a)\n a=s[j+1]\n ans+=int(a)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14336.0, "status": "done"}, {"code": "S=input()\nl=len(S)\nls=''\nfor i in range(1,l):ls+=str(i)\nsa=['']*(2*l-1)\nfor i in range(len(sa)):\n if i%2==0:\n sa[i]=S[i//2]\n\nimport copy\nimport itertools as it\nans=0\nfor i in range(l):\n for j in list(it.combinations(ls, i)):\n sx=copy.copy(sa)\n for k in j:\n k=int(k)\n sx[2*k-1]='+'\n ans+=eval(''.join(sx))\nprint(ans)", "passed": true, "time": 0.16, "memory": 14312.0, "status": "done"}, {"code": "s = input()\nn = len(s) - 1\nres = 0\nfor i in range(1 << n):\n num_str = s[0]\n for j in range(n):\n if i >> j & 1 == 0:\n num_str += s[j + 1]\n else:\n res += int(num_str)\n num_str = s[j + 1]\n res += int(num_str)\n\nprint(res)\n", "passed": true, "time": 0.19, "memory": 14096.0, "status": "done"}, {"code": "import copy\n\ns=list(input())\na=[]\nfor i in range(len(s)):\n a.append(s[i])\n if i !=len(s)-1:\n a.append(\"\")\n\nans=0\n\nfor i in range(2**(len(s)-1)):\n l=copy.deepcopy(a)\n for j in range(len(s)-1):\n if (i>>j&1):\n l[2*j+1]=\"+\"\n ans+=eval(\"\".join(l))\n\nprint(ans)", "passed": true, "time": 0.22, "memory": 14232.0, "status": "done"}, {"code": "s = input()\nl = len(s)\n\n\ndef dfs(i, x):\n if i == l - 1:\n return eval(x)\n rep0 = dfs(i + 1, x + s[i + 1])\n rep1 = dfs(i + 1, x + \"+\" + s[i + 1])\n return rep0 + rep1\n\n\nans = dfs(0, s[0])\nprint(ans)\n", "passed": true, "time": 0.2, "memory": 14080.0, "status": "done"}, {"code": "s = input()\nn = len(s)\n\nans = 0\nfor bit in range(1 << n-1):\n tmp = s[0]\n for i in range(n-1):\n if bit & (1 << i):\n tmp += \"+\"\n tmp += s[i+1]\n \n ans += sum(map(int,tmp.split(\"+\")))\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "S = input()\nn = len(S)\nans = 0\nfor i in range(n):\n a = int(S[i])\n for j in range(n-i):\n ans += a * 10**j * 2**i * 2**(max(0,n-i-j-2))\nprint(ans)", "passed": true, "time": 0.2, "memory": 14132.0, "status": "done"}, {"code": "N = str(int(input()))\ntotal = 0\nl = len(N)-1\nif l == 0:\n print(N)\nelse:\n for i in range(2**l):\n b = format(i, '0'+str(l)+'b')\n subtotal = 0\n s = N[0]\n for j in range(len(b)):\n if int(b[j]):\n subtotal += int(s)\n s = N[j+1]\n else:\n s += N[j+1]\n\n subtotal += int(s)\n total += subtotal\n\n print(total)", "passed": true, "time": 0.2, "memory": 14220.0, "status": "done"}, {"code": "s = input()\ns_sum = []\nfor i in range(2**(len(s)-1)):\n sj = 0\n a = 0\n for j in range(len(s)-1):\n if ((i>>j) & 1):\n a += int(s[sj:j+1])\n sj = j+1\n a += int(s[sj:])\n s_sum.append(a)\nprint(sum(s_sum)) ", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "from itertools import product\ns=input()\na=0\nfor p in product((0,1),repeat=len(s)-1):\n t=s[0]\n for i,b in enumerate(p,start=1):\n if b==1:\n t+='+'+s[i]\n else:\n t+=s[i]\n a+=eval(t)\nprint(a)\n", "passed": true, "time": 0.22, "memory": 14072.0, "status": "done"}, {"code": "s = list(input())\nn = len(s)\nans = 0\n\nfor i in range(2**(n-1)):\n temp = s[0]\n for j in range(n-1):\n if i>>j & 1:\n temp += \"+\" + s[j+1]\n else:\n temp += s[j+1]\n ans += eval(temp)\n\nprint(ans)\n", "passed": true, "time": 0.2, "memory": 14240.0, "status": "done"}, {"code": "s = input()\nans = ''\nfor i in range(1 << (len(s) - 1)):\n ans += s[0]\n for j in range(len(s) - 1):\n if i >> j & 1:\n ans += ' '\n ans += s[j+1]\n ans += ' '\nprint(sum(map(int, ans.split())))", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "#\n# abc045 c\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"125\"\"\"\n output = \"\"\"176\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"9999999999\"\"\"\n output = \"\"\"12656242944\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n S = input()\n L = len(S)\n\n ans = 0\n for bit in range(1 << L-1):\n s = \"\"\n for i in range(L):\n if 1 << i & bit:\n s += S[i]\n s += \"+\"\n else:\n s += S[i]\n ans += eval(s)\n\n print(ans)\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.27, "memory": 14476.0, "status": "done"}, {"code": "s = input()\nn = len(s)\nans = 0\nfor i in range(2**(n-1)):\n t = []\n x = i\n for j in range(n-1):\n t.append(s[j])\n if x % 2 != 0:\n t.append('+')\n x = x // 2\n t.append(s[-1])\n m = 0\n for i in t:\n if i != '+':\n m *= 10\n m += int(i)\n else:\n ans += m\n m = 0\n ans += m\nprint(ans)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "S = input()\nf = lambda x: 2**(x-1) if x > 0 else 1\nlenS = len(S)\nans = 0\nfor i in range(1,lenS+1):\n for j in range(lenS-i+1):\n ans += int(S[j:j+i]) * f(j) * f(lenS-j-i) \nprint(ans)", "passed": true, "time": 0.27, "memory": 14216.0, "status": "done"}, {"code": "s = input()\nans = 0\n\nfor bit in range(1 << len(s)-1):\n f = s[0]\n\n for i in range(len(s)-1):\n if (bit & (1 << i)):\n f += '+'\n f += s[i+1]\n ans += sum(map(int, f.split('+')))\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "S = input()\nans = 0\n\nfor i in range(2**(len(S)-1)):\n tmp = S[0]\n for j in range(len(S)-1):\n if i & (1 << j):\n tmp += '+'\n tmp += S[j+1]\n ans += eval(tmp)\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14148.0, "status": "done"}, {"code": "s = input()\nn = len(s)\n\n\ndef dfs(now, total, i):\n if i == n:\n return total + now\n else:\n res = 0\n res += dfs(now * 10 + int(s[i]), total, i + 1)\n res += dfs(int(s[i]), total + now, i + 1)\n return res\n\n\nprint((dfs(int(s[0]), 0, 1)))\n", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "from itertools import product\nS = input()\nif len(S)==1:\n print(int(S))\nelse:\n Sum = 0\n for TR in product([0,1],repeat=(len(S)-1)):\n Op = ['+' if TO==1 else '' for TO in TR]+['']\n Sum += eval(''.join([TS+TO for TS,TO in zip(S,Op)]))\n print(Sum)", "passed": true, "time": 0.15, "memory": 14312.0, "status": "done"}, {"code": "s = input()\nn = len(s)-1\nans = 0\nfor i in range(2**n):\n op = [0]*n\n for j in range(n):\n if ((i >> j) & 1):\n op[j] = 1\n t = s[0]\n for j in range(1,n+1):\n if op[j-1] == 1:\n t += '+' + s[j:j+1]\n else:\n t += s[j:j+1]\n ans += sum(list(map(int,t.split('+'))))\nprint(ans)", "passed": true, "time": 0.27, "memory": 14060.0, "status": "done"}, {"code": "def hojyu(a):\n if len(a)!=N:\n return \"0\"*(N-len(a))+a\n else:\n return a\nS=input()\nN=len(S)-1\nR=list()\nans=0\nfor i in range(2**N):\n s=str(bin(i)[2:])\n s=hojyu(s)\n b=0\n mae=0\n for k in range(len(s)):\n if s[k]==\"1\":\n b+=int(S[mae:k+1])\n mae=k+1\n b+=int(S[mae:])\n ans+=b\nprint(ans)", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "s = input()\nall_s = []\ndef ss(index, perm):\n if index == len(s):\n all_s.append(perm)\n else:\n perm1 = [i for i in perm]\n perm1[-1] += s[index]\n ss(index+1, perm1)\n\n perm2 = [i for i in perm]\n perm2.append(s[index])\n ss(index+1, perm2)\n\nss(1, [s[0]])\nall_sum = 0\nfor way in all_s:\n tmp = 0\n for n in way:\n tmp += int(n)\n all_sum += tmp\nprint(all_sum)\n", "passed": true, "time": 0.23, "memory": 14296.0, "status": "done"}, {"code": "from itertools import product\nS = input()\ntotal = 0\nlength = len(S)\nList = list(product([0,1],repeat=length -1))\nformula = \"\"\nfor item in List:\n formula = S[0]\n for i in range(length-1):\n if item[i] == 0:\n formula += S[i+1]\n else:\n formula += '+'+S[i+1]\n total += eval(formula)\nprint(total)", "passed": true, "time": 0.15, "memory": 14236.0, "status": "done"}, {"code": "S = input()\n\nn = len(S)\n\nans = 0\nfor i in range(2**(n-1)):\n tmp = 0\n t = 0\n for j in range(n-1):\n if (i>>j)&1: \n tmp += int(S[t:j+1])\n t = j+1\n tmp += int(S[t:])\n ans += tmp\nprint(ans)\n", "passed": true, "time": 0.53, "memory": 14304.0, "status": "done"}, {"code": "S=input()\nl=len(S)\n\nls=[i for i in range(1,l)]\n \nsa=[]\nfor i in range(len(S)):sa+=[S[i],'']\nsa=sa[:-1]\n\nimport copy\nimport itertools as it\nans=0\nfor i in range(l):\n for j in it.combinations(ls, i):\n sx=copy.copy(sa)\n for k in j:sx[2*k-1]='+'\n ans+=eval(''.join(sx))\nprint(ans)", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "s = input()\nl = len(s)\nans = 0\nfor i in range(2 ** (l-1)):\n tmp = ''\n sum = 0\n for j in range(l-1):\n tmp += s[j]\n if i >> j & 1:\n sum += int(tmp)\n tmp = ''\n sum += int(tmp + s[-1])\n\n ans += sum\nprint(ans)", "passed": true, "time": 0.15, "memory": 14096.0, "status": "done"}, {"code": "S=input()\nl=len(S)\n\nimport itertools as it\na=0\nfor i in range(l):\n for j in it.combinations(range(1,l), i):\n t='';p=0\n for k in j:\n t+=S[p:k]+'+'\n p=k\n t+=S[p:]\n a+=eval(''.join(t))\nprint(a)", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "#!/usr/bin/env python\n# coding: utf-8\n\n# In[3]:\n\n\nfrom itertools import product\n\n\n# In[16]:\n\n\nS = input()\n\n\n# In[17]:\n\n\nlength = len(S)\nans = 0\nfor lst in product([\"+\",\"\"], repeat=length-1):\n mystr = \"\"\n for i in range(length-1):\n mystr += S[i]+lst[i]\n mystr += S[-1]\n mylist = [int(x) for x in mystr.split(\"+\")]\n ans += sum(mylist)\nprint(ans)\n\n\n# In[ ]:\n\n\n\n\n", "passed": true, "time": 0.22, "memory": 14272.0, "status": "done"}, {"code": "S = str(input())\nans = 0\nfor i in range(2**(len(S)-1)):\n s = S[0]\n for j in range(len(S)-1):\n if (i>>j) & 1:\n s += '+'\n s += S[j+1]\n ans += eval(s)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "s = str(input())\nans = 0\nfor i in range(2**(len(s) - 1)):\n l = s[0]\n for j in range(len(s)-1):\n if (i >> j) & 1:\n l += \"+\"\n l += s[j+1]\n ans += eval(l)#eval\u95a2\u6570\u306f\u6587\u5b57\u5217\u3092\u6570\u5f0f\u3068\u3057\u3066\u305d\u306e\u89e3\u3092\u8fd4\u3059\nprint(ans)", "passed": true, "time": 0.22, "memory": 14072.0, "status": "done"}, {"code": "S=input()\nn=len(S)\nans=0\n \nfor paint in range(2**(n-1)):\n\ttemp_S=S[0]\n \n\tfor i in range(n-1):\n\t\tif (paint>>i)&1==1:\n\t\t\ttemp_S+=\"+\"\n\t\ttemp_S+=S[i+1]\n \n\tans+=sum(map(int, temp_S.split(\"+\")))\nprint(ans)", "passed": true, "time": 0.15, "memory": 14252.0, "status": "done"}, {"code": "s = input()\n\ntotal = 0\n\nfor i in range(len(s)):\n for j in range(len(s) - i):\n n = int(s[j:j+i+1])\n if j == 0 or j == len(s) - i - 1:\n total += n * max([(2 ** (len(s) - i - 2)), 1])\n else:\n total += n * max([(2 ** (len(s) - i - 3)), 1])\n \nprint(total)", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "s = input()\nn = len(s)\nans = 0\n\nfor i in range(2 ** (n - 1)):\n k = 0\n num_list = []\n for j in range(n):\n if (i >> j) & 1:\n num = s[k : j + 1]\n# print(num)\n k = j + 1\n num_list.append(int(num))\n# print(num_list)\n num = s[k : n +1]\n num_list.append(int(num))\n ans += sum(num_list)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "s = input()\nn = len(s)\ndef dfs(i, f):\n if i == n-1:\n return sum(list(map(int,f.split('+'))))\n return dfs(i+1, f+s[i+1]) + dfs(i+1, f+'+'+s[i+1])\nprint(dfs(0, s[0]))", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "s = input()\n\nn = len(s)-1\nans = 0\nfor i in range(2**n):\n t = s[0]\n for j in range(n):\n if i >> j & 1: t += \"+\" # \u8a72\u5f53\u3059\u308b\u5834\u5408\u306e\u307f\"+\"\u3092\u8ffd\u52a0\u3059\u308b\n t += s[j+1] # \u6b21\u306e\u6587\u5b57\u3092\u8ffd\u52a0\n ans += eval(t) # \u751f\u6210\u3057\u305f\u6587\u5b57\u5217\u3092\u8a08\u7b97\nprint(ans)", "passed": true, "time": 0.15, "memory": 14136.0, "status": "done"}, {"code": "def dfs(i, f):\n if i == n-1:\n return sum(list(map(int, f.split(\"+\"))))\n\n return dfs(i+1, f + \"+\" + s[i+1]) + dfs(i+1, f + s[i+1])\n\n\ns = input()\nn = len(s)\n\nprint(dfs(0, s[0]))", "passed": true, "time": 0.2, "memory": 14180.0, "status": "done"}, {"code": "S=(input())\nlen_S=len(S)\nans=0\nleft=0\nis_plus=[0]*(len_S-1)\nfor i in range(2**(len_S-1)):\n left=0\n for j in range(len_S-1):\n i,mod=divmod(i,2)\n if mod==1:\n #print(left,j)\n ans+=int(S[left:j+1])\n left=j+1\n ans+=int(S[left:len_S])\nprint(ans)", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "s = input()\nn = len(s)\n\nans = 0\n\nfor bit in range(1 << (n - 1)):\n # \u5404\u5834\u5408\u3067\u5f0f f \u3092\u751f\u6210\u3059\u308b\n f = s[0]\n\n for i in range(n - 1):\n if bit & (1 << i):\n # \u30d5\u30e9\u30b0\u304c\u7acb\u3063\u3066\u3044\u308b\u306a\u3089\u3070 \"+\" \u3092\u5f0f\u306e\u672b\u5c3e\u306b\u8ffd\u52a0\u3059\u308b\n f += \"+\"\n f += s[i + 1]\n\n ans += sum(map(int, f.split(\"+\")))\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "# \u6bce\u56de\u633f\u308c\u308b\u304b\u633f\u308c\u306a\u3044\u304b\u306e\u4e8c\u629e\u306e\u63a2\u7d22\u3092\u3057\u3066\u307f\u308b\n# 2\u5024\u306a\u306e\u3067bit\u5168\u63a2\u7d22\u3092\u3084\u3063\u3066\u307f\u308b\n# \u9006\u30dd\u30fc\u30e9\u30f3\u30c9\u5fc5\u8981\u304b\uff1f\u3068\u601d\u3063\u305f\u3051\u3069\u52a0\u7b97\u3060\u3051\u3060\u3057\u3044\u3089\u3093\u304b\u3063\u305f\u308f\u52a9\u304b\u308b\ns = input()\nans = 0\nfor bit in range(0, 1 << len(s) - 1):\n opr = []\n for i in range(len(s) - 1):\n opr.append(\"\u6c34\u7740\" if bit >> i & 1 == 1 else \"\u30ef\u30f3\u30d4\u30fc\u30b9\")\n exp = [s[0]]\n for i in range(len(opr)):\n if opr[i] == \"\u30ef\u30f3\u30d4\u30fc\u30b9\":\n exp[-1] += s[i + 1]\n elif opr[i] == \"\u6c34\u7740\":\n exp.append(s[i + 1])\n ans += sum(list(map(int, exp)))\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "S = input()\nans = 0\n\nfor i in range(0,2**(len(S)-1)):\n tmp = S\n cnt = 0\n for j in range(0,len(S)):\n if ( i >> j ) & 1:\n cnt += 1\n tmp = tmp[0:j+cnt] + '+' + tmp[j+cnt:]\n ans += eval(tmp)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "S = input()\n\nn = len(S)\n\ndef dfs(i,f):\n if i == n-1:\n return sum(list(map(int, f.split(\"+\"))))\n\n return dfs(i+1, f+S[i+1]) + dfs(i+1, f+\"+\"+S[i+1])\nprint(dfs(0, S[0]))", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "s = input()\nnums = []\n\nf = \"0\"+str(len(s)-1)+\"b\"\n\nfor i in range(2**(len(s)-1)):\n m = format(i, f)\n\n l = 0\n r = 0\n while r < len(m):\n if m[r] == \"1\":\n nums.append(s[l:r+1])\n l = r+1\n r += 1\n\n nums.append(s[l:r+1])\n\nprint(sum(map(int, nums)))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n = input()\nopr = len(n) - 1\ncal_sum = 0\nfor i in range(2**opr):\n op = [\"\"] * opr\n for j in range(opr):\n if((i>>j)&1):\n op[opr-1-j] = \"+\"\n cal = \"\"\n for x,y in zip(n,op+[\"\"]):\n cal += x+y\n cal_sum += eval(cal)\nprint(cal_sum)", "passed": true, "time": 0.15, "memory": 14340.0, "status": "done"}, {"code": "def dfs(i,sall):\n if i == lenS:\n return (sall)\n #return sum(map(int,(s[0]+sall).split(\"+\")))\n return dfs(i + 1,sall+\"+\"+s[i])+\"+\"+dfs(i + 1,sall+s[i])\n\ns = input()\nlenS = len(s)\nprint(sum(map(int,dfs(1,s[0]).split(\"+\"))))", "passed": true, "time": 0.16, "memory": 14244.0, "status": "done"}, {"code": "# n-1\u7b87\u6240\u306b+\u3092\u3044\u308c\u308b\u304b\u3044\u308c\u306a\u3044\u304b\u306a\u306e\u3067bit\u5168\u63a2\u7d22\u304c\u53ef\u80fd\ns = list(input())\nans = 0\nfor bit in range(1 << len(s) - 1):\n a = [int(s[0])]\n for i in range(len(s) - 1):\n if (bit >> i) & 1 == 1:\n a.append(int(s[i + 1]))\n else:\n a[-1] = 10 * a[-1] + int(s[i + 1])\n ans += sum(a)\nprint(ans)\n", "passed": true, "time": 0.28, "memory": 14116.0, "status": "done"}, {"code": "s = input()\nn = len(s)\n\nans = 0\n\nfor i in range(2**(n-1)):\n f = s[0]\n \n for j in range(n-1):\n if i & (1<<j):\n f += '+'\n f += s[j+1]\n \n ans += sum(map(int, f.split('+')))\n \nprint(ans)", "passed": true, "time": 0.22, "memory": 14064.0, "status": "done"}, {"code": "def dfs(i, f):\n if i == n-1: #\u3082\u3057\u679d\u304c\u6700\u5f8c\u306e\u3051\u305f\u306b\u5230\u9054\u3057\u305f\u3089\u3001\u3068\u3044\u3046\u6761\u4ef6\u5f0f\n return sum (list(map(int, f.split('+'))))\n \n #\u5f0ff\u306e\u672b\u5c3e\u306b'+'\u3092\u8ffd\u52a0\u3059\u308b/\u8ffd\u52a0\u3057\u306a\u3044\u3092\u3057\u3066\u6b21\u306e\u6570\u5b57\u3092\u8ffd\u52a0\n return dfs(i+1, f+s[i+1]) + dfs(i+1, f+'+'+s[i+1])\ns = input()\nn = len(s)\nprint((dfs(0, s[0])))\n", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "S = list(input())\nN = len(S)-1\nans = 0\nfor i in range(1 << N):\n a = S[0]\n for j in range(N):\n if(i >> j) & 1 == 0:\n a += S[j+1]\n else:\n x = int(a)\n ans += x\n a = S[j+1]\n x = int(a)\n ans += x\nprint(ans)\n", "passed": true, "time": 0.29, "memory": 14108.0, "status": "done"}, {"code": "S = input()\nn = len(S)\n\nans = 0\n\nfor i in range(2**(n-1)):\n t = S[0]\n for j in range(n-1):\n if (i>>j)&1:\n t += \"+\"\n t += S[j+1]\n ans += eval(t)\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14292.0, "status": "done"}, {"code": "a = input()\n\nn = len(a)\nans = 0\nfor i in range(2**(n-1)):\n f = a[0]\n for j in range(n-1):\n if ((i >> j) & 1):\n f += '+'\n f += a[j+1]\n\n ans += sum(map(int, f.split('+')))\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "from itertools import product\n\nS = list(input())\nN = len(S)\n\nans = 0\nfor adds in product([0, 1], repeat=N - 1):\n eqn = [\"\"] * (2 * N - 1)\n eqn[::2] = S[:]\n for i, has_add in enumerate(adds):\n if has_add:\n eqn[2 * i + 1] = \"+\"\n else:\n eqn[2 * i + 1] = \"\"\n ans += eval(\"\".join(eqn))\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14140.0, "status": "done"}, {"code": "s = input()\nn = len(s)\n\ndef dfs(i, tmp):\n if i == n-1:\n return sum(list(map(int,tmp.split(\"+\"))))\n \n return dfs(i+1, tmp + s[i+1]) + dfs(i+1, tmp + \"+\" + s[i+1])\n\nprint(dfs(0,s[0]))", "passed": true, "time": 0.15, "memory": 14108.0, "status": "done"}, {"code": "s = input()\n\nans = 0\n\nfor i in range(1<<(len(s)-1)):\n t = list(s)\n for b in range(len(s)-1):\n if((i>>b)&1):\n t[b] = t[b] + '+'\n ans += eval(''.join(t))\nprint(ans)\n\n\n\n\n\n", "passed": true, "time": 0.21, "memory": 14176.0, "status": "done"}, {"code": "import sys\n\nsys.setrecursionlimit(10 ** 6)\nint1 = lambda x: int(x) - 1\np2D = lambda x: print(*x, sep=\"\\n\")\ndef II(): return int(sys.stdin.readline())\ndef MI(): return map(int, sys.stdin.readline().split())\ndef LI(): return list(map(int, sys.stdin.readline().split()))\ndef LLI(rows_number): return [LI() for _ in range(rows_number)]\ndef SI(): return sys.stdin.readline()[:-1]\n\ns=SI()\nans=0\nfor b in range(1<<(len(s)-1)):\n f=\"\"\n for i,c in enumerate(s):\n f+=c\n if b>>i&1:f+=\"+\"\n ans+=eval(f)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "S = input()\nans = 0\nfor i in range(2**(len(S)-1)):\n tmp = int(S[0])\n for j in range(1, len(S)):\n if i & 1 == 1:\n ans += tmp\n tmp = int(S[j])\n else:\n tmp = tmp*10+int(S[j])\n i = i >> 1\n ans += tmp\nprint(ans)\n\n\n", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "s = input()\nans = 0\nfor i in range(2**(len(s)-1)):\n t = 0\n for j in range(len(s)-1):\n if (i >> j)&1:\n ans += int(s[t:j+1])\n t = j+1\n ans += int(s[t:])\nprint(ans)", "passed": true, "time": 0.15, "memory": 14136.0, "status": "done"}, {"code": "#from collections import deque,defaultdict\nprintn = lambda x: print(x,end='')\ninn = lambda : int(input())\ninl = lambda: list(map(int, input().split()))\ninm = lambda: map(int, input().split())\nins = lambda : input().strip()\nDBG = True # and False\nBIG = 10**18\nR = 10**9 + 7\n#R = 998244353\n\ndef ddprint(x):\n if DBG:\n print(x)\n\ns = ins()\nn = len(s)\nans = 0\nfor i in range(2**(n-1)):\n z = []\n head = 0\n for j in range(n-1):\n if (i>>j)%2>0:\n z.append(int(s[head:j+1]))\n head = j+1\n z.append(int(s[head:]))\n ans += sum(z)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "def dfs(i,sum1):\n nonlocal ss\n #print(i,sum1)\n if i == len(s):\n return sum(list(map(int,sum1.split(\"+\"))))\n return dfs(i + 1, sum1 + s[i]) + dfs(i + 1, sum1 + \"+\" +s[i])\n\n\ns = input()\nss = 0\nprint(dfs(1,s[0]))", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "def dfs(i,sum1):\n if i == len(s):\n return sum(list(map(int,sum1.split(\"+\"))))\n return dfs(i+1,sum1 + \"+\" + s[i])+dfs(i+1,sum1 + s[i])\ns = input()#\u4e00\u4ee5\u4e0a9\u4ee5\u4e0b\nprint(dfs(1,s[0]))", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "s=input()\nimport itertools\nl=[*itertools.accumulate(s)]\no=[]\nfor b in range(1<<len(s)-1):\n q=[]\n p=0\n for i in range(len(s)-1):\n if b&(1<<i):\n q+=int(l[i][p::]),\n p=i+1\n c=l[-1][p::]\n c=c if c else 0\n q+=int(c),\n o+=sum(q),\nprint(sum(o))", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "s = input()\nn = len(s)\n\nans = 0\n\nfor i in range(2**(n-1)):\n f = s[0]\n for j in range(n-1):\n if i & (1<<j):\n f += '+'\n f += s[j+1]\n \n ans += sum(map(int, f.split('+')))\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "from itertools import product\n\nS=input()\nN=len(S)\nS2=S[0]\nfor i in range(N-1):\n S2 += '{}'+S[i+1]\n\nans=0\nfor p in product(['','+'],repeat=N-1):\n ans += eval(S2.format(*p))\n \nprint(ans)", "passed": true, "time": 0.15, "memory": 14344.0, "status": "done"}, {"code": "S = input()\nn = len(S)\n\nans = 0\nfor bit in range(1 << (n-1)):\n tmp = S[0]\n for i in range(n-1):\n if bit & (1 << i):\n tmp += \"+\"\n tmp += S[i+1]\n \n ans += sum(map(int, tmp.split(\"+\")))\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "from functools import reduce\n\ndef original_sum(X, init):\n goukei = 0\n if(len(X) == 0):\n #print(\"aaa\")\n #print(sum(init))\n return sum(init)\n else:\n for i in range(len(X)):\n lstm = init.copy()\n #print(len(X))\n num = int(reduce(lambda x, y: x + y, [str(x) for x in X[0:i+1]]))\n #print(num)\n #init = num\n lstm.append(num)\n Y = X[i+1:len(X)].copy()\n #print(len(Y))\n #if(len(X)-i-1 != 0):\n goukei = goukei + original_sum(Y, lstm)\n #else:\n #sum = sum + (len(X)-i-1)num + original_sum(Y)\n #print(sum)\n\n return goukei\n\n\nnumber = list(input())\ninit = []\nprint(original_sum(number, init))", "passed": true, "time": 0.21, "memory": 14228.0, "status": "done"}, {"code": "num = int(input())\n\ndef the_algorithm(num):\n ary = list(str(num))\n sum = 0\n\n for bit in range(1 << (len(ary) - 1)):\n tmp = [ary[0]]\n for i in range((len(ary) - 1)):\n mask = 1 << i\n\n if bit & mask:\n tmp.append(ary[i + 1])\n else:\n tmp[-1] = tmp[-1] + ary[i + 1]\n\n for i in tmp:\n sum += int(i)\n\n return sum\n\nprint(the_algorithm(num))", "passed": true, "time": 0.52, "memory": 14104.0, "status": "done"}, {"code": "import sys\ndef input(): return sys.stdin.readline().rstrip()\ndef ii(): return int(input())\ndef mi(): return map(int, input().split())\ndef li(): return list(mi())\n\n\ndef main():\n s= input()\n n = len(s)\n ans = 0\n for i in range(1<<(n-1)):\n idx = [0]\n for j in range(n-1):\n if (i>>j)&1:\n idx.append(j+1)\n idx.append(n)\n for j in range(1, len(idx)):\n ans += int(s[idx[j-1]:idx[j]])\n print(ans)\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.16, "memory": 14096.0, "status": "done"}, {"code": "from itertools import product\ns=input()\nn=len(s)\nans=0\nfor p in product([0,1], repeat=n-1):\n wk=s[0]\n index=0\n for i in p:\n index+=1\n if i==0:\n wk+=s[index]\n else:\n ans+=int(wk)\n wk=s[index]\n if wk!=\"\":\n ans+=int(wk)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "S = input()\nn = len(S)-1\nresult = 0\nfor i in range(2 ** n):\n sum = 0\n temp = ''\n for j in range(n):\n temp += S[j]\n if (i >> j) & 1:\n sum += int(temp)\n temp = ''\n sum += int(temp+S[-1])\n result += sum\nprint(result)", "passed": true, "time": 0.24, "memory": 14188.0, "status": "done"}, {"code": "ss=input()\nl=len(ss)-1\nans=0\nfor i in range(2**l):\n s=ss\n for j in reversed(range(l)):\n if i&(2**j)>0:\n s=s[:j+1]+\" \"+s[j+1:]\n num=list(map(int,s.split(\" \")))\n ans+=sum(num)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "class Combination:\n def __init__(self, n, mod):\n self.n = n\n self.mod = mod\n self.fac = [1 for i in range(self.n + 1)]\n self.finv = [1 for i in range(self.n + 1)]\n for i in range(2, self.n+1):\n self.fac[i] = (self.fac[i - 1] * i) % self.mod\n self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod\n\n def comb(self, n, m):\n return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod\ndef iparse():\n return list(map(int, input().split()))\n\ndef __starting_point():\n s = input()\n ans = 0\n for i in range(1 << (len(s) - 1)):\n prev = 0\n for j in range(len(s) - 1):\n if (i >> j) & 1 == 1:\n tmp = s[prev:j + 1]\n ans += int(tmp)\n prev = j+1\n ans += int(s[prev:])\n print(ans)\n \n \n \n\n__starting_point()", "passed": true, "time": 0.19, "memory": 14376.0, "status": "done"}, {"code": "\nn = str(input())\n\nlen_n = len(n)-1\n\nans = 0\ntotal = 0\n\nfor i in range(2**len_n):\n temp = n[0]\n for j in range(len_n):\n if (i >> j) & 1:\n temp += '+'\n temp += n[j+1]\n total = list(map(int, temp.split('+')))\n ans += sum(total)\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "S=input()\nl=len(S)\nls=[i for i in range(1,l)]\n \nimport itertools as it\na=0\nfor i in range(l):\n for j in it.combinations(ls, i):\n t='';p=0\n for k in j:\n t+=S[p:k]+'+'\n p=k\n t+=S[p:]\n a+=eval(''.join(t))\nprint(a)", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "S=input()\nN=len(S)\n\nans=2**(N-1)*int(S[-1])\nfor i in range(1<<(N-1)):\n res=1\n for j in range(N-1):\n if (i>>j)%2==1:\n res*=10\n else:\n res=1\n ans+=res*int(S[N-2-j])\nprint(ans)\n", "passed": true, "time": 0.26, "memory": 14224.0, "status": "done"}, {"code": "s = input()\nn = len(s) - 1\n\nans = 0\nfor i in range(2 ** n):\n first = ''\n for j in range(n):\n if ((i >> j) & 1):\n ans += int(first + s[j])\n first = ''\n else:\n first += s[j]\n ans += int(first + s[-1])\nprint(ans)", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "S = input()\nans = 0\nfor i in range(2**(len(S)-1)):\n ls = []\n index = 0\n for j in range(len(S)-1):\n if ((i >> j) & 1):\n ls.append(int(S[index:j+1]))\n index = j+1\n ls.append(int(S[index:]))\n ans += sum(ls)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14352.0, "status": "done"}, {"code": "s = input()\nn = len(s)\n\ndef dfs(i,tmp):\n if i == n-1:\n return sum(list(map(int,tmp.split(\"+\"))))\n \n return dfs(i+1, tmp+s[i+1]) + dfs(i+1,tmp+\"+\"+s[i+1])\n\nprint(dfs(0,s[0]))", "passed": true, "time": 0.16, "memory": 14104.0, "status": "done"}, {"code": "from itertools import product\ns = input()\nn = len(s)\nans = 0\nfor lst in product(['x', ' '], repeat=n-1):\n ss = ''\n for i in range(n-1):\n ss += (s[i] + str(lst[i]))\n ss += s[-1]\n ss = ss.replace('x', '')\n temp = [int(x) for x in ss.split()]\n ans += sum(temp)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "import math\nimport collections\nfrom itertools import product\n\nii = lambda : int(input())\nmi = lambda : map(int,input().split())\nli = lambda : list(map(int,input().split()))\n\ns = list(input())\nn = len(s)\nans = 0\nfor p in product((0,1), repeat=n):\n total = 0\n for i in range(n):\n if p[i] == 1:\n ans += total\n total = 0\n else:\n total = total*10 + int(s[i])\n ans += total\nprint(ans)", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "def cal():\n s = input()\n num, ans = len(s)-1, 0\n for i in range(2**num):\n count0, count1 = 0, 0\n for j in range(num):\n count1 += 1\n if (i>>j)&1:\n ans += int(s[count0:count1])\n count0 = count1\n ans += int(s[count0:count1+1])\n print(ans)\ncal()\n\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "import itertools\nn = input()\nl = len(n)\nans = 0\nfor ope in itertools.product(\"_+\", repeat = l - 1):\n num = n[0]\n for i in range(l - 1):\n if ope[i] == \"+\":\n num += n[i + 1]\n else:\n ans += int(num)\n num = n[i + 1]\n ans += int(num)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "s = input()\nn = len(s)\nans = 0\n\nfor bit in range(1 << (n-1)):#n-1\u500b+\u3092\u5165\u308c\u308b\u5834\u6240\u304c\u3042\u308b\u3002\n f = s[0]\n\n for i in range(n-1):\n if bit & (1<<i):\n f += \"+\" #\u30d5\u30e9\u30b0\u304c\u7acb\u3063\u3066\u3044\u308b\u306e\u306a\u3089\uff0b\u3092\u633f\u5165\n f +=s[i+1]\n\n ans += sum(map(int, f.split(\"+\")))\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "s = input()\nn = len(s)\nans = 0\nfor i in range(n):\n a = int(s[i])\n for j in range(n-i):\n ans += a * 10**j * 2**(max(0,n-i-j-2)) * 2**(i)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "import itertools\ns = input()\nn = len(s)-1\nans = 0\nfor v in itertools.product([\"+\", \"\"], repeat=n):\n x = s[0]\n for i in range(n):\n x += v[i] + s[i+1]\n ans += eval(x)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "S = input()\nL = []\nfor i in range(len(S)):\n L.append(S[i])\n\nn = len(S)\nans = []\nfor i in range(2 ** (n - 1)):\n obj = []\n for j in range(n - 1):\n if (i >> j) & 1:\n obj.append(j)\n else:\n obj.append(-1)\n # print(obj)\n s = ''\n s += L[0]\n for j in range(len(obj)):\n if obj[j] == -1:\n s += L[j + 1]\n continue\n else:\n s += '+'\n s += L[j + 1]\n # print(s)\n idx = 0\n now = 0\n\n while True:\n if now == len(s) - 1:\n ans.append(int(s[idx:]))\n break\n if s[now] == '+':\n ans.append(int(s[idx:now]))\n idx = now + 1\n now = idx\n else:\n now += 1\nprint((sum(ans)))\n", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "s=input()\nans=0\nfor i in range(2**(len(s)-1)):\n num=s[0]\n for j in range(len(s)-1):\n if (i>>j) & 1:\n ans+=int(num)\n num=\"\"\n num+=s[j+1]\n if len(num)!=0:\n ans+=int(num)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}]
[{"input": "125\n", "output": "176\n"}, {"input": "9999999999\n", "output": "12656242944\n"}]
4,704
Snuke and Raccoon have a heap of N cards. The i-th card from the top has the integer a_i written on it. They will share these cards. First, Snuke will take some number of cards from the top of the heap, then Raccoon will take all the remaining cards. Here, both Snuke and Raccoon have to take at least one card. Let the sum of the integers on Snuke's cards and Raccoon's cards be x and y, respectively. They would like to minimize |x-y|. Find the minimum possible value of |x-y|. -----Constraints----- - 2 \leq N \leq 2 \times 10^5 - -10^{9} \leq a_i \leq 10^{9} - a_i is an integer. -----Input----- Input is given from Standard Input in the following format: N a_1 a_2 ... a_{N} -----Output----- Print the answer. -----Sample Input----- 6 1 2 3 4 5 6 -----Sample Output----- 1 If Snuke takes four cards from the top, and Raccoon takes the remaining two cards, x=10, y=11, and thus |x-y|=1. This is the minimum possible value.
introductory
[{"code": "import sys\nimport itertools\n\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninl = lambda: [int(x) for x in sys.stdin.readline().split()]\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print(\"\\033[33m\", *a, \"\\033[0m\", **dict(file=sys.stderr, **kw))\n\nN = ini()\nA = inl()\n\n\ndef solve():\n B = list(itertools.accumulate(A, initial=0))\n s = 0\n ans = 10 ** 12\n for i in range(N - 1, 0, -1):\n s += A[i]\n ans = min(ans, abs(s - B[i]))\n\n return ans\n\n\nprint(solve())\n", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\n\nt=sum(a)\nm=10**9\nflag=0\nfor i in range(len(a)-1):\n t-=2*a[i]\n if i==0:\n m=abs(t)\n else:\n m=min(abs(t),m)\nprint(m)", "passed": true, "time": 0.57, "memory": 14232.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nlsum = a[0]\nrsum = sum(a[1:])\nans = abs(lsum - rsum)\n\nfor i in range(1, n-1):\n lsum += a[i]\n rsum -= a[i]\n res = abs(lsum - rsum)\n\n if res < ans:\n ans = res\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "def main():\n n = int(input())\n a_lst = list(map(int, input().split()))\n x = a_lst[0]\n y = sum(a_lst) - x\n\n minimum = abs(x - y)\n for i in range(1, n - 1):\n a = a_lst[i]\n x += a\n y -= a\n minimum = min(minimum, abs(x - y))\n\n print(minimum)\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.16, "memory": 14340.0, "status": "done"}, {"code": "N = int(input())\na = [int(x) for x in input().split()]\nans = 10**9*N\nfront = 0\nback = sum(a)\nfor i in range(N-1):\n front += a[i]\n back -= a[i]\n ans = min(ans, abs(front-back))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "N = int(input())\nA = [0]+list(map(int,input().split()))\nfor i in range(1,N+1):\n A[i] = A[i]+A[i-1]\nans = float('inf')\nfor i in range(1,N):\n ans = min(ans, abs(A[N]-2*A[i]))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "import itertools\nn = int(input())\na = list(map(int, input().split(\" \")))\n#print(a)\nmini = 10 ** 10\nsuma = list(itertools.accumulate(a))\nfor i in range(0, n-1):\n #print(suma[i],(suma[-1]))\n mini = min(mini, abs(suma[-1]-suma[i]*2))\nprint(mini)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\nr = sum(A)-A[0]\nl = A[0]\nans = abs(r-l)\nfor i in range(1,len(A)-1):\n r -= A[i]\n l += A[i]\n ans = min(ans, abs(l-r))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul, add\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom functools import reduce\nfrom bisect import bisect_left, insort_left\nfrom heapq import heapify, heappush, heappop\n\nINPUT = lambda: sys.stdin.readline().rstrip()\nINT = lambda: int(INPUT())\nMAP = lambda: list(map(int, INPUT().split()))\nS_MAP = lambda: list(map(str, INPUT().split()))\nLIST = lambda: list(map(int, INPUT().split()))\nS_LIST = lambda: list(map(str, INPUT().split()))\n\nsys.setrecursionlimit(10 ** 9)\nINF = float('inf')\nmod = 10 ** 9 + 7\n\n\ndef main():\n N = INT()\n A = LIST()\n\n if N == 2:\n print((abs(A[1] - A[0])))\n return\n\n t = list(accumulate(A, add))\n r = list(accumulate(reversed(A), add))\n\n ans = INF\n for i in range(N-2):\n ans = min(ans, abs(t[i] - r[-2-i]))\n\n print(ans)\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.35, "memory": 14160.0, "status": "done"}, {"code": "N = int(input())\na=[int(i) for i in input().split()]\n\nsum_a=sum(a)\nans = 10**11\nx=0\nfor i in range(N-1):\n x += a[i]\n diff = abs(sum_a - 2 * x)\n if diff<ans:\n ans=diff\n\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\ns = sum(a)\nsu = a[0]\nar = s - su\nans = abs(su-ar)\nfor i in range(1,N-1):\n su += a[i]\n ar = s - su\n if ans > abs(su-ar):\n ans = abs(su-ar)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14204.0, "status": "done"}, {"code": "n = int(input())\nL = list(map(int,input().split()))\n\nli = [0]\n\nfor i in range(n):\n li.append(li[i]+ L[i])\n\nsumL = sum(L)\n#print(sumL)\nans = 10**10\nfor i in range(1,n):\n diff = abs(li[i] - (sumL - li[i]))\n #print(diff,li[i],sumL-li[i])\n ans = min(ans,diff) \nprint(ans)", "passed": true, "time": 0.17, "memory": 14192.0, "status": "done"}, {"code": "import sys\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10 ** 7)\ninput = sys.stdin.readline\nf_inf = float('inf')\nmod = 10 ** 9 + 7\n\n\ndef resolve():\n n = int(input())\n A = list(map(int, input().split()))\n\n res = f_inf\n R = [0] + list(accumulate(A))\n for i in range(1, n):\n s = R[i] - R[0]\n a = R[-1] - R[i]\n diff = abs(s - a)\n res = min(res, diff)\n print(res)\n\n\ndef __starting_point():\n resolve()\n\n__starting_point()", "passed": true, "time": 1.88, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nsa = sum(a) # sum a\ncs = 0 # cards sunuke\narr = []\n\nfor i in range(n-1):\n cs += a[i]\n ca = sa -cs #cards araiguma\n arr.append(abs(cs-ca))\n \nprint(min(arr))", "passed": true, "time": 0.34, "memory": 14176.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\n\nsum_A = [0 for _ in range(n + 1)]\nfor i in range(1, n + 1):\n sum_A[i] = sum_A[i - 1] + A[i - 1]\n\nans = float('inf')\nfor i in range(1, n):\n ans = min(abs(sum_A[i] - (sum_A[-1] - sum_A[i])), ans)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "from itertools import accumulate\n\nn = int(input())\nA = list(map(int, input().split()))\n\nif n == 2:\n print(abs(A[0]-A[1]))\n return\n\nB = list(accumulate(A))\n\nans = float(\"inf\")\ny = 0\nfor i in range(n-1, 0, -1):\n x = B[i-1]\n y += A[i]\n ans = min(ans, abs(x-y))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\ns = sum(a)\ndata = [a[0]]\nm = abs(s - 2 * a[0])\n\nfor i in range(1, N - 1):\n data.append(a[i] + data[i - 1])\n\nfor i in range(0, N - 1):\n if abs(s - 2 * data[i]) < m:\n m = abs(s - 2 * data[i])\n\nprint(m)\n\n", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\ny=sum(a)\nx=0\nB=[]\nfor i in range(N-1):\n x+=a[i]\n y-=a[i]\n B.append(abs(x-y))\n\nprint(min(B))", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nsnuke=sum(a)\narai=0\nans=10**20\nfor i in range(n-1):\n snuke-=a[i]\n arai+=a[i]\n ans=min(ans,abs(snuke-arai))\nprint(ans)\n", "passed": true, "time": 0.16, "memory": 14052.0, "status": "done"}, {"code": "n = int(input())\n#a, b = map(int,input().split())\nal = list(map(int, input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\n\ntotal = sum(al)\nmn = abs(total-2*al[0])\nx = 0\nfor i in range(1, n-1):\n x += al[i-1]\n y = total-x\n mn = min(mn, abs(x-y))\n\nprint(mn)\n", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "n=int(input());a=list(map(int,input().split()));f,b,c=0,sum(a),float('inf')\nfor i in range(n-1):\n f,b=f+a[i],b-a[i]\n c=min(c,abs(f-b))\nprint(c)", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "n=int(input())\na=[0]+list(map(int,input().split()))\nimport itertools\na=list(itertools.accumulate(a))\nans=1e15\nfor i in range(1,n):\n ans=min(ans,abs(a[n]-2*a[i]))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14356.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\n\nt=sum(a)\nm=10**9\nflag=0\nfor i in range(len(a)-1):\n t-=2*a[i]\n if i==0:\n m=abs(t)\n else:\n m=min(abs(t),m)\nprint(m)", "passed": true, "time": 0.16, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nval = 0\nl = []\ns = sum(a)\nhlf = s/2\nfor i in range(n-1):\n val += a[i]\n l.append(abs(hlf - val))\n\nval = min(l)\nprint((int(val*2)))\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\nans=10000000000000000000\nc=0\ns=sum(a)\nfor i in range(N-1):\n c+=a[i]\n s-=a[i]\n if abs(c-s)<ans:\n ans=abs(c-s)\nprint(ans)\n", "passed": true, "time": 0.23, "memory": 14420.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nx = 0\ny = sum(a)\nans = 10**10\nfor i in range(n-1):\n x += a[i]\n y -= a[i]\n ans = min(ans,abs(x-y))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\ns = [0]*(n+1)\nfor i in range(n):\n s[i+1] += a[i] + s[i]\n#print(s)\nans = float(\"inf\")\nfor i in range(1, n):\n x = s[i]\n y = s[n]-s[i]\n ans = min(ans, abs(x-y))\nprint(ans)", "passed": true, "time": 0.23, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nsnuke = 0\narai = sum(a)\nans = 2*(10**9)\nfor i in range(n-1):\n snuke += a[i]\n arai -= a[i]\n ans = min(ans,abs(snuke-arai))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nimport math\nsunuke = 0\nkuma = sum(a)\n\nmemo = abs(2*a[0] - sum(a))\nans = abs(2*a[0] - sum(a))\n\nfor i in range(n):\n sunuke += a[i]\n kuma -= a[i]\n if abs(sunuke-kuma) > memo:\n ans = memo\n else:\n memo = abs(sunuke-kuma)\n\nprint(ans)\n", "passed": true, "time": 0.29, "memory": 14212.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Sep 27 02:27:51 2020\n\n@author: liang\n\"\"\"\n\nN = int(input())\nA = [int(x) for x in input().split()]\n\ntmp = sum(A)\ntmp -= 2*A[0]\nans = abs(tmp)\nfor i in range(1,N-1):\n tmp -= 2*A[i]\n ans = min(abs(tmp),abs(ans))\nprint(ans)", "passed": true, "time": 0.21, "memory": 14220.0, "status": "done"}, {"code": "#\n# abc067 c\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"6\n1 2 3 4 5 6\"\"\"\n output = \"\"\"1\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"2\n10 -10\"\"\"\n output = \"\"\"20\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n N = int(input())\n A = list(map(int, input().split()))\n\n ans = float(\"inf\")\n S = sum(A)\n T = []\n T.append(A[0])\n for i in range(1, N):\n T.append(T[i-1]+A[i])\n\n if N == 2:\n ans = abs(A[0]-A[1])\n else:\n for i in range(1, N-1):\n ans = min(ans, abs(S-2*T[i]))\n print(ans)\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14436.0, "status": "done"}, {"code": "#\n# abc067 c\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"6\n1 2 3 4 5 6\"\"\"\n output = \"\"\"1\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"2\n10 -10\"\"\"\n output = \"\"\"20\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n N = int(input())\n A = list(map(int, input().split()))\n\n ans = float(\"inf\")\n S = sum(A)\n T = []\n T.append(A[0])\n for i in range(1, N-1):\n T.append(T[i-1]+A[i])\n for t in T:\n ans = min(ans, abs(S-2*t))\n\n print(ans)\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14620.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\nans = float(\"inf\")\nsnuke = 0\narai = sum(a)\nfor i in range(N-1):\n snuke += a[i]\n arai -= a[i]\n ans = min(abs(snuke-arai), ans)\nprint(ans)", "passed": true, "time": 0.29, "memory": 14284.0, "status": "done"}, {"code": "from itertools import accumulate\nn = int(input())\na = list(map(int, input().split()))\na = list(accumulate(a))\nans = 10**10\nfor i in range(n-1):\n ans = min(ans, abs(a[i]-a[-1]+a[i]))\nprint(ans)", "passed": true, "time": 0.18, "memory": 14092.0, "status": "done"}, {"code": "from itertools import accumulate\nINF = float('inf')\nN = int(input())\nA = [int(x) for x in input().split()]\n\ncumA = list(accumulate(A))\nans = INF\nfor i in range(N - 1):\n x = cumA[i]\n y = cumA[N - 1] - cumA[i]\n ans = min(ans, abs(x - y))\n\nprint(ans)", "passed": true, "time": 0.25, "memory": 14228.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nans=2*(10**14)+1\ns=sum(a)\nx=0\ny=s\nfor i in range(n-1):\n x+=a[i]\n y-=a[i]\n ans=min(ans,abs(x-y))\nprint(ans)", "passed": true, "time": 0.27, "memory": 14040.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\nsa = a[:]\nfor i in range(N-1):\n sa[i+1] += sa[i]\n\ndiff = float('inf')\nfor i in range(N-1):\n if abs(sa[i] - (sa[-1] - sa[i])) < diff:\n diff = abs(sa[i] - (sa[-1] - sa[i]))\n\nprint(diff)", "passed": true, "time": 0.25, "memory": 14108.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int, input().split()))\ns1=sum(a)\ns2=0\nans=10**18\nfor i in range(n - 1):\n s1-=a[i]\n s2+=a[i]\n ans=min(ans,abs(s1-s2))\nprint(ans)", "passed": true, "time": 0.19, "memory": 14012.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().strip().split()))\n#\u7d2f\u7a4d\u548c\ns_l=[]\ns=0\n\nfor n in range(N):\n s+=a[n]\n s_l.append(s)\n\nMIN=10**15\nfor n in range(N-1):\n MIN=min(MIN,abs(s-s_l[n]*2))\n\nprint(MIN)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\n\ncumsum = [0 for _ in range(n)]\ncumsum[0] = a[0]\n\nfor i in range(1,n):\n cumsum[i] = a[i] + cumsum[i-1]\n\nresult = [0 for _ in range(n-1)]\nlast = cumsum[-1]\n#print(last)\nfor i in range(n-1):\n result[i] = abs(last - 2 * cumsum[i])\n\nprint((min(result)))\n\n\n\n\n", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "n=int(input())\na=[int(i) for i in input().split()]\n\nsunuke=0\naraiguma=sum(a)\n\nmin_sa=100000000000000\n\nfor i in range(n-1):\n sunuke+=a[i]\n araiguma-=a[i]\n min_sa=min(min_sa,abs(araiguma-sunuke))\nprint(min_sa)", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "N = int(input())\nA = [int(a) for a in input().split(\" \")]\n\nsA = []\nfor i in range(len(A)):\n if i == 0:\n sA.append(A[0])\n else:\n sA.append(sA[i - 1] + A[i])\n\ns = sum(A)\ndA = [abs(2 * sA[j] - s) for j in range(len(sA) - 1)]\n\nprint(min(dA))", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "from itertools import accumulate\nN = int(input())\nA = tuple(accumulate(map(int, input().split())))\nx = A[-1]\ny = A[0]\nans = abs(x - y - y)\nfor a in A[:-1]:\n ans = min(ans, abs(x - a - a))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "N = int(input())\nlsa = list(map(int,input().split()))\nsunu = lsa[0]\nara = sum(lsa)- lsa[0]\nans = abs(ara-sunu)\nfor i in range(1,N-1):\n sunu += lsa[i]\n ara -= lsa[i]\n ans = min(ans,abs(ara-sunu))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\n\ns = A[0]\ns_ = sum(A[1:])\ngap = abs(s-s_)\nfor i in range(1, n-1):\n s += A[i]\n s_ -= A[i]\n if gap > abs(s-s_):\n gap = abs(s-s_)\nprint(gap)", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\n\n\ndef solve(N: int, a: \"List[int]\"):\n from itertools import accumulate\n s = sum(a)\n return min(abs(s-2*aa) for aa in accumulate(a[:-1]))\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n a = [int(next(tokens)) for _ in range(N)] # type: \"List[int]\"\n print((solve(N, a)))\n\ndef test():\n import doctest\n doctest.testmod()\n\ndef __starting_point():\n #test()\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "\nN=int(input())\nA=list(map(int,input().split()))\ntotal = sum(A)\narai = 0\nsunuke = 0\nans = float('inf')\n\nfor i in range(N-1):\n sunuke += A[i]\n arai = total - sunuke\n ans = min(ans,abs(sunuke-arai))\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "#!/usr/bin/env python\n\nn = int(input())\na = list(map(int, input().split()))\n\nl = a[0]\nr = sum(a)-l\nans = abs(l-r)\n\nfor i in range(1, n-1):\n l += a[i]\n r -= a[i]\n if abs(l-r) <= ans:\n ans = abs(l-r)\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# FileName: \tC_fix\n# CreatedDate: 2020-10-10 15:17:07 +0900\n# LastModified: 2020-10-10 15:25:36 +0900\n#\n\n\nimport os\nimport sys\n# import numpy as np\n# import pandas as pd\nfrom itertools import accumulate\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n A_ac = list(accumulate(A))\n ans = A_ac[-1]\n for i, ac in enumerate(A_ac):\n if i == 0:\n ans = abs(2*ac-A_ac[-1])\n if i == N-1:\n break\n if abs(2*ac-A_ac[-1]) < ans:\n ans = abs(2*ac-A_ac[-1])\n print(ans)\n\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "# C - Splitting Pile\ndef main():\n n = int(input())\n a = list(map(int, input().split()))\n a_sum = sum(a)\n cnt = 0\n ans = float('inf')\n\n for i in range(n-1):\n cnt += a[i]\n ans = min(ans, abs(a_sum-cnt*2))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\n\nif n == 2:\n print(abs(A[0]-A[1]))\n return\n\ncum_sum = [0]\nfor a in A:\n cum_sum.append(cum_sum[-1]+a)\n\nans = 10**9+1\nfor x in cum_sum[1:-1]:\n y = cum_sum[-1] - x\n ans = min(ans, abs(x-y))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "n = int(input())\na = [int(x) for x in input().split()]\ns = [0] * (n+2)\nfor i in range(n):\n s[i+1] = s[i] + a[i]\n\nres = 10 ** 10\n\nfor i in range(1,n):\n res = min(res,abs(s[i] - (s[n] - s[i])))\n\nprint(res)", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "import math\nN = int(input())\na = list(map(int,input().split()))\n\ns = sum(a)\nt = 0\nminimum = math.inf\nfor i in range(N-1):\n t += a[i]\n s -= a[i]\n minimum = min(minimum,abs(s-t))\nprint(minimum)", "passed": true, "time": 0.14, "memory": 14020.0, "status": "done"}, {"code": "a = int(input())\nb = [int(s) for s in input().split()]\nsu = sum(b) - b[a-1]\nar = b[a-1]\nans = abs(su - ar)\n\nfor i in range(2, a-1):\n su = su - b[a-i]\n ar = ar + b[a-i]\n tmp = abs(su - ar)\n if tmp < ans:\n ans = tmp\n tmp = 0\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\n\nsunuke = [0] * (N)\nguma = [0] * (N)\n\nfor i in range(N-1):\n if i == 0:\n sunuke[i] += A[i]\n continue \n sunuke[i] += sunuke[i-1] + A[i]\n\nfor j in range(N-1,0,-1):\n if j == N - 1:\n guma[j] += A[j]\n continue\n guma[j] += guma[j+1] + A[j]\n \nans = float(\"inf\")\nfor k in range(N-1):\n ans = min(ans, abs(sunuke[k] - guma[k+1]))\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\nS = sum(A)\nT = [0]*(N+1)\nfor i in range(N):\n T[i+1] = T[i] + A[i]\nprint(min(abs(S-2*T[i]) for i in range(1, N)))", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "n = int(input())\nmain = list(map(int, input().split()))\n\ntotal = sum(main)\nbeg = 0\nfinal = float('inf')\nfor i in range(len(main) - 1):\n beg += main[i]\n total -= main[i]\n final = min(final, abs(beg - total))\n\nprint(final)\n", "passed": true, "time": 0.24, "memory": 14124.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nans=float(\"inf\")\nx=0\nb=sum(a)\nfor i in range(n):\n x+=a[i]\n if i+1<n:\n ans=min(ans,abs(b-2*x)) \nprint(ans)", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\nl,r=a.pop(0),sum(a)\nans=10**10\nfor i in a:\n ans=min(ans,abs(l-r))\n l,r=l+i,r-i\nprint(ans)", "passed": true, "time": 0.25, "memory": 14152.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\nS1 = A[0]\nS2 = sum(A)-A[0]\nB = [abs(S1-S2)]\n\nfor i in range(N-2):\n S1 += A[i+1]\n S2 -= A[i+1]\n B.append(abs(S1-S2))\n\nprint(min(B))", "passed": true, "time": 0.16, "memory": 14024.0, "status": "done"}, {"code": "N=int(input())\n*A,=map(int,input().split())\nt=sum(A)\n\nx=0\nans=float('inf')\nfor i in range(N-1):\n x+=A[i]\n ans=min(ans, abs(2*x-t))\nprint(ans)", "passed": true, "time": 0.23, "memory": 14248.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\ns = sum(a)\n\nx = a[0]\nans = abs(x - (s - x))\nfor i in a[1:-1]:\n ans = min(ans, abs(x - (s - x)))\n x += i\nprint(ans)", "passed": true, "time": 0.17, "memory": 14348.0, "status": "done"}, {"code": "n=int(input())\nA=list(map(int,input().split()))\nS=sum(A)\nx=A[0]\ny=S-x\nxy_min=abs(x-y)\nfor i in range(1,n-1):\n x+=A[i]\n y=S-x\n xy=abs(x-y)\n if xy<xy_min:\n xy_min=xy\nprint(xy_min)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "from itertools import accumulate\n\nn = int(input())\nA = list(map(int, input().split()))\nAA = list(accumulate([0] + A))\nans = 10 ** 20\nfor i in range(1, n):\n temp1 = AA[i]\n temp2 = AA[-1] - temp1\n delta = abs(temp1 - temp2)\n ans = min(delta, ans)\nprint(ans)\n", "passed": true, "time": 0.28, "memory": 14084.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nl = []\n\ns = sum(a)\ncnt = 0\nfor i in range(n - 1):\n cnt += a[i]\n rem = s - cnt\n l.append(abs(cnt - rem))\n \nprint(min(l))", "passed": true, "time": 0.31, "memory": 14196.0, "status": "done"}, {"code": "n=int(input()) \nc=list(map(int, input().split()))\ns = sum(c)\nl = []\nx = 0\ny = s\n\nfor i in c[:n-1]:\n x += i\n y -= i\n l += [abs(x-y)]\nprint(min(l))", "passed": true, "time": 0.32, "memory": 14288.0, "status": "done"}, {"code": "import math\nfrom math import gcd,pi,sqrt\nINF = float(\"inf\")\n\nimport sys\nsys.setrecursionlimit(10**6)\nimport itertools\nfrom collections import Counter,deque\ndef i_input(): return int(input())\ndef i_map(): return list(map(int, input().split()))\ndef i_list(): return list(i_map())\ndef i_row(N): return [i_input() for _ in range(N)]\ndef i_row_list(N): return [i_list() for _ in range(N)]\ndef s_input(): return input()\ndef s_map(): return input().split()\ndef s_list(): return list(s_map())\ndef s_row(N): return [s_input for _ in range(N)]\ndef s_row_str(N): return [s_list() for _ in range(N)]\ndef s_row_list(N): return [list(s_input()) for _ in range(N)]\n\nimport string\n\ndef main():\n n = i_input()\n a = i_list()\n\n total = sum(a)\n\n ans = INF\n trial = 0\n for i in a[:-1]:\n trial += i\n left = total - trial\n ans = min(ans,abs(trial-left))\n print(ans)\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nnums = []\ntotal = 0\nfor num in a:\n total += num\n nums.append(total)\nminVal = 10 ** 9 * 2 + 1\nfor i in range(n - 1):\n sub = total - nums[i]\n minVal = min(abs(sub - nums[i]), minVal)\nprint(minVal)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\nsum=[0]\nfor i in range(0,N):\n sum.append(sum[-1]+a[i])\nans=abs(sum[N]-2*sum[1])\nfor i in range(1,N):\n ans=min(ans,abs(sum[N]-2*sum[i]))\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\ny = sum(a) - a[0]\nx = a[0]\nans = abs(x-y)\nfor i in range(1,n-1):\n x += a[i]\n y -= a[i]\n ans = min(ans,abs(x-y))\nprint(ans)", "passed": true, "time": 0.24, "memory": 14236.0, "status": "done"}, {"code": "# C - Splitting Pile\nN = int(input())\nA = list(map(int,input().split()))\n\ns = [0]*(N+1)\nfor i in range(N-1):\n s[i+1] = s[i] + A[i]\n\nans = 10**10\nfor i in range(1,N):\n diff = abs((s[N-1] + A[-1] - s[i]) - s[i])\n ans = min(ans,diff)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nsum_a = sum(a)\nres = 10 ** 10\ntmp_sum = 0\nfor i in range(n - 1):\n tmp_sum += a[i]\n res = min(res, abs(tmp_sum - (sum_a - tmp_sum)))\n\nprint(res)\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\n\ns = A[0]\na = sum(A[1:])\n\nans = abs(s - a)\n\nfor i in range(1, N-1):\n s += A[i]\n a -= A[i]\n ans = min(ans, abs(s - a))\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\n\nrui=[]\nrui.append(a[0])\nfor x in range(1,n):\n b=rui[-1]+a[x]\n rui.append(b)\n\nans=[]\nfor y in range(n-1):\n ans.append(abs((rui[n-1]-rui[y])-rui[y]))\n \nprint(min(ans))", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "import itertools\nn = int(input())\na = list(map(int, input().split()))\n\nn_acc = itertools.accumulate(a)\n#r_acc = itertools.accumulate(a[::-1])\n# 1, 3, 6, 10, 15 ,21\n# 1 vs 20\n# 3 vs\n#print(n_acc, r_acc)\n\n\nsigma = sum(a)\nans = 10 ** 16\n\nfor i, val in enumerate(n_acc):\n if (i == len(a) - 1):\n break\n\n rest = sigma - val\n ans = min(abs(val - rest), ans)\n\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "\n\n\n\n\n\n\n\n\n#!/usr/bin/env python3\n\n# from numba import njit\n\n# input = stdin.readline\nINF = pow(10,10)\n# @njit\ndef solve(n,a):\n res = INF\n x = 0\n y = sum(a)\n for i in range(n-1):\n x += a[i]\n y -= a[i]\n res = min(res,abs(x-y))\n return res\n\n\n\ndef main():\n N = int(input())\n # N,M = map(int,input().split())\n a = list(map(int,input().split()))\n print((solve(N,a)))\n return\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\ns = sum(a)\nx = 0\nans = abs(2 * a[0] - s)\nsnuke = a[0]\n\nfor i in range(1, n-1):\n snuke += a[i]\n if abs(2 * snuke - s) < ans:\n ans = abs(2 * snuke - s)\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nb=[]\nc=[]\ns=sum(a)\nt=0\nfor i in range(n-1):\n b.append(t+a[i])\n t=b[i]\nfor i in range(n-1):\n c.append(abs(2*b[i]-s))\nc.sort()\nprint(c[0])", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\ns = sum(a)\ntemp,ans = 0,float('inf')\nfor v in a[:-1]:\n temp += v\n s -= v\n ans = min(ans,abs(temp-s))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "n = int(input())\nal = list(map(int, input().split()))\nbl = [0]*(n+1)\ncl = [0]*(n-1)\n\nfor i in range(n):\n bl[i+1] = al[i] + bl[i]\n\nfor j in range(1, n):\n cl[j-1] = abs(bl[j] - (bl[n] - bl[j]))\n\nprint(min(cl))", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nsm=sum(a)\ns=a.pop(0)\nmn=abs(sm-s*2)\nfor i in a[:-1]:\n s+=i\n mn=min(mn,abs(sm-s*2))\n \nprint(mn)", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nasum = [0]*(n+1)\n\nfor i in range(n):\n asum[i+1] = asum[i] + a[i]\n\nans = 10**12\nfor i in range(1,n):\n snu = asum[i]\n arai = asum[-1] - asum[i]\n ans_ = abs(snu - arai)\n if ans >ans_:\n ans = ans_\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n = int(input())\narr = list(map(int, input().split()))\nsum1 = 0\nsum2 = sum(arr)\nmin_ = 1<<60\n\nfor i in range(n-1):\n sum1 += arr[i]\n sum2 -= arr[i]\n min_ = min(min_, abs(sum1 - sum2))\nprint(min_)", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\n\ns = a[0]\nt = sum(a) - a[0]\n\ni = 0\nans = abs(s - t)\nfor i in range(1, n-1):\n s += a[i]\n t -= a[i]\n ans = min(ans, abs(s - t))\n i += 1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\n\ncum=[0]\nfor i in range(N):\n cum.append(cum[-1]+a[i])\n \nans=10**20\nfor i in range(1,N):\n tmp = abs(cum[-1]-cum[i]-cum[i])\n ans = min(ans, tmp)\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nli = [a[0]]\nfor i in range(n-1):\n li.append(li[i]+a[i+1])\n\nb = []\nfor i in range(n-1):\n b.append(abs(li[-1]-li[i]*2))\nprint(min(b))", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nb=[a[0]]\nfor i in range(1,n):\n b.append(b[-1]+a[i])\ns=sum(a)\nans=10**20\nfor i in range(n-1):\n ans=min(ans,abs(s-2*b[i]))\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "N=int(input())\nL=list(map(int,input().split()))\nsums=0\na=sum(L)\nmina=10**10\nfor i in range(N-1):\n a-=2*L[i]\n mina=min(mina,abs(a))\nprint(mina)", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nsa = [0 for i in range(n)]\nsc = sum(a)\nc = 0\nfor i in range(n):\n c += a[i]\n sa[i] = c\nans = 10**10\n\nfor i in range(1,n):\n x = sc-sa[i-1]\n v = abs(x-sa[i-1])\n ans = min(ans,v)\nprint (ans)\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nx = A[0]\ny = sum(A[1:])\nans = abs(x - y)\nfor i in range(1, N - 1):\n a = A[i]\n x += a\n y -= a\n dif = abs(x - y)\n if dif < ans:\n ans = dif\nprint(ans)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "n=int(input())\na=[int(x) for x in input().rstrip().split()]\n\nruiseki=[0]\nfor i in range(n):\n ruiseki.append(ruiseki[i]+a[i])\n\nans=float('inf')\nlast=ruiseki[len(ruiseki)-1]\n# print(last)\n# print(ruiseki)\nfor i in range(1,len(ruiseki)-1):\n now=(last-ruiseki[i])\n ans=min(ans,abs(ruiseki[i]-now))\nprint(ans)\n \n\n\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\n\nS = sum(A)\n\nsnk = 0\narigm = S\n\nans = 1e20\n\nfor i in range(N-1):\n snk += A[i]\n arigm -= A[i]\n #print(snk,arigm)\n ans = min(abs(snk-arigm),ans)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}]
[{"input": "6\n1 2 3 4 5 6\n", "output": "1\n"}, {"input": "2\n10 -10\n", "output": "20\n"}]
4,705
Snuke has a favorite restaurant. The price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer. So far, Snuke has ordered N meals at the restaurant. Let the amount of money Snuke has paid to the restaurant be x yen, and let the amount of money the restaurant has paid back to Snuke be y yen. Find x-y. -----Constraints----- - 1 ≤ N ≤ 100 -----Input----- The input is given from Standard Input in the following format: N -----Output----- Print the answer. -----Sample Input----- 20 -----Sample Output----- 15800 So far, Snuke has paid 16000 yen, and the restaurant has paid back 200 yen. Thus, the answer is 15800.
introductory
[{"code": "# \uff11\u98df\uff18\uff10\uff10\u5186\u3092N\u98df\u98df\u3079\u305f\nN = int( input() )\nx = int( 800 * N )\n\n# \uff11\uff15\u98df\u98df\u3079\u308b\u3054\u3068\u306b\uff12\uff10\uff10\u5186\u3082\u3089\u3048\u308b\n\ny = N // 15 * 200\n\nprint( x - y )", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\nprint(N * 800 - N // 15 * 200)", "passed": true, "time": 0.34, "memory": 14224.0, "status": "done"}, {"code": "N = int(input())\n\nx = N * 800\ny = (N // 15) * 200\nprint(x-y)", "passed": true, "time": 0.21, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\n\nx = 800 * n # \u6255\u3063\u305f\u91d1\u984d\n\n# \u30ec\u30b9\u30c8\u30e9\u30f3\u304b\u3089\u3082\u3089\u3046\u91d1\u984d\ny = 0\nif n >= 15:\n y = 200 * (n//15)\n\n# \u6255\u3063\u305f\u91d1\u984d - \u30ec\u30b9\u30c8\u30e9\u30f3\u304b\u3089\u3082\u3089\u3046\u304a\u91d1\nans = x - y\nprint(ans)", "passed": true, "time": 0.36, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\n\nx = N * 800\n\ny = ( N // 15 ) * 200\n\ntotle = x - y\n\nprint(totle)", "passed": true, "time": 0.28, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\nprint(n*800-200*(n//15))", "passed": true, "time": 0.25, "memory": 13984.0, "status": "done"}, {"code": "#55\nN=int(input())\nx=N*800\ny=int((N//15)*200)\nprint((x-y))\n\n", "passed": true, "time": 0.26, "memory": 14228.0, "status": "done"}, {"code": "n = int(input())\n\nif n >= 15:\n x = n * 800\n y = ( n // 15 ) * 200\n print(x - y)\nelse:\n print(n * 800)", "passed": true, "time": 0.37, "memory": 14024.0, "status": "done"}, {"code": "N = int(input())\nprint(800 * N - 200 * (N // 15))", "passed": true, "time": 0.24, "memory": 14164.0, "status": "done"}, {"code": "# A,Restaurnat\n# \u3059\u306c\u3051\u304f\u3093\u306f\u30ec\u30b9\u30c8\u30e9\u30f3\u306b\u901a\u3046\u306e\u304c\u597d\u304d\u3067\u3059\u3002\n# \u3059\u306c\u3051\u304f\u3093\u306e\u884c\u304d\u3064\u3051\u306e\u30ec\u30b9\u30c8\u30e9\u30f3\u306f\u4f55\u3092\u98df\u3079\u3066\u30821\u98df800\u5186\u3067\u300115\u98df\u98df\u3079\u308b\u6bce\u306b\u305d\u306e\u5834\u3067200\u5186\u3082\u3089\u3048\u307e\u3059\u3002\n# \u3059\u306c\u3051\u304f\u3093\u306f\u4eca\u307e\u3067\u5408\u8a08N\u98df\u98df\u3079\u307e\u3057\u305f\u3002\u4eca\u307e\u3067\u306b\u6255\u3063\u305f\u91d1\u984d\u3092\uff58\u5186\u3001\u30ec\u30b9\u30c8\u30e9\u30f3\u306b\u3082\u3089\u3063\u305f\u91d1\u984d\u3092\uff59\u3068\u3057\u3066\u3001x - y\u3092\u6c42\u3081\u306a\u3055\u3044\u3002\n# 1 <= N <= 100\n\n# N = \u98df\u6570\n\nN = int(input())\n\n# x:\u4eca\u307e\u3067\u306b\u652f\u6255\u3063\u305f\u91d1\u984d\nx = 800 * N\n# print(x)\n\n# y:\u30ec\u30b9\u30c8\u30e9\u30f3\u306b\u3082\u3089\u3063\u305f\u91d1\u984d\ny = int((N // 15) * 200)\n\nanswer = int(x - y)\nprint(answer)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "N = int(input())\nprint(800*N - N//15*200)", "passed": true, "time": 0.22, "memory": 14068.0, "status": "done"}, {"code": "N = int(input())\n\n# \u305d\u306e\u307e\u307e\u5b9f\u88c5\u3059\u308b\u3060\u3051\nprint(N*800 - (N//15)*200)", "passed": true, "time": 0.29, "memory": 14288.0, "status": "done"}, {"code": "n = int(input())\nans = 800*n - 200*(n//15)\nprint(ans)", "passed": true, "time": 0.34, "memory": 14180.0, "status": "done"}, {"code": "n=int(input())\nprint(n*800-n//15*200)", "passed": true, "time": 0.24, "memory": 14260.0, "status": "done"}, {"code": "N = int(input())\nprint(N * 800 - (N // 15) * 200 )", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "n = int(input())\na = n // 15\nprint(n * 800 - 200 * a)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "n=int(input())\nprint(800*n-200*(n//15))", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "input_num = int(input())\n\n# x - y \uff08\u5186\uff09\u3092\u8a08\u7b97\u3057\u51fa\u529b\u3059\u308b\u3002\nx = input_num * 800 # x\uff1a\u4eca\u307e\u3067\u306b\u6255\u3063\u305f\u91d1\u984d\ny = int(input_num / 15) * 200 # y\uff1a\u30ec\u30b9\u30c8\u30e9\u30f3\u304b\u3089\u3082\u3089\u3063\u305f\u91d1\u984d\nresult = x - y # \u5dee\u984d\n\nprint(result)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "a = int(input())\n\nprint((a*800)-(a//15*200))", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "n = int(input())\nprint(800 * n - 200 * (n // 15))", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "N = int(input())\nprint(N*800 - ((N//15)*200))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "import math\n\nN=int(input())\n\nx=800*N\ny=(math.floor(N/15))*200\n\nprint(x-y)", "passed": true, "time": 0.19, "memory": 14072.0, "status": "done"}, {"code": "N = int(input())\nprint((N*800)-(N//15*200))", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "N = int(input())\nx = 800 * N\ny = 200 * (N // 15)\nprint(x-y)", "passed": true, "time": 0.15, "memory": 14212.0, "status": "done"}, {"code": "n=int(input())\n\nx=800*n\ny=200*(n//15)\n\nprint(x-y)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "n=int(input())\nx=800*n\ny=200*(n//15)\nprint(x-y)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nnum=int(input())\nquo=num//15\n\nx=800*num\ny=200*quo\n\nprint((x-y))\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "number = int(input())\n\nx = number * 800\ny = (number // 15) * 200\n\nanswer = x - y\n\nprint(answer)", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n=int(input())\nprint(800*n-200*int(n//15))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n = int(input())\n\nif n >= 15:\n print(n * 800 - ( n // 15 ) * 200)\nelse:\n print(n * 800)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "n = int(input())\n#a, b = map(int,input().split())\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\nprint((n*800-(n//15)*200))\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "n = int(input())\ny = n//15 * 200\nprint(n*800 -y)", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "# \u5b9a\u7fa9 1 <= N <= 100\n\nN = int(input())\n\nx = 800 * N\ny = (N // 15) * 200\n\npayment = x - y\nprint(payment)\n", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\nprint((n * 800 - n // 15 * 200))\n", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "n=int(input())\nprint(n*800-(n//15)*200)", "passed": true, "time": 0.17, "memory": 14300.0, "status": "done"}, {"code": "N = int(input())\nprint(800*N-200*(N//15))", "passed": true, "time": 0.31, "memory": 14284.0, "status": "done"}, {"code": "'''\n055 abc055_a Restaurant\nhttps://atcoder.jp/contests/abc055/tasks/abc055_a\n'''\n\nprice = 800\nbonus = 200\nn = int(input())\n\nprint((price*n - bonus*(n//15)))\n", "passed": true, "time": 0.3, "memory": 14048.0, "status": "done"}, {"code": "n = int(input())\ndiv = n // 15\nprint(n*800 - div*200) ", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "n = int(input())\n\nx = 800 * n\ny = 200 * (n // 15)\nprint(x - y)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "input_num = int(input())\nX = input_num * 800\nY = int(input_num / 15) * 200\nresult = X - Y\n\nprint(result)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "N = int(input())\n\nx = 800 * N\n\ny = (N // 15) * 200\n\nprint(x - y) ", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "x = int(input())\n\nprint((800 * x - 200 * (x//15)))\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "n = int(input())\n\nprint(800 * n - 200 * (n // 15))", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n = int(input())\nprint(n*800 - n//15*200)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "n = int(input())\nprint(800*n - 200*(n//15))", "passed": true, "time": 0.15, "memory": 14096.0, "status": "done"}, {"code": "n = int(input())\n\nif n >= 15:\n print(800 * n - ( n // 15) * 200)\nelse:\n print(800 * n )", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "N=int(input())\nprint((800*N-N//15*200))\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "N = int(input())\nprint(N*800-N//15*200)", "passed": true, "time": 0.19, "memory": 14016.0, "status": "done"}, {"code": "n = int(input())\nprint(n*800 - (n // 15) * 200)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "n=int(input())\nprint(n*800-n//15*200)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "n=int(input())\nprint(n*800-n//15*200)", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "n=int(input())\nprint(800*n-200*(n//15))", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n=int(input())\nprint((n*800-n//15*200))\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\n\nx = 800 * n\ny = (n // 15) *200\n\nprint(x-y)", "passed": true, "time": 0.23, "memory": 14288.0, "status": "done"}, {"code": "eat_N = int(input())\n\nx = eat_N * 800\n\ny = (eat_N // 15) * 200\n\nprint( x - y)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "N = int(input())\n\nx = N * 800\ny = N // 15 * 200\n\nanswer = x - y\n# print(x, y)\nprint(answer)", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "a = int(input())\nb = a * 800\nc = a // 15 * 200\nprint(b - c)", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "N=int(input())\nx=N*800\ny=N//15*200\nprint((x-y))\n", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "N = int(input())\nprint(N*800-(N//15)*200)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\nprint((N * 800 - (N//15)*200))\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "N = int (input())\n\nx = 800 * N\ny = 200 * int (N/15)\n\nprint(x - y)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n = int(input())\nprint(n*800-n//15*200)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "# \u5168\u30661\u98df800\u5186\u306e\u30ec\u30b9\u30c8\u30e9\u30f3\n# 15\u98df\u98df\u3079\u308b\u3054\u3068\u306b\u305d\u306e\u5834\u3067200\u5186\u3082\u3089\u3048\u308b\n# \u5408\u8a08N\u98df\u305f\u3079\u305f\u3002\u6255\u3063\u305f\u91d1\u984d=x\u5186\u3001\u3082\u3089\u3063\u305f\u91d1\u984d\u3092y\u5186\u3068\u3057\u3066x-y\u3092\u6c42\u3081\u308b\n\n# \u5165\u529b\u3055\u308c\u305fN\u3092\u6570\u5024\u306b\u5909\u63db\nN = int(input())\n\n# \u6255\u3063\u305f\u91d1\u984d=x\u5186\u3092\u6c42\u3081\u308b\nx = 800 * N\n\n# \u3082\u3089\u3063\u305f\u91d1\u984d=y\u5186\u3092\u6c42\u3081\u308b\n# 200\u5186 * \u56de\u6570N\u309215\u3067\u5272\u3063\u305f\u6642\u306e\u6574\u6570\u306e\u5546\ny = 200 * (N // 15)\n\nprint(x-y)", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "# \u3059\u306c\u3051\u304f\u3093\u306f\u30ec\u30b9\u30c8\u30e9\u30f3\u306b\u901a\u3046\u306e\u304c\u597d\u304d\u3067\u3059\u3002\n# \u3059\u306c\u3051\u304f\u3093\u884c\u304d\u3064\u3051\u306e\u30ec\u30b9\u30c8\u30e9\u30f3\u306f\u4f55\u3092\u98df\u3079\u3066\u30821\u98df 800\u5186\u3067\u300115\u98df\u98df\u3079\u308b\u6bce\u306b\u305d\u306e\u5834\u3067 200\u5186\u3082\u3089\u3048\u307e\u3059\u3002\n# \u3059\u306c\u3051\u304f\u3093\u306f\u4eca\u307e\u3067\u3067\u5408\u8a08 N\u98df\u98df\u3079\u307e\u3057\u305f\u3002 \u4eca\u307e\u3067\u306b\u6255\u3063\u305f\u91d1\u984d\u3092x\u5186\u3001\u30ec\u30b9\u30c8\u30e9\u30f3\u304b\u3089\u3082\u3089\u3063\u305f\u91d1\u984d\u3092 y\u5186\u3068\u3057\u3066\u3001x\u2212y\u3092\u6c42\u3081\u306a\u3055\u3044\u3002\n\nN = int(input())\n\nprint(N *800 - (N // 15 *200))", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "N = int( input() )\nx = int( 800 * N )\n\ny = N // 15 * 200\n \nprint( x - y )", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "N=int(input())\nprint(800*N-200*(N//15))", "passed": true, "time": 0.15, "memory": 14232.0, "status": "done"}, {"code": "N = int(input())\n\ncount = 0\ny = 0\nx = 0\nwhile count != N:\n count += 1\n if count % 15 == 0:\n y += 200\n x += 800\n\nprint((x - y))\n", "passed": true, "time": 0.23, "memory": 14056.0, "status": "done"}, {"code": "eat = int(input())\npay = 0\ndiscount = 0\ncount = 0\n\nfor i in range(eat):\n pay += 800\n count += 1\n\n if count % 15 == 0:\n discount += 200\n\n\nprint(pay - discount)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\nx = N * 800\ny = N // 15 * 200\n\nprint(x - y)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "n = int(input())\nx = 800*n\ny = 200*(n//15)\nprint(x-y)", "passed": true, "time": 0.17, "memory": 14108.0, "status": "done"}, {"code": "N=int(input())\nx=N*800\ny=N//15*200\nprint(x-y)", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "n=int(input())\nprint(800*n-200*(n//15))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nn=int(input())\nx=800*n\ny=n//15*200\nprint(x-y)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "N = int(input())\n\nprint(N * 800 - (N // 15) * 200 )", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lint_dec(): return list([int(x) - 1 for x in input().split()])\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nN = ii()\nprint((800 * N - 200 * (N // 15)))\n", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "n=int(input());print(n*800-n//15*200)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "a=int(input())\nprint(800*a-(a//15)*200)", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "n = int(input())\nx = n * 800\ny = n//15 * 200\nprint(x-y)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "n = int(input())\nprint(n*800 - (n//15)*200)", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "n = int(input())\n\nprint(800 * n - 200 * (n//15))", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "a=int(input())\nprint(a*800-a//15*200)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "import math\n\nN = int(input())\n\nx = N * 800\n\ny = math.floor((N /15)) * 200\n\nprint(x-y)", "passed": true, "time": 0.21, "memory": 14248.0, "status": "done"}, {"code": "n = int(input())\n\nx = n * 800\ny = (n // 15) * -200\nprint((x + y))\n", "passed": true, "time": 0.2, "memory": 14076.0, "status": "done"}, {"code": "# A - Restaurant\n\nN = int(input())\n\nx = 800 * N\ny = N // 15 * 200\n\nanswer = x - y\n\nprint(answer)", "passed": true, "time": 0.21, "memory": 14108.0, "status": "done"}, {"code": "# A - Restaurant \ndef main():\n n = int(input())\n\n print(n*800-(n//15*200))\n \n \ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.21, "memory": 14176.0, "status": "done"}, {"code": "n = int(input())\nprint((800*n-200*(n//15)))\n\n", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "N = int(input())\n\nx = N * 800\ny = (N // 15) * 200\n\nprint((x - y))\n", "passed": true, "time": 0.32, "memory": 14080.0, "status": "done"}, {"code": "N = int(input())\n\nx = N * 800\ny = (N // 15) * 200\n\nprint(x - y)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "number = int(input())\n \nx = number * 800\ny = number // 15 * 200\n \nprint(x-y)", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "#055A\n\n#1.\u5165\u529b\u3092\u3061\u3083\u3093\u3068\u53d7\u3051\u53d6\u308b\u3053\u3068\nx=input()\nsyoku=int(x)\n\n#2.\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\ngokei=syoku*800\n\nif syoku // 15 != 0 :\n print(gokei-200*(syoku//15))\nelse :\n print(gokei)", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "n = int(input())\nb = n//15\nprint((800*n)-(200*b))", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "# 055A\n\n# N\u98df(\u6570\u5024\uff09\uff1a\u6a19\u6e96\u5165\u529b\nN = int(input())\n\n# \u4eca\u307e\u3067\u306b\u6255\u3063\u305f\u91d1\u984d\uff1ax\u5186\nx = 800 * N\n\n# 15\u98df\u3054\u3068\u306b\u8cb0\u3048\u308b\u91d1\u984d\uff1ay\u5186\n# // \u2192 \u5207\u308a\u6368\u3066\u9664\u7b97\u5c0f\u6570\u70b9\u90e8\u5206\u3092\u7701\u3044\u3066\u6574\u6570\u90e8\u5206\u3060\u3051\u8fd4\u3059\uff08\uff09\ny = N // 15 * 200\n\nprint(x - y)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "n = int(input())\nprint(800*n - (n//15)*200)", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "N = int(input())\nx = 800*N\ny = 200*(N//15)\nprint(x-y)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\nX = 800 * N\nY = 200 * (N // 15)\nprint(X - Y)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\nx = 800 * n\ny = n // 15 * 200\nprint(x - y)", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "N = int(input())\n\nbonus = 0\npay = 0\n\nfor i in range(1,N+1):\n if i % 15 == 0:\n bonus += 200\n \n pay += 800\n \nsum = pay - bonus\n\nprint(sum)", "passed": true, "time": 0.22, "memory": 14204.0, "status": "done"}, {"code": "N = int(input())\nprint(N*800-N//15*200)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "n = int(input())\n\nprint(800*n - n//15*200)", "passed": true, "time": 0.23, "memory": 14176.0, "status": "done"}, {"code": "n = int(input())\nprint(n*800-round(n//15)*200)", "passed": true, "time": 0.23, "memory": 14128.0, "status": "done"}]
[{"input": "20\n", "output": "15800\n"}, {"input": "60\n", "output": "47200\n"}]
4,706
We have a 3×3 square grid, where each square contains a lowercase English letters. The letter in the square at the i-th row from the top and j-th column from the left is c_{ij}. Print the string of length 3 that can be obtained by concatenating the letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right. -----Constraints----- - Input consists of lowercase English letters. -----Input----- Input is given from Standard Input in the following format: c_{11}c_{12}c_{13} c_{21}c_{22}c_{23} c_{31}c_{32}c_{33} -----Output----- Print the string of length 3 that can be obtained by concatenating the letters on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right. -----Sample Input----- ant obe rec -----Sample Output----- abc The letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid are a, b and c from top-right to bottom-left. Concatenate these letters and print abc.
introductory
[{"code": "cij = [list(input()) for _ in range(3)]\n\nprint(cij[0][0] + cij[1][1] + cij[2][2])", "passed": true, "time": 0.4, "memory": 14232.0, "status": "done"}, {"code": "def resolve():\n matrix = []\n for i in range(3):\n line = input()\n matrix.append(line)\n ans = \"\"\n for i in range(3):\n ans += matrix[i][i]\n print(ans)\nresolve()", "passed": true, "time": 0.3, "memory": 14100.0, "status": "done"}, {"code": "print(\"\".join(input()[i]for i in(0,1,2)))", "passed": true, "time": 0.15, "memory": 14144.0, "status": "done"}, {"code": "c1=str(input())\nc2=str(input())\nc3=str(input())\nprint(c1[0]+c2[1]+c3[2])", "passed": true, "time": 1.8, "memory": 14176.0, "status": "done"}, {"code": "c = [input() for _ in range(3)]\nprint(c[0][0]+c[1][1]+c[2][2])", "passed": true, "time": 0.14, "memory": 14012.0, "status": "done"}, {"code": "S1,S2,S3 = [input() for _ in range(3)]\nprint(S1[0]+S2[1]+S3[2])", "passed": true, "time": 0.15, "memory": 14044.0, "status": "done"}, {"code": "print(*[input()[i] for i in range(3)],sep='')", "passed": true, "time": 0.3, "memory": 14096.0, "status": "done"}, {"code": "a = input()[0]\ns = input()[1]\nd = input()[2]\nprint(a+s+d)", "passed": true, "time": 0.23, "memory": 14152.0, "status": "done"}, {"code": "ans = ''\n\nfor i in range(3):\n ans += input()[i]\n\nprint(ans)", "passed": true, "time": 0.38, "memory": 14080.0, "status": "done"}, {"code": "ans = []\nfor i in range(3):\n c = input()\n ans.append(c[i])\nprint(\"\".join(ans))", "passed": true, "time": 0.3, "memory": 14212.0, "status": "done"}, {"code": "c=[input() for i in range(3)]\nprint(*[c[i][i] for i in range(3)],sep=\"\")", "passed": true, "time": 0.15, "memory": 14316.0, "status": "done"}, {"code": "S1 = input()\nS2 = input()\nS3 = input()\nprint((S1[0] + S2[1] + S3[2]))\n", "passed": true, "time": 0.3, "memory": 14200.0, "status": "done"}, {"code": "s = [list(input()) for _ in range(3)]\nprint(\"\".join([s[i][i] for i in range(3)]))", "passed": true, "time": 0.15, "memory": 14340.0, "status": "done"}, {"code": "c=[input() for _ in range(3)]\nprint((c[0][0]+c[1][1]+c[2][2]))\n", "passed": true, "time": 0.29, "memory": 14172.0, "status": "done"}, {"code": "c=[input() for _ in range(3)]\nprint(c[0][0]+c[1][1]+c[2][2])", "passed": true, "time": 0.18, "memory": 14048.0, "status": "done"}, {"code": "a=input()\nb=input()\nc=input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.37, "memory": 14096.0, "status": "done"}, {"code": "x = [input() for i in range(3)]\nprint(x[0][0]+x[1][1]+x[2][2])", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "C = [input() for _ in range(3)]\nprint(C[0][0] + C[1][1] + C[2][2])", "passed": true, "time": 0.23, "memory": 14140.0, "status": "done"}, {"code": "a=input()\nb=input()\nc=input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.23, "memory": 14068.0, "status": "done"}, {"code": "res = \"\"\nfor i in range(3):\n line = input()\n res += line[i]\n\nprint(res)\n", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "print(input()[0] + input()[1] + input()[2])", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "A = []\nfor i in range(3):\n A.append(input())\nprint(A[0][0]+A[1][1]+A[2][2])", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "ans = \"\"\nfor i in range(3):\n ans += input()[i]\nelse:\n print(ans)", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "#k = int(input())\n#s = input()\n#a, b = map(int, input().split())\n#s, t = map(str, input().split())\n#l = list(map(int, input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\n#a = [list(input()) for _ in range(n)]\n#a = [int(input()) for _ in range(n)]\n\nc1 = input()\nc2 = input()\nc3 = input()\n\nprint((c1[0]+c2[1]+c3[2]))\n\n\n\n\n\n", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "c=[list(input()) for i in range(3)]\nprint(c[0][0]+c[1][1]+c[2][2])", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input()\nprint(a[0] + b[1] + c[2])", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input() \nprint((a[0] + b[1] + c[2]))\n", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "a = map(str, input().split())\nline_a = ''.join(a)\n\nb = map(str, input().split())\nline_b = ''.join(b)\n\nc = map(str, input().split())\nline_c = ''.join(c)\n\nprint('{}{}{}'.format(line_a[0], line_b[1], line_c[2]))", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\n\nc1 = str(input())\nc2 = str(input())\nc3 = str(input())\n\n\nprint((c1[0]+c2[1]+c3[2]))\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "a,b,c=input(),input(),input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "c = []\n\nfor i in range(3):\n tmp = input()\n c.append(tmp)\n\nans = \"\"\nfor i in range(3):\n ans += c[i][i]\n\nprint(ans)", "passed": true, "time": 0.19, "memory": 14328.0, "status": "done"}, {"code": "a = list(input())\nb = list(input())\nc = list(input())\n\nprint(a[0] + b[1] + c[2])", "passed": true, "time": 0.23, "memory": 14076.0, "status": "done"}, {"code": "str1 = input()\nstr2 = input()\nstr3 = input()\n\nprint(str1[0]+str2[1]+str3[2])", "passed": true, "time": 0.19, "memory": 14084.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input()\nprint(a[0] + b[1] + c[2])", "passed": true, "time": 0.27, "memory": 14072.0, "status": "done"}, {"code": "c1 = list(input())\nc2 = list(input())\nc3 = list(input())\n\nprint(c1[0]+c2[1]+c3[2])", "passed": true, "time": 0.28, "memory": 14176.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input()\nprint(a[0] + b[1] + c[2])", "passed": true, "time": 0.24, "memory": 14080.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input()\nprint((a[0] + b[1] + c[2]))\n", "passed": true, "time": 0.16, "memory": 14100.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "print(''.join([input()[i] for i in range(3)]))", "passed": true, "time": 0.16, "memory": 14156.0, "status": "done"}, {"code": "c = [list(input()) for i in range(3)]\n\nprint(c[0][0]+c[1][1]+c[2][2])", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "N_list = []\n\nfor i in range(3):\n N = input()\n N_i = N[0:3]\n N_list.append(N_i)\n i += 1\n \nprint(N_list[0][0] + N_list[1][1] + N_list[2][2])", "passed": true, "time": 0.15, "memory": 14104.0, "status": "done"}, {"code": "print(input()[0]+input()[1]+input()[2])", "passed": true, "time": 0.22, "memory": 14248.0, "status": "done"}, {"code": "cs=[input() for i in range(3)]\nprint(cs[0][0]+cs[1][1]+cs[2][2])", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "l = []\nfor i in range(3):\n l.append(input())\nprint(l[0][0]+l[1][1]+l[2][2])", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "c1 = str(input())\nc2 = str(input())\nc3 = input()\nprint(c1[0]+c2[1]+c3[2])", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "print(''.join([input()[i] for i in range(3)]))", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "a=input()\nb=input()\nc=input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "\nc1=list(map(str,input()))\nc2=list(map(str,input()))\nc3=list(map(str,input()))\nprint(c1[0]+c2[1]+c3[2])", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "s = \"\"\nfor i in range(3):\n s += input()\nprint(s[0] + s[4] + s[8])", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "ls = []\nfor i in range(3):\n ls.append(input())\nans = ''\nfor i in range(3):\n ans += ls[i][i]\nprint(ans)", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "def main():\n cat = \"\".join\n data = cat(input() for _ in range(3))\n print((cat([data[0], data[4], data[8]])))\n\n\nmain()\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input()\n\nprint((a[0] + b[1] + c[2]))\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "#\n# abc090 a\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"ant\nobe\nrec\"\"\"\n output = \"\"\"abc\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"edu\ncat\nion\"\"\"\n output = \"\"\"ean\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n C1 = input()\n C2 = input()\n C3 = input()\n\n print((C1[0]+C2[1]+C3[2]))\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14400.0, "status": "done"}, {"code": "n = input()\nn1 = input()\nn2 = input()\n\nprint(n[0],n1[1],n2[2], flush=True,sep='')\n\n", "passed": true, "time": 0.34, "memory": 14160.0, "status": "done"}, {"code": "c = [str(input()) for i in range(3)]\nw = c[0][0]+c[1][1]+c[2][2]\nprint(w)", "passed": true, "time": 0.14, "memory": 14016.0, "status": "done"}, {"code": "moji1 = str(input())\nmoji2 = str(input())\nmoji3 = str(input())\n\nprint(moji1[0]+moji2[1]+moji3[2])", "passed": true, "time": 0.18, "memory": 14068.0, "status": "done"}, {"code": "a=input()\nb=input()\nc=input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "c1 = input()\nc2 = input()\nc3 = input()\n\nprint(c1[0]+c2[1]+c3[2])", "passed": true, "time": 0.34, "memory": 14216.0, "status": "done"}, {"code": "A = list(input())\nB = list(input())\nC = list(input())\n\nprint(f\"{A[0]}{B[1]}{C[2]}\")", "passed": true, "time": 0.18, "memory": 14244.0, "status": "done"}, {"code": "print(input()[0]+input()[1]+input()[2])", "passed": true, "time": 0.19, "memory": 14084.0, "status": "done"}, {"code": "a = str(input())\nb = str(input())\nc = str(input())\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "c1=input()\nc2=input()\nc3=input()\nprint(c1[0],end=\"\")\nprint(c2[1],end=\"\")\nprint(c3[2])", "passed": true, "time": 0.29, "memory": 14248.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.21, "memory": 14176.0, "status": "done"}, {"code": "l=input()[0]\nl+=input()[1]\nl+=input()[2]\nprint(l)", "passed": true, "time": 0.21, "memory": 14164.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input()\n\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.16, "memory": 14052.0, "status": "done"}, {"code": "import sys\ns = sys.stdin.read().split()\nprint(s[0][0] + s[1][1] + s[2][2])", "passed": true, "time": 0.17, "memory": 14004.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "print(input()[0]+input()[1]+input()[2])", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "s = input()\nt = input()\nu = input()\nprint(s[0]+t[1]+u[2])", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "c_lst = [str(input()) for _ in range(3)]\nans = ''\nfor i in range(3):\n ans += c_lst[i][i]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "c = []\nfor i in range(3):\n c += [input()]\n \nprint(c[0][0] + c[1][1] + c[2][2])", "passed": true, "time": 0.15, "memory": 13976.0, "status": "done"}, {"code": "cs=[\"\"]*3\nfor i in range(3):\n cs[i]=input()\nprint(cs[0][0]+cs[1][1]+cs[2][2])", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "c1 = input()\nc2 = input()\nc3 = input()\n\nprint(c1[0] + c2[1] + c3[2])", "passed": true, "time": 0.23, "memory": 14292.0, "status": "done"}, {"code": "a = [input() for _ in range(3)]\nprint(a[0][0] + a[1][1] + a[2][2])", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "import sys\nC = sys.stdin.readlines()\nprint(C[0][0]+C[1][1]+C[2][2])", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "c1 = input()\nc2 = input()\nc3 = input()\nprint(\"\".join(c1[0]+c2[1]+c3[2]))", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "c1 = str(input())\nc2 = str(input())\nc3 = str(input())\n\nans = c1[0] + c2[1] + c3[2]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "ans = ''\nans += input()[0]\nans += input()[1]\nans += input()[2]\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "i1=input()\ni2=input()\ni3=input()\nprint(str(i1[0])+str(i2[1])+str(i3[2]))", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "c1 = list(input())\nc2 = list(input())\nc3 = list(input())\n\nprint(c1[0] + c2[1] + c3[2])", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "a = input()[0]\nb = input()[1]\nc = input()[2]\nprint(a+b+c)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "a=input()\nb=input()\nc=input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "S = [input() for i in range(3)]\nprint(S[0][0]+S[1][1]+S[2][2])", "passed": true, "time": 0.23, "memory": 14012.0, "status": "done"}, {"code": "a = [list(input()) for i in range(3)]\n\nprint(a[0][0]+a[1][1]+a[2][2])", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "l1 = input ()\nl2 = input ()\nl3 = input ()\nprint (l1[0]+l2[1]+l3[2])", "passed": true, "time": 0.23, "memory": 14176.0, "status": "done"}, {"code": "c1=str(input())\nc2=str(input())\nc3=str(input())\n\nprint(c1[0]+c2[1]+c3[2])", "passed": true, "time": 0.23, "memory": 14000.0, "status": "done"}, {"code": "n = list(input())\nn1 = list(input())\nn2 = list(input())\n\nprint(n[0]+n1[1]+n2[2])", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "c1 = input()[0]\nc2 = input()[1]\nc3 = input()[2]\nprint((c1+c2+c3))\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "a=input()\nb=input()\nc=input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.53, "memory": 14072.0, "status": "done"}, {"code": "\ndef main():\n c = [input() for _ in range(3)]\n print((c[0][0] + c[1][1] + c[2][2]))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "c1 = input()\nc2 = input()\nc3 = input()\nprint(c1[0]+c2[1]+c3[2])", "passed": true, "time": 0.53, "memory": 14080.0, "status": "done"}, {"code": "cs=[]\nfor i in range(3):\n cs.append(input())\nprint(cs[0][0]+cs[1][1]+cs[2][2])", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "a=input()\nb=input()\nc=input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "S = [input() for _ in range(3)]\nprint(S[0][0]+S[1][1]+S[2][2])", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "a=input()\nb=input()\nc=input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input()\nprint(a[0]+b[1]+c[2])", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}]
[{"input": "ant\nobe\nrec\n", "output": "abc\n"}, {"input": "edu\ncat\nion\n", "output": "ean\n"}]
4,707
Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either 0 or 1 is written. The number written in Square i is s_i. Snuke will place a marble on each square that says 1. Find the number of squares on which Snuke will place a marble. -----Constraints----- - Each of s_1, s_2 and s_3 is either 1 or 0. -----Input----- Input is given from Standard Input in the following format: s_{1}s_{2}s_{3} -----Output----- Print the answer. -----Sample Input----- 101 -----Sample Output----- 2 - A marble will be placed on Square 1 and 3.
introductory
[{"code": "s=input()\ncount=0\nfor i in range(len(s)):\n if(s[i]==\"1\"):\n count+=1\nprint(count)", "passed": true, "time": 1.86, "memory": 14280.0, "status": "done"}, {"code": "a=input()\nprint((a.count('1')))\n", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n# \u6574\u6570\u306e\u5165\u529b\ns = input()\nnumber = \"1\"\n\ncount = s.count(number)\nprint(count)", "passed": true, "time": 0.33, "memory": 14052.0, "status": "done"}, {"code": "print(input().count(\"1\"))", "passed": true, "time": 0.31, "memory": 14272.0, "status": "done"}, {"code": "cnt = 0\nfor s in input():\n if int(s) == 1:\n cnt += 1\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "import bisect,collections,copy,heapq,itertools,math,string\nimport sys\ndef I():\n #1 line 1 int\n return int(sys.stdin.readline().rstrip())\ndef LI():\n #1 line n int\n return list(map(int,sys.stdin.readline().rstrip().split()))\ndef S():\n #1 line 1 string\n return sys.stdin.readline().rstrip()\ndef LS():\n #1 line n strings\n return list(sys.stdin.readline().rstrip().split())\n\nx=S()\ncount=0\nfor s in x:\n if s == \"1\":\n count += 1\n \nprint(count)", "passed": true, "time": 1.95, "memory": 14268.0, "status": "done"}, {"code": "s = input()\nprint(s.count(\"1\"))", "passed": true, "time": 0.15, "memory": 14292.0, "status": "done"}, {"code": "s = list(input())\ncount = 0\nfor i in range(0, len(s)):\n if s[i] == \"1\":\n count += 1\n\nprint(count)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "import bisect,collections,copy,heapq,itertools,math,string\nimport sys\ndef I():\n # 1 line 1 int\n return int(sys.stdin.readline().rstrip())\ndef LI():\n # 1 line n ints\n return list(map(int,sys.stdin.readline().rstrip().split()))\ndef S():\n # 1 line 1 string\n return sys.stdin.readline().rstrip()\ndef LS():\n # 1 line n strings\n return list(sys.stdin.readline().rstrip().split())\n\nx = S()\n\ncount = 0\nfor s in x:\n if s == \"1\":\n count += 1\n\nprint(count)", "passed": true, "time": 0.32, "memory": 14248.0, "status": "done"}, {"code": "s=input()\nprint(s.count('1'))", "passed": true, "time": 1.89, "memory": 14056.0, "status": "done"}, {"code": "s = list(map(int, input()))\ncount = 0\nfor i in range(len(s)):\n if s[i] == 1:\n count +=1\nprint(count)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "a = input()\ncount = 0\nfor i in a:\n if i == '1':\n count += 1\n else:\n pass\nprint(count)\n", "passed": true, "time": 0.17, "memory": 14300.0, "status": "done"}, {"code": "print(sum([int(ss) for ss in input()]))", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "s1,s2,s3 = list(map(str, input()))\ncounter = 0\nif s1 == \"1\":\n counter += 1\nif s2 == \"1\":\n counter += 1\nif s3 == \"1\":\n counter += 1\nprint(counter)\n", "passed": true, "time": 0.23, "memory": 14196.0, "status": "done"}, {"code": "m = 0\nfor s in list(input()):\n if int(s) == 1:\n m += 1\nprint(m)\n", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "s=input()\nprint(s.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "S = input()\ncount = 0\n\nif S[0] == '1':\n count += 1\nif S[1] == '1':\n count += 1\nif S[2] == '1':\n count += 1\n \nprint(count)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "s = input()\n \nprint(s.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "S =input()\nprint(S.count('1'))", "passed": true, "time": 0.17, "memory": 14184.0, "status": "done"}, {"code": "s = list(input())\n\nans = 0\n\nfor i in range(len(s)):\n if s[i] == '1':\n ans += 1\nelse:\n print(ans)", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "print(input().count('1'))", "passed": true, "time": 0.17, "memory": 14156.0, "status": "done"}, {"code": "st_list = list(input())\nnu_list = [int(v) for v in st_list]\ncount = 0\nfor i in range(len(nu_list)):\n if nu_list[i] == 1:\n count += 1\nprint(count)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n = input()\nresult = sum(list(map(int,str(n))))\nprint(result)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "s=input()\ncount=0\n\nfor i in range(0,3,1):\n if s[i]=='1':\n count = count + 1\n\nprint(count) ", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "s=input()\nprint(s.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "# coding: utf-8\n# Your code here!\n\ncnt_1 = 0\n\nlist_S = input()\n\nfor i in list_S : \n if i == \"1\" : \n cnt_1 += 1\n \nprint(cnt_1)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "s = input()\nprint(s.count('1'))", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "s = input()\nprint(s.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "s = input().count('1')\nprint(s)", "passed": true, "time": 0.36, "memory": 14272.0, "status": "done"}, {"code": "s = input()\ns_c = s.count(\"1\")\nprint(s_c)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "s = input()\ns1 = int(s[0])\ns2 = int(s[1])\ns3 = int(s[2])\nprint(s1+s2+s3)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "s = input()\nprint(s.count('1'))", "passed": true, "time": 0.31, "memory": 14268.0, "status": "done"}, {"code": "a=str(input())\ncount=0\nfor i in range(3):\n if a[i-1]==\"1\":\n count+=1\nprint(count)", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "s = input()\nans = 0\nfor i in range(3):\n if s[i] == \"1\":\n ans += 1\n\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14260.0, "status": "done"}, {"code": "s = input()\nans = 0\nfor i in s:\n ans += int(i)\nprint(ans)", "passed": true, "time": 0.44, "memory": 14048.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nsys.setrecursionlimit(10**6)\n\ns = list(str(input()))\n\nans = [1 if i == \"1\" else 0 for i in s]\n\nprint((sum(ans)))\n", "passed": true, "time": 0.15, "memory": 14104.0, "status": "done"}, {"code": "print(input().count('1'))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "s = input()\n\nprint(s.count(\"1\"))", "passed": true, "time": 0.25, "memory": 14200.0, "status": "done"}, {"code": "a=input()\nx=0\nfor i in range(3):\n if a[i]==\"1\":\n x=x+1\nprint(x)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "print((input().count('1')))\n", "passed": true, "time": 0.27, "memory": 14160.0, "status": "done"}, {"code": "b = input()\na = str(b)\ni = 0\nif a[0] == '1':\n i += 1\nif a[1] == '1':\n i += 1\nif a[2] == '1':\n i += 1\nprint(i)\n", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "print(input().count(\"1\"))", "passed": true, "time": 0.24, "memory": 14148.0, "status": "done"}, {"code": "print(input().count('1'))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "print(input().count(\"1\"))", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "s = list(map(int,input()))\ncount = 0\n\nfor n in s:\n if n == 1:\n count+=1\n \nprint(count)", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "print(input().count(\"1\"))", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "s = input()\na, b, c = int(s[0]), int(s[1]), int(s[2])\ncount = 0\nif a == 1:\n count+=1\nif b == 1:\n count+=1\nif c == 1:\n count+=1\nprint(count)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "#\u7b2c2\u554f\u3000ABC081A\nnumber = list(map(int,input()))\na = 0\nfor i in number:\n if i == 1:\n a = a+1\nprint(a)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "s = input()\n\nif s == '111':\n print(3)\nelif s == '110' or s == '101' or s == '011':\n print(2)\nelif s == '100' or s == '010' or s == '001':\n print(1)\nelse:\n print(0)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "print(input().count('1'))", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n = input()\nprint(n.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "s = str(input())\nprint(s.count('1'))", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "a=input()\ncount=0\n\nfor i in range(3):\n if a[i]=='1':\n \tcount+=1\n\nprint(count)\n", "passed": true, "time": 0.23, "memory": 14160.0, "status": "done"}, {"code": "print(input().count('1'))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "print(input().count(\"1\"))", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "getints = lambda: list(map(int, input().split()))\ns = input()\nans = 0\nfor c in s:\n if c == '1':\n ans += 1\nprint(ans)\n", "passed": true, "time": 0.13, "memory": 14068.0, "status": "done"}, {"code": "s = map(int, list(input()))\nprint(sum(s))", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "s = input()\nprint(s.count('1'))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "print(input().count('1'))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "a = int(input())\n\ncount = 0\n\n# print(int(a/100))\nif int(a / 100) == 1:\n count += 1\n\n#print(int(a/10 % 10))\nif int(a / 10 % 10) == 1:\n count += 1\n\n#print(int(a % 100 % 10))\nif int(a % 100 % 10) == 1:\n count += 1\n\nprint(count)\n", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "li = list(input())\nc = 0\nfor i in li:\n if i == '1':\n c += 1\n\nprint(c)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "s = str(input())\nans = int(s[0])+int(s[1])+int(s[2])\nprint(ans)", "passed": true, "time": 0.89, "memory": 14276.0, "status": "done"}, {"code": "a = input()\nprint(a.count('1'))", "passed": true, "time": 0.16, "memory": 14148.0, "status": "done"}, {"code": "a = input()\nprint((a.count('1')))\n", "passed": true, "time": 0.27, "memory": 14300.0, "status": "done"}, {"code": "print(input().count(\"1\"))", "passed": true, "time": 0.19, "memory": 14180.0, "status": "done"}, {"code": "s=list(input())\nres=0\nfor i in s:\n if (i=='1'):\n res+=1\nprint(res)", "passed": true, "time": 0.16, "memory": 14280.0, "status": "done"}, {"code": "s = input()\nprint(s.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "A = input()\n\nans=int(0)\n\nif A[0] == \"1\":\n ans = ans + 1\n\nif A[1] == \"1\":\n ans = ans + 1\n\nif A[2] == \"1\":\n ans = ans + 1\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "s=input()\nprint(s.count(\"1\"))", "passed": true, "time": 0.17, "memory": 14028.0, "status": "done"}, {"code": "s = list(input())\ncnt = 0\nfor item in s:\n if (int(item) == 1):\n cnt = cnt + 1\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "i = str(input())\ns1, s2, s3 = int(i[0]), int(i[1]), int(i[2])\nprint(int(s1+s2+s3))", "passed": true, "time": 0.32, "memory": 14084.0, "status": "done"}, {"code": "D = input()\n\nA=\"1\"\nB=\"11\"\nC=\"101\"\nF=\"111\"\n\nif F == D:\n print((3))\n \nelif B in D:\n print((2))\n\nelif C == D:\n print((2))\n\nelif A in D:\n print((1))\n\nelse:\n print((0))\n", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "s = input()\ncnt = 0\n\nif s[0] == '1' : cnt += 1\nif s[1] == '1' : cnt += 1\nif s[2] == '1' : cnt += 1\n\nprint(cnt)\n", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "s1,s2,s3 = map(int, input())\n\nnumber_list = [s1,s2,s3]\n\ncounter = 0\n\nfor i in range(len(number_list)):\n if number_list[i] == 1:\n counter += 1\nprint(counter)", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "s = input()\n\nprint(s.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "s=input()\nprint(s.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "s = list(input())\nprint(s.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "\n\n# Press the green button in the gutter to run the script.\ndef __starting_point():\n s = input()\n\n count = 0\n for n in range(3):\n if s[n] == '1':\n count = count + 1\n\n print(count)\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "s = input()\nprint(s.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "a = input()\n\nb = a.count('1')\nprint(b)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "area = input()\nprint(area.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "print(input().count(\"1\"))", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "def main():\n s = input()\n print(s.count(\"1\"))\n\n\nmain()", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "s = list(input())\n\nprint(s.count('1'))", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "def iroha():\n num = input()\n count = 0\n\n for i in num:\n if i == '1':\n count+=1\n \n print(count)\n\n\ndef __starting_point():\n iroha()\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "a = input()\nprint((a.count('1')))\n", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "s = input()\nans = 0\n\nfor i in s:\n if i == \"1\":\n ans += 1\n\nprint(ans)", "passed": true, "time": 0.21, "memory": 14068.0, "status": "done"}, {"code": "s = input()\nprint((s.count('1')))\n", "passed": true, "time": 0.2, "memory": 14204.0, "status": "done"}, {"code": "s = input()\nans = 0\nfor i in s:\n ans += int(i)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "s = input()\ncount = 0\nif s[0] == '1':\n count += 1\nif s[1] == '1':\n count +=1\nif s[2] == '1':\n count += 1\nprint(count)", "passed": true, "time": 0.19, "memory": 14188.0, "status": "done"}, {"code": "# \u6587\u5b57\u5217\u306e\u5165\u529b\ns = input()\n\nprint(int(s[0]) + int(s[1]) + int(s[2]))", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "print(input().count('1'))", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "def solve(s):\n count = 0\n if s[0] == '1':\n count += 1\n if s[1] == '1':\n count += 1\n if s[2] == '1':\n count += 1\n print(count)\n\n\ndef __starting_point():\n solve(input())\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "a = input()\nprint(a.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "#81\ndata=list(input())\nc=0\nfor i in range(0,len(data)):\n if data[i]=='1':\n c=c+1\nprint(c)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "print(input().count('1'))", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "print(input().count(\"1\"))", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "s = input()\n\nprint(s.count(\"1\"))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "s = input()\n \ncnt = sum([int(c) for c in s])\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}]
[{"input": "101\n", "output": "2\n"}, {"input": "000\n", "output": "0\n"}]
4,708
There is a hotel with the following accommodation fee: - X yen (the currency of Japan) per night, for the first K nights - Y yen per night, for the (K+1)-th and subsequent nights Tak is staying at this hotel for N consecutive nights. Find his total accommodation fee. -----Constraints----- - 1 \leq N, K \leq 10000 - 1 \leq Y < X \leq 10000 - N,\,K,\,X,\,Y are integers. -----Input----- The input is given from Standard Input in the following format: N K X Y -----Output----- Print Tak's total accommodation fee. -----Sample Input----- 5 3 10000 9000 -----Sample Output----- 48000 The accommodation fee is as follows: - 10000 yen for the 1-st night - 10000 yen for the 2-nd night - 10000 yen for the 3-rd night - 9000 yen for the 4-th night - 9000 yen for the 5-th night Thus, the total is 48000 yen.
introductory
[{"code": "\nN = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif K < N:\n ans = K*X + (N-K)*Y\nelse:\n ans = N*X\nprint(ans)", "passed": true, "time": 0.18, "memory": 14024.0, "status": "done"}, {"code": "N, K, X, Y = [int(input()) for _ in range(4)]\nprint(X * min(K, N) + Y * max(0, N - K))", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "n,k,x,y = [int(input()) for _ in range(4)]\n\nif k <= n:\n sum = (x * k) + (y * (n-k))\nelse:\n sum = x * n\n\nprint(sum)", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k :\n print(k*x + (n-k)*y)\nelif n <= k:\n print(n*x)", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "import math\nfrom datetime import date\n\ndef main():\n\t\n\tn = int(input())\n\tk = int(input())\n\tx = int(input())\n\ty = int(input())\t\n\t\n\tans = max(0, n - k) * y + min(n, k) * x;\n\tprint(ans)\n\nmain()\n", "passed": true, "time": 0.17, "memory": 16580.0, "status": "done"}, {"code": "n,k,x,y=[int(input()) for i in range(4)]\nif n<=k:\n print(n*x)\nelse:\n print(k*x+(n-k)*y)", "passed": true, "time": 0.19, "memory": 14228.0, "status": "done"}, {"code": "N,K,x,y = [int(input()) for i in range(4)]\n\nif K<N:\n print((N-K)*y + K*x)\n \nelse:\n print(N*x)", "passed": true, "time": 0.15, "memory": 14320.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n print(k*x+(n-k)*y)\nelse: \n print(n*x)", "passed": true, "time": 0.22, "memory": 14168.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif N > K:\n print(K*X+(N-K)*Y)\nelse:\n print(N*X)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "a,b,c,d = [int(input()) for i in range(4)]\nif a<b:\n\tprint(a*c)\nelse:\n\tprint((b*c) +((a-b) * d) )", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif N <= K:\n print(N * X)\nelse:\n print(K * X + (N - K) * Y)", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nprint(x * min(n, k) + y * max(n-k, 0))", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "# 044_a\n# A - \u9ad8\u6a4b\u541b\u3068\u30db\u30c6\u30eb\u30a4\u30fc\u30b8\u30fc\n\nN = int(input()) # \u9023\u6cca\u6570\nK = int(input()) # \u6599\u91d1\u5909\u52d5\u6cca\u6570\nX = int(input()) # \u901a\u5e38\u4fa1\u683c\nY = int(input()) # \u5909\u52d5\u4fa1\u683c\n\nif ((1 <= N & N <= 10000) & (1 <= K & K <= 10000)) \\\n & (1 <= X & X <= 10000) & (1 <= Y & Y <= 10000):\n if (X > Y):\n price = 0\n if (N < K):\n for i in range(1, N + 1):\n price += X\n if (N >= K):\n for i in range(1, K + 1):\n price += X\n for j in range(K + 1, N + 1):\n price += Y\n print(price)", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "n,k,x,y = [int(input()) for i in range(4)]\ncost = (min(n,k)*x+max(0,n-k)*y)\nprint(cost)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nans = 0\nif n <= k:\n ans = n*x\nelse:\n ans = k*x + (n-k)*y\nprint(ans)", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n ans = k * x + (n - k) * y\n \nelse:\n ans = n * x\n \nprint(ans)", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nprint((min(k, n)*x + max(n-k, 0)*y))\n", "passed": true, "time": 0.2, "memory": 14100.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nfirst=min(n,k)\nre=first*x\nre+=max((n-first),0)*y\nprint(re)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "def main():\n n = int(input())\n k = int(input())\n x = int(input())\n y = int(input())\n\n if n <= k :\n ans = x * n\n else :\n ans = x * k + y * (n - k)\n\n print(ans)\n\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "# \u6700\u521d\u306eK\u6cca\u307e\u3067\u306f\u30011\u6cca\u3042\u305f\u308aX\u5186\n# K+1\u6cca\u76ee\u4ee5\u964d\u306f\u30011\u6cca\u3042\u305f\u308aY\u5186\n# N\u6cca\u3057\u305f\u3068\u304d\u306e\u5bbf\u6cca\u8cbb\n\nN = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nif N <= K:\n print(X * N)\nelse:\n print(X * K + Y * (N - K))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nans = 0\n\nfor i in range(1,N+1):\n if i<=K:\n ans += X\n else:\n ans += Y\n \nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n > k:\n print(x * k + y * (n - k))\nelse:\n print(x * n)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n >= k:\n print(k*x + (n-k)*y)\nelse:\n print(n*x)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n print((k*x+(n-k)*y))\nelse:\n print((n*x))\n", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}, {"code": "# \u6570\u5024\u306e\u53d6\u5f97\nN = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\n# \u5bbf\u6cca\u8cbb\u306e\u8a08\u7b97\u5f8c\u7d50\u679c\u3092\u51fa\u529b\nif N <= K:\n account = N * X\nelse:\n account = (K * X) + (max(N - K,0) * Y) \n \nprint(account)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nans = 0\n\nif N > K:\n for i in range(0, K):\n ans += X\n for i in range(K, N):\n ans += Y\nelif N <= K:\n for i in range(0, N):\n ans += X\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "from sys import stdin\ninput = stdin.readline\n\nN = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nif N <= K:\n cost = N * X\nelse:\n cost = K * X + (N - K) * Y\n\nprint(cost)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nX=int(input())\nY=int(input())\n\nif N<=K:\n print(X*N)\nelse:\n print(X*K+Y*(N-K))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\n\nprint(min(k,n)*x+max(0,n-k)*y)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "\"\"\"\nABC044 A \u9ad8\u6a4b\u541b\u3068\u30db\u30c6\u30eb\u30a4\u30fc\u30b8\u30fc\nhttps://kenkoooo.com/atcoder/#/table/Tsukumo\n\"\"\"\n\nn = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n ans = k*x + (n-k)*y\nelse:\n ans = n*x\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "n= int(input())\nk= int(input())\nx= int(input())\ny= int(input())\nprint((x*n if k>=n else (n-k)*y+x*k))\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nprint((min(k, n)*x + max((n-k)*y, 0)))\n", "passed": true, "time": 0.16, "memory": 14008.0, "status": "done"}, {"code": "def solve():\n n = int(input())\n k = int(input())\n x = int(input())\n y = int(input())\n print((x * min(n, k) + y * max(n-k,0)))\n\n\ndef __starting_point():\n solve()\n\n__starting_point()", "passed": true, "time": 0.19, "memory": 14272.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n <= k:\n print(n*x)\nelse:\n print(k*x + (n-k)*y)", "passed": true, "time": 1.39, "memory": 14044.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n < k: print(x * n)\nelse: print(x * k + y * (n - k))", "passed": true, "time": 0.51, "memory": 14284.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif N > K:\n SUM = X*K + Y*(N - K)\nelse:\n SUM = X*N\nprint(SUM)\n", "passed": true, "time": 0.18, "memory": 14176.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n < k:\n print(n * x)\nelse:\n print(k * x + (n - k) * y)", "passed": true, "time": 0.21, "memory": 14240.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n print(k * x + (n - k) * y)\nelse:\n print(n * x)", "passed": true, "time": 0.2, "memory": 14200.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n <= k:\n print(n*x)\nelse:\n print(k*x+(n-k)*y)", "passed": true, "time": 0.17, "memory": 14204.0, "status": "done"}, {"code": "# abc044_a\n# https://atcoder.jp/contests/abc044/tasks/abc044_a\n\n# \u6700\u521d\u306eK\u6cca\u307e\u3067\u306f\u3001X\u5186\n# K\uff0b1\u6cca\u76ee\u4ee5\u964d\u306f\u3001Y\u5186\n\n# N\u6cca\u9023\u7d9a\u3067\u5bbf\u6cca\u3057\u305f\u969b\u306e\u5bbf\u6cca\u8cbb\n\n# \u5165\u529b\nn = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\n# \u51e6\u7406\n\n# x\u5186\u3068y\u5186\nif n > k:\n answer = k * x + (n - k) * y\n# x\u5186\u306e\u307f\nelse:\n answer = n * x\n\nprint(answer)\n", "passed": true, "time": 0.14, "memory": 14008.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nans = min(n,k)*x + max(n-k,0)*y\nprint(ans)", "passed": true, "time": 0.18, "memory": 14088.0, "status": "done"}, {"code": "N, K, X, Y = [int(input()) for _ in range(4)]\nresult = min(N, K)\nN -= result\nresult *= X\n\nif N >= 0:\n result += N * Y\nprint(result)", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "n,k,x,y=[int(input()) for _ in range(4) ]\nans=k*x+(n-k)*y\nprint(ans if n>k else n*x)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "n,k,x,y=[int(input()) for i in range(4)]\nprint(n*x+min(0,(k-n)*(x-y)))", "passed": true, "time": 0.19, "memory": 14080.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nX=int(input())\nY=int(input())\nif K<N:\n print((X*K+Y*(N-K)))\nelse:\n print((X*N))\n\n", "passed": true, "time": 0.25, "memory": 14164.0, "status": "done"}, {"code": "n,k,x,y = [int(input()) for _ in range(4)]\nprint((min(n,k)*x + max(0,n-k)*y))\n", "passed": true, "time": 0.23, "memory": 14108.0, "status": "done"}, {"code": "n,k,x,y=int(input()),int(input()),int(input()),int(input())\nif n<k:print(x*n)\nelse:print(x*k+y*(n-k))", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "import sys\nimport math\n\n#https://atcoder.jp/contests/agc008/submissions/15248942\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninm = lambda: map(int, sys.stdin.readline().split())\ninl = lambda: list(inm())\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print(\"\\033[33m\", *a, \"\\033[0m\", **dict(file=sys.stderr, **kw))\n\nN = ini()\nK = ini()\nX = ini()\nY = ini()\n\nif N > K:\n print(K*X+(N-K)*Y)\nelse:\n print(N*X)\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "N, K, X, Y = [int(input()) for i in range(4)]\nprint(K * X + (N - K) * Y if N > K else N * X)", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nans=0\nif n>=k:\n ans+=x*k\n n-=k\n ans+=y*n\nelse:\n ans+=x*n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif k <= n:\n print(k*x+(n-k)*y)\nelse:\n print(n*x)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "total=int(input()) #\u5bbf\u6cca\u65e5\u6570\ndisc=int(input()) #\u521d\u3081\u306e\u5272\u5f15\u306a\u3057\u65e5\u6570\npriceX=int(input()) #\u5272\u5f15\u306a\u3044\u5024\u6bb5\npriceY=int(input()) #\u5272\u5f15\u5f8c\u306e\u5024\u6bb5\n\nans=()\nif total<=disc:\n ans=total*priceX\nelse:\n ans=disc*priceX+(total-disc)*priceY\nprint(ans)", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nans = 0\n\nfor i in range(N):\n if i + 1 <= K:\n ans += X\n else:\n ans += Y\nprint(ans)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "N = int(input()) # N\u6cca\nK = int(input()) # \u6700\u521d\u306eK\u6cca\u307e\u3067\u306f1\u6cca\u5f53\u305f\u308aX\u5186\nX = int(input())\nY = int(input()) # K+1\u6cca\u76ee\u4ee5\u964d\u306f1\u6cca\u5f53\u305f\u308aY\u5186\n\nif N - K > 0:\n total = (K * X) + ((N - K) * Y)\nelse:\n total = N * X\n\nprint(total)\n", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "n,k,x,y=[int(input()) for _ in range(4)];print([n*x,k*x+(n-k)*y][n-k>0])", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nif N <= K:\n ans = X * N\nelse:\n ans = X * K + (N - K) * Y\nprint(ans)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "import sys\n\ndef I(): return int(sys.stdin.readline())\ndef MI(): return map(int, sys.stdin.readline().split())\ndef LI(): return list(map(int, sys.stdin.readline().split()))\ndef main():\n n = I()\n k = I()\n x = I()\n y = I()\n if n <= k:\n print(n*x)\n else:\n print(k*x + (n-k)*y)\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\ns = 0\nfor i in range(1, n+1, 1):\n if i <= k:\n s += x\n else:\n s += y\nprint(s)\n", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\n\nif n <= k:\n print(n*x)\n \nelse:\n print(k*x+(n-k)*y)", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif K < N:\n print(K * X + (N - K) * Y)\nelse:\n print(N * X)", "passed": true, "time": 0.17, "memory": 14196.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\ndef main():\n n = int(input())\n k = int(input())\n x = int(input())\n y = int(input())\n print((n * x - (x - y) * max(n - k, 0)))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.16, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\n\nif n <= k:\n print((n*x))\nelse:\n print((k*x+(n-k)*y))", "passed": true, "time": 0.15, "memory": 14176.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nX=int(input())\nY=int(input())\nprint((K*X+(N-K)*Y if N>=K else X*N))\n", "passed": true, "time": 0.16, "memory": 14084.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nfees=0\nif(k>n or n==k):\n\tfor i in range(0,n):\n\t\tfees+=x\nelif(k<n):\n\tdiff=n-k\n\tfor j in range(0,k):\n\t\tfees+=x\n\tfor k in range(0,diff):\n\t\tfees+=y\n\t\t\nprint(fees)\n", "passed": true, "time": 0.15, "memory": 14176.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n<=k:\n print(n*x)\nelse:\n tmp = (n-k) * y + k * x\n print(tmp)", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n \nif N<=K:\n print(X*N)\nelse:\n print(K * X + (N - K) * Y)", "passed": true, "time": 0.16, "memory": 14048.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif N > K:\n print(K * X + (N - K) * Y)\nelse:\n print(N * X)", "passed": true, "time": 0.15, "memory": 14164.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nans = min(n, k) * x\nn -= min(n, k)\n\nans += n * y\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\ncost = 0\nif n > k:\n for i in range(k):\n cost += x\n\n for j in range(k, n):\n cost += y\n print(cost)\n\nelif n <= k:\n for i in range(n):\n cost += x\n print(cost)\n\n\n", "passed": true, "time": 0.16, "memory": 14208.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nif k<n:\n print(k*x+(n-k)*y)\nelse:\n print(n*x)", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "N,K,X,Y=[int(input()) for i in range(4)]\n\nif(K>=N):\n Z=N*X\n print(Z)\nelse:\n Z=K*X+(N-K)*Y\n print(Z)", "passed": true, "time": 0.16, "memory": 14300.0, "status": "done"}, {"code": "n, k, x, y = [int(input()) for _ in range(4)]\nif n <= k:\n print(x * n)\nelse:\n print(x * k + y * (n - k))", "passed": true, "time": 0.15, "memory": 14212.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nif n<k:\n print(n*x)\nelse:\n print(k*x+(n-k)*y)", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "class Combination:\n def __init__(self, n, mod):\n self.n = n\n self.mod = mod\n self.fac = [1 for i in range(self.n + 1)]\n self.finv = [1 for i in range(self.n + 1)]\n for i in range(2, self.n+1):\n self.fac[i] = (self.fac[i - 1] * i) % self.mod\n self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod\n\n def comb(self, n, m):\n return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod\ndef iparse():\n return list(map(int, input().split()))\n\ndef __starting_point():\n n = int(input())\n k = int(input())\n x = int(input())\n y = int(input())\n\n print((min(k,n)*x + max(0,n-k)*y))\n \n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14136.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nif N <= K:\n print(N * X)\nelif N >= K:\n k_stay = K * X\n k_plus_stay = (N - K) * Y\n print(k_plus_stay + k_stay)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nn1 = n - k\nif n > k:\n print((k*x)+(y*n1))\nelse:\n print(n*x)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nX=int(input())\nY=int(input())\n\nif N<=K:\n print((X*N))\nelse:\n print((X*K+Y*(N-K)))\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n >= k:\n print((k * x) + (n - k) * y)\nelse:\n print(n * x)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nans = 0\nfor i in range(n):\n if i < k:\n ans += x\n else:\n ans += y\n \nprint(ans)", "passed": true, "time": 0.24, "memory": 14084.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nprice = 0\nif N <= K:\n for i in range(N):\n price += X\n print(price)\nelse:\n for i in range(K):\n price += X\n for i in range(N-K):\n price += Y\n print(price)", "passed": true, "time": 0.24, "memory": 14076.0, "status": "done"}, {"code": "import sys\nfrom heapq import heappush, heappop, heapify\nimport math\nfrom math import gcd\nimport itertools as it\nfrom collections import deque \n\ninput = sys.stdin.readline\n\ndef inp():\n return int(input())\ndef inpl():\n return list(map(int, input().split()))\n\nINF = 1001001001\n\n# ---------------------------------------\n\ndef main():\n n = inp()\n k = inp()\n x = inp()\n y = inp()\n if n > k:\n print((x * k + y * (n - k)))\n else:\n print((x * n))\n\nmain()\n", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n<k:\n print(n*x)\nelse:\n print((n-k)*y + k*x)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "L = [int(input()) for _ in range(4)]\nprint(L[2]*min(L[0],L[1])+L[3]*max(0,L[0]-L[1]))", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n \nn1 = n - k\nif n > k:\n print((k*x)+(y*n1))\nelse:\n print(n*x)", "passed": true, "time": 0.24, "memory": 14084.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n <= k:\n print(x*n)\nelse:\n print((x*k) + (y*(n-k)))", "passed": true, "time": 0.23, "memory": 14240.0, "status": "done"}, {"code": "def iroha():\n n, k, price, special = [int(input()) for i in range(4)]\n result = 0\n for i in range(n):\n if i < k:\n result += price\n else:\n result += special\n print(result)\n\ndef __starting_point():\n iroha()\n\n__starting_point()", "passed": true, "time": 0.24, "memory": 14072.0, "status": "done"}, {"code": "a,b,c,d=[int(input()) for i in range(4)]\nprint(min(a,b)*c+max(0,(a-b))*d)", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n,k,x,y = [int(input()) for i in range(4)]\ncost=(min(n,k)*x+max(0,n-k)*y)\nprint(cost)", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "val = [int(input()) for i in range(4)]\nif val[0] > val[1] :\n print(val[1] * val[2] + (val[0] - val[1]) * val[3])\nelse:\n print(val[0] * val[2])", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "import sys\nN, K, X, Y = map(int, sys.stdin.readlines())\nprint(N*X if N <= K else K*X +Y*(N-K))", "passed": true, "time": 0.16, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n total = (k * x) + (n - k) * y\n print(total)\nelse:\n total = n * x\n print(total)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nans = 0\nif n>k:\n ans = (k*x) + (n-k)*y\nelse:\n ans = n*x\nprint(ans)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nX=int(input())\nY=int(input())\n#print(type(N))\n\nif N<=K:\n daikin = X*N\nelse:\n daikin = X*K+Y*(N-K)\nprint(daikin)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "\nn = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n <= k:\n print(n*x)\nelse:\n print(k*x + (n-k)*y)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n <= k:\n print((n*x))\nelse:\n print((k*x + (n-k)*y))\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "total = int(input())\ninitial = int(input())\nif initial > total:\n initial = total\na = int(input())\nb = int(input())\ncount = 0\nfor i in range(initial):\n count+= a\nfor c in range(total - initial):\n count+=b\n\nprint(count)\n", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "from sys import stdin\ninput = stdin.readline\n\nn, k, x, y = list(map(int, stdin.read().split()))\n\nprint((min(k, n) * x + max(0, n - k) * y))\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nans =0\nfor i in range(n):\n if(i+1<=k):\n ans += x\n if(i+1>k):\n ans += y\nprint(ans)\n \n", "passed": true, "time": 0.16, "memory": 14276.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n print(k*x+(n-k)*y)\nelse: \n print(n*x)", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}]
[{"input": "5\n3\n10000\n9000\n", "output": "48000\n"}, {"input": "2\n3\n10000\n9000\n", "output": "20000\n"}]
4,709
Joisino wants to evaluate the formula "A op B". Here, A and B are integers, and the binary operator op is either + or -. Your task is to evaluate the formula instead of her. -----Constraints----- - 1≦A,B≦10^9 - op is either + or -. -----Input----- The input is given from Standard Input in the following format: A op B -----Output----- Evaluate the formula and print the result. -----Sample Input----- 1 + 2 -----Sample Output----- 3 Since 1 + 2 = 3, the output should be 3.
introductory
[{"code": "a, o, b = input().split()\nif o == '+':\n print((int(a) + int(b)))\nelse:\n print((int(a) - int(b)))\n", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "a, op, b = input().split()\n\na = int(a)\nb = int(b)\n\nif op == \"+\":\n S = a + b\nelse:\n S = a - b\n\nprint(S)\n", "passed": true, "time": 0.16, "memory": 14244.0, "status": "done"}, {"code": "A, op, B = input().split()\nif op == '-':\n print((int(A) - int(B)))\nelse:\n print((int(A) + int(B)))\n", "passed": true, "time": 0.2, "memory": 14212.0, "status": "done"}, {"code": "A, op, B = input().split()\nprint(int(A) + int(B) if op == \"+\" else int(A) - int(B))", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "a, op , b = input().split()\nif op == '+':\n print(int(a) + int(b))\nelse:\n print(int(a) - int(b))", "passed": true, "time": 0.21, "memory": 14112.0, "status": "done"}, {"code": "a, op, b = input().split()\na, b = int(a), int(b)\n\nif op == '+':\n print((a + b))\nelse:\n print((a - b))\n", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "# \u5165\u529b\nA, op, B = list(map(str, input().split()))\n\n# +\u306a\u3089\u8db3\u3059\u3001-\u306a\u3089\u5f15\u304f\nif op == '+':\n print((int(A) + int(B)))\nelif op == '-':\n print((int(A) - int(B)))\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "A,op,B=input().split()\nA,B=int(A),int(B)\nif op==\"+\":\n print(A+B)\nelse:\n print(A-B)", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "a,op,b=map(str,input().split())\na=int(a)\nb=int(b)\nif op==\"+\":\n print(a+b)\nelse:\n print(a-b)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "# A op B\u3068\u3044\u3046\u5f0f\u306e\u5024\u3092\u8a08\u7b97\n\nA, op, B = map(str, input().split())\nA = int(A)\nB = int(B)\n\nif op == '+':\n print(A + B)\nelse:\n print(A - B)", "passed": true, "time": 0.15, "memory": 14360.0, "status": "done"}, {"code": "A, op, B=input().split()\nA = int(A)\nB = int(B)\n\nif op == '+':\n print(A+B)\nelse:\n print(A-B)", "passed": true, "time": 0.16, "memory": 14232.0, "status": "done"}, {"code": "A, op, B = input().split()\nA, B = int(A), int(B)\n\nif op == \"+\":\n ans = A + B\nelse:\n ans = A - B\n\nprint(ans)", "passed": true, "time": 0.21, "memory": 14180.0, "status": "done"}, {"code": "A, op, B = input().split()\nA, B = int(A), int(B)\nprint(A+B if op == '+' else A-B)", "passed": true, "time": 0.16, "memory": 14092.0, "status": "done"}, {"code": "a,op,b=input().split()\nif op==\"+\":\n print(int(a)+int(b))\nelse:\n print(int(a)-int(b))", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "s = input()\n\nif '+' in s:\n index = s.index('+')\n print((int(s[:index])+int(s[index+1:])))\nelse:\n index = s.index('-')\n print((int(s[:index])-int(s[index+1:])))\n", "passed": true, "time": 0.23, "memory": 14252.0, "status": "done"}, {"code": "a = input().split()\nif a[1] == '+':\n print(int(a[0])+int(a[2]))\nelse:\n print(int(a[0])-int(a[2]))", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "# 050_a\nA, op, B = input().split()\nA = int(A)\nB = int(B)\nif (1 <= A & A <= 10 ** 9) & (1 <= B & B <= 10 ** 9) & ((op == '+') | (op == '-')):\n if op == '+':\n result = A + B\n elif op == '-':\n result = A - B\n print(result)", "passed": true, "time": 0.17, "memory": 14320.0, "status": "done"}, {"code": "a, op, b = input().split()\nif op == '+':\n ans = int(a) + int(b)\nelse:\n ans = int(a) - int(b)\nprint(ans)", "passed": true, "time": 0.23, "memory": 14060.0, "status": "done"}, {"code": "a, b, c = input().split()\nif b == \"+\":\n print(int(a) + int(c))\nelse:\n print(int(a) - int(c))", "passed": true, "time": 0.16, "memory": 14208.0, "status": "done"}, {"code": "a,op,b=input().split()\nif op==\"+\":\n print(int(a)+int(b))\nelse:\n print(int(a)-int(b))", "passed": true, "time": 0.18, "memory": 14076.0, "status": "done"}, {"code": "s = list(input().split())\nprint(eval(\"\".join(s)))", "passed": true, "time": 0.13, "memory": 14188.0, "status": "done"}, {"code": "a,b,c = map(str,input().split())\na = int(a)\nc = int(c)\nif b == '+':\n print(a+c)\nelse:\n print(a-c)", "passed": true, "time": 0.25, "memory": 14272.0, "status": "done"}, {"code": "# joisino\u304a\u59c9\u3061\u3083\u3093\u306f\u3001A op B \u3068\u3044\u3046\u5f0f\u306e\u5024\u3092\u8a08\u7b97\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002\n# \u3053\u3053\u3067\u3001A, B\u306f\u6574\u6570\u3067\u3001op \u306f\u3001+ \u307e\u305f\u306f - \u306e\u8a18\u53f7\u3067\u3059\u3002\n# \u3042\u306a\u305f\u306e\u4ed5\u4e8b\u306f\u3001joisino\u304a\u59c9\u3061\u3083\u3093\u306e\u4ee3\u308f\u308a\u306b\u3053\u308c\u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u308b\u3053\u3068\u3067\u3059\u3002\n\n# \u5236\u7d04\n# 1 \u2266 A, B \u2266 1000000000\n# op \u306f\u3001+ \u307e\u305f\u306f - \u306e\u8a18\u53f7\u3067\u3042\u308b\u3002\n\n# \u6a19\u6e96\u5165\u529b\u304b\u3089 A op B \u3092\u53d6\u5f97\u3059\u308b\na, op, b = list(map(str,input().split()))\n\ninput_a = int(a)\ninput_b = int(b)\n\n# op\u306b\u5f93\u3044\u3001\u8a08\u7b97\u3057\u3066\u51fa\u529b\u3059\u308b\nresult = 0\nif op == \"+\":\n result = input_a + input_b\nelif op == \"-\":\n result = input_a - input_b\nelse:\n result = \"Error\"\n\nprint(result)\n", "passed": true, "time": 0.22, "memory": 14252.0, "status": "done"}, {"code": "a,op,b = input().split()\n\nprint(int(a)+int(b) if op == '+' else int(a)-int(b))", "passed": true, "time": 0.14, "memory": 14008.0, "status": "done"}, {"code": "a,b,c=map(str,input().split())\na=int(a)\nc=int(c)\nif b==\"+\":\n print(a+c)\nelse:\n print(a-c)", "passed": true, "time": 0.14, "memory": 14388.0, "status": "done"}, {"code": "s=input()\nprint(eval(s))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "a,b,c=list(map(str,input().split()))\na=int(a)\nc=int(c)\nif(b==\"+\"):\n print((a+c))\nelif(b==\"-\"):\n print((a-c))\n", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "a, b, c = map(str, input().split())\n\na = int(a)\nc = int(c)\n\nif b == '+':\n print(a + c)\nelse:\n print(a - c)", "passed": true, "time": 0.21, "memory": 14148.0, "status": "done"}, {"code": "s = input()\nprint(eval(s))", "passed": true, "time": 0.17, "memory": 14180.0, "status": "done"}, {"code": "a, op, b = input().split()\nif op == '+':\n print(int(a) + int(b))\nelse:\n print(int(a) - int(b))", "passed": true, "time": 0.16, "memory": 14076.0, "status": "done"}, {"code": "#50\ndata= list(input().split())\nif data[1]=='+':\n print(int(data[0])+int(data[2]))\nelif data[1]=='-':\n print(int(data[0])-int(data[2]))", "passed": true, "time": 0.26, "memory": 14284.0, "status": "done"}, {"code": "A, op, B = input().split()\nif op == '+':\n print(int(A) + int(B))\nelse:\n print(int(A) - int(B))", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "s, o, t = input().split()\nif o == '+':\n a = int(s) + int(t)\nelse:\n a = int(s) - int(t)\nprint(a) ", "passed": true, "time": 0.16, "memory": 14220.0, "status": "done"}, {"code": "# \u6570\u5024\u3068\u7b26\u53f7\u306e\u53d6\u5f97\nA,op,B = map(str,input().split())\n\n# \u8a08\u7b97\u3057\u3066\u51fa\u529b\ncalc = eval(A + op + B)\nprint(int(calc))", "passed": true, "time": 0.31, "memory": 14184.0, "status": "done"}, {"code": "A, op, B = input().split()\nA = int(A)\nB = int(B)\nprint([A + B, A - B][op == '-'])", "passed": true, "time": 0.23, "memory": 14072.0, "status": "done"}, {"code": "a, op, b = map(str, input().split())\na = int(a)\nb = int(b)\n\nif op == \"+\":\n result = a + b\nelse:\n result = a - b\n\nprint(result)", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "A, op, B = input().split()\nA = int(A)\nB = int(B)\n\nif op == \"+\":\n print(A + B)\nif op == \"-\":\n print(A - B)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "a,x,b = input().split()\nif x == '+':\n print(int(a)+int(b))\nelse:\n print(int(a)-int(b))", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "A, op, B = input().split()\nif op == \"+\":\n print(int(A)+int(B))\nelse:\n print(int(A)-int(B))", "passed": true, "time": 0.18, "memory": 14076.0, "status": "done"}, {"code": "a,b,c=input().split()\nif b==\"+\":\n print(int(a)+int(c))\nelse:\n print(int(a)-int(c))", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "a, op, b = input().split()\na, b = int(a), int(b)\nprint(a+b if op=='+' else a-b)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "def calculate(a, b, op):\n if op == '+':\n return a + b\n else:\n return a - b\n\n\nlst = list(map(str, input().split()))\nprint(calculate(int(lst[0]), int(lst[2]), lst[1]))", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "A,op,B = map(str,input().split())\n\nA = int(A)\nB = int(B)\n\nif op == '+':\n print(A + B)\n\nelif op == '-':\n print(A - B)", "passed": true, "time": 0.15, "memory": 14048.0, "status": "done"}, {"code": "L = list(map(str, input().split()))\n\nif L[1] == '+':\n print((int(L[0]) + int(L[2])))\nelse:\n print((int(L[0]) - int(L[2])))\n", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "def iroha():\n a, op, b = list(map(str, input().split()))\n a = int(a)\n b = int(b)\n\n if op == \"+\":\n result = a + b\n else:\n result = a - b\n\n print(result)\n\n\n\n\ndef __starting_point():\n iroha()\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "a,b,c = input().split()\nprint(int(a)+int(c) if b == \"+\" else int(a) - int(c))", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "#!/usr/bin/env python3\na,op,b=input().split()\nif op==\"+\":\n print(int(a)+int(b))\nelse:\n print(int(a)-int(b))", "passed": true, "time": 0.15, "memory": 14280.0, "status": "done"}, {"code": "A,c,B=input().split()\nA=int(A)\nB=int(B)\nif c==\"+\":\n print((A+B))\nelif c==\"-\":\n print((A-B))\n \n", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "a, op, b = list(map(str, input().split()))\nif op == '+':\n print((int(a) + int(b)))\nelse:\n print((int(a) - int(b)))\n", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "A, op, B = list(map(str, input().split()))\n\nif op == '+':\n print(int(A) + int(B))\nelse:\n print(int(A) - int(B))", "passed": true, "time": 0.16, "memory": 14072.0, "status": "done"}, {"code": "'''\nABC050 A - Addition and Subtraction Easy\nhttps://atcoder.jp/contests/abc050/tasks/abc050_a\n'''\ndef main():\n a, op, b = input().split()\n a, b = int(a), int(b)\n\n if op == '+':\n ans = a+b\n elif op == '-':\n ans = a-b\n print(ans)\n\n\nmain()\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a = list(input().split())\na[0] = int(a[0])\na[2] = int(a[2])\nif a[1] == \"+\":\n print((a[0]+a[2]))\nelse:\n print((a[0]-a[2]))\n", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "a, op, b = list(map(str, input().split()))\na = int(a)\nb = int(b)\n\nif op == '+':\n print((a + b))\nelif op == '-':\n print((a - b))\n", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "# \u5165\u529b\nA, op, B = map(str,input().split())\n\n# \u51e6\u7406\nA = int(A)\nB = int(B)\nif op == '+':\n print(A + B)\nelse:\n print(A - B)", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "A,op,B=input().split()\nif op=='+':\n print((int(A)+int(B)))\nelse:\n print((int(A)-int(B)))\n", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "a, b, c = input().split()\na = int(a)\nc = int(c)\nif b == '+':\n print(a + c)\nelse:\n print(a - c)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "'''\nABC050 A - Addition and Subtraction Easy\nhttps://atcoder.jp/contests/abc050/tasks/abc050_a\n'''\ndef main():\n a, op, b = input().split()\n a, b = int(a), int(b)\n\n if op == '+':\n ans = a+b\n elif op == '-':\n ans = a-b\n print(ans)\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "S_list = list(input().split())\n\nif S_list[1] == \"+\" :\n result = int(S_list[0]) + int(S_list[2])\nelse :\n result = int(S_list[0]) - int(S_list[2])\nprint(result)\n", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "A,op,B = input().split()\nA = int(A)\nB = int(B)\nif op == '+':\n print(A+B)\nelse:\n print(A-B)", "passed": true, "time": 0.14, "memory": 14356.0, "status": "done"}, {"code": "a,b,c = input().split()\nif b == \"+\":\n print(int(a) + int(c))\nelse:\n print(int(a) - int(c))", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "a, op, b = input().split()\nif op == \"+\":\n print((int(a) + int(b)))\nelse:\n print((int(a) - int(b)))\n", "passed": true, "time": 0.25, "memory": 14064.0, "status": "done"}, {"code": "# A - Addition and Subtraction Easy\n# https://atcoder.jp/contests/abc050/tasks/abc050_a\n\na, op, b = list(map(str, input().split()))\n\nresult = eval(a + op + b)\n\nprint((int(result)))\n", "passed": true, "time": 0.25, "memory": 14100.0, "status": "done"}, {"code": "a,x,b = map(str,input().split())\nif x == \"+\":\n print(int(a)+int(b))\nelse:\n print(int(a)-int(b))", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a = input().split()\n\n\nif a[1] == \"+\":\n print((int(a[0])+int(a[2])))\n\nelse:\n print((int(a[0])-int(a[2])))\n", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "a,b,c = input().split()\n\na = int(a)\nc = int(c)\n\nif b == \"+\":\n print(int(a)+c)\nelse:\n print(a-c)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "A, op, B = input().split()\nA = int(A)\nB = int(B)\n\nif op == '+':\n print(A + B)\nelse:\n print(A - B)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "s = input()\na, op, b = s.split()\na = int(a)\nb = int(b)\nif op == \"+\":\n c = a + b\nelse:\n c = a - b\n \nprint(c)", "passed": true, "time": 0.24, "memory": 14240.0, "status": "done"}, {"code": "a,op,b = input().split()\n\nprint(int(a) + int(b) if op == '+' else int(a) - int(b))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "a, op, b = map(str, input().split())\n\nif op == '+':\n print(int(a) + int(b))\nelif op == '-':\n print(int(a) - int(b))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "# \u5165\u529b\nA, op, B = input().split()\nA, B = int(A), int(B)\n\n# \u51e6\u7406\nif op == '+':\n S = A + B\nelse:\n S = A - B\n# \u51fa\u529b\nprint(S)", "passed": true, "time": 0.24, "memory": 14296.0, "status": "done"}, {"code": "print(eval(\"\".join(list(input().split()))))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a,b,c=map(str,input().split())\na=int(a)\nc=int(c)\nif b=='+':print(a+c)\nelse:print(a-c)", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "# \u5165\u529b\nA, op, B = input().split()\n\nA = int(A)\nB = int(B)\n\n# \u51fa\u529b\nif op == '+':\n print((A + B))\nelif op == '-':\n print((A - B))\n\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "'''\nABC050 A - Addition and Subtraction Easy\nhttps://atcoder.jp/contests/abc050/tasks/abc050_a\n'''\na, op, b = input().split()\na, b = int(a), int(b)\n\nif op == '+':\n ans = a+b\nelif op == '-':\n ans = a-b\nprint(ans)\n", "passed": true, "time": 0.22, "memory": 14184.0, "status": "done"}, {"code": "# A - Addition and Subtraction Easy\n\n# A, op, B \u306e\u5165\u529b\u3092\u53d7\u3051\u53d6\u308a\u3001\u6f14\u7b97\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\n\n\nA, op, B = input().split()\n\nif op == '+':\n print((int(A) + int(B)))\nelif op == '-':\n print((int(A) - int(B)))\n", "passed": true, "time": 0.2, "memory": 14076.0, "status": "done"}, {"code": "A, op, B = input().split()\n\nif op == \"+\":\n print(int(A)+int(B))\nelse:\n print(int(A)-int(B))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "A,op,B = input().split()\nA,B = int(A),int(B)\nprint(A + B if op == \"+\" else A - B)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "s = input()\nprint(eval(s))", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "A,op,B = map(str,input().split())\nA = int(A)\nB = int(B)\nif op == '+':\n print(A + B)\nelif op == '-':\n print(A - B)", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "a,b,c = input().split()\nif b == \"+\":\n print(int(a)+int(c))\nelse:\n print(int(a)-int(c))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}]
[{"input": "1 + 2\n", "output": "3\n"}, {"input": "5 - 7\n", "output": "-2\n"}]
4,710
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) otherwise. You are given Smeke's current rating, x. Print ABC if Smeke will participate in ABC, and print ARC otherwise. -----Constraints----- - 1 ≦ x ≦ 3{,}000 - x is an integer. -----Input----- The input is given from Standard Input in the following format: x -----Output----- Print the answer. -----Sample Input----- 1000 -----Sample Output----- ABC Smeke's current rating is less than 1200, thus the output should be ABC.
introductory
[{"code": "x = int(input())\n\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.15, "memory": 13992.0, "status": "done"}, {"code": "print('ABC' if int(input())<1200 else 'ARC')", "passed": true, "time": 0.15, "memory": 14032.0, "status": "done"}, {"code": "x = int(input())\nif x<1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 1.04, "memory": 13984.0, "status": "done"}, {"code": "x = int(input())\n\nif x < 1200 :\n print( \"ABC\" )\nelse:\n print( \"ARC\" )", "passed": true, "time": 0.37, "memory": 13932.0, "status": "done"}, {"code": "print(\"ABC\" if int(input()) < 1200 else \"ARC\")", "passed": true, "time": 0.23, "memory": 14268.0, "status": "done"}, {"code": "x = int(input())\n\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.16, "memory": 14028.0, "status": "done"}, {"code": "a = int(input())\n\nprint('ABC') if a < 1200 else print('ARC')", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "r = int(input())\n\nprint('ABC' if r < 1200 else 'ARC')", "passed": true, "time": 0.25, "memory": 14172.0, "status": "done"}, {"code": "#\n# abc053 a\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"1000\"\"\"\n output = \"\"\"ABC\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"2000\"\"\"\n output = \"\"\"ARC\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n x = int(input())\n\n if x < 1200:\n print(\"ABC\")\n else:\n print(\"ARC\")\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14620.0, "status": "done"}, {"code": "a = int(input())\nif a < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "if int(input()) < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "x=int(input())\nif x<1200:print('ABC')\nelse:print('ARC')", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "# A - ABC/ARC\ndef main():\n x = int(input())\n\n if x < 1200:\n print('ABC')\n else:\n print('ARC')\n \n \ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.83, "memory": 14116.0, "status": "done"}, {"code": "# \u3059\u3081\u3051\u304f\u3093\u306f\u73fe\u5728\u306e\u30ec\u30fc\u30c8\u304c 1200 \u672a\u6e80\u306a\u3089\u3070 AtCoder Beginner Contest (ABC) \u306b\u3001\n# \u305d\u3046\u3067\u306a\u3051\u308c\u3070 AtCoder Regular Contest (ARC) \u306b\u53c2\u52a0\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002 \u3059\u3081\u3051\u304f\u3093\u306e\u73fe\u5728\u306e\u30ec\u30fc\u30c8 x \u304c\u4e0e\u3048\u3089\u308c\u307e\u3059\u3002\n# \u3059\u3081\u3051\u304f\u3093\u304c\u53c2\u52a0\u3059\u308b\u30b3\u30f3\u30c6\u30b9\u30c8\u304c ABC \u306a\u3089\u3070 ABC \u3068\u3001\u305d\u3046\u3067\u306a\u3051\u308c\u3070 ARC \u3068\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\nx = int(input())\n\nif x < 1200:\n print('ABC')\n\nelse:\n print('ARC')", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "x = int(input())\n\nprint('ABC' if x < 1200 else 'ARC')", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "S =int(input())\n\nif S < 1200 :\n result = \"ABC\"\nelse:\n result = \"ARC\"\nprint(result)", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "print('ABC' if int(input()) < 1200 else 'ARC')", "passed": true, "time": 0.15, "memory": 14204.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.14, "memory": 13992.0, "status": "done"}, {"code": "x=int(input())\nprint(\"ABC\" if x<1200 else \"ARC\")", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "x = int(input())\nprint(\"ABC\" if x < 1200 else \"ARC\")", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.14, "memory": 14016.0, "status": "done"}, {"code": "print(\"ABC\" if int(input())<1200 else \"ARC\")", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "x = int(input())\n\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')\n", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "r=[\"ABC\",\"ARC\"]\nprint(r[int(input())>=1200])", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "x = int(input())\n\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "if int(input())>=1200:\n print('ARC')\n \nelse:\n print('ABC')", "passed": true, "time": 0.22, "memory": 14188.0, "status": "done"}, {"code": "x=int(input())\nif x<1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 13976.0, "status": "done"}, {"code": "x = int(input())\n\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 13996.0, "status": "done"}, {"code": "x=int(input())\nif x<1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "r = int(input())\nprint('ARC') if r >= 1200 else print('ABC')", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "# \u5165\u529b\nx = int(input())\n\n# \u51e6\u7406\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.43, "memory": 14016.0, "status": "done"}, {"code": "x = int(input())\nif x<1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.44, "memory": 13960.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "# 053_a\nx = int(input())\nif (1 <= x & x <= 3000):\n if x < 1200:\n print('ABC')\n else:\n print('ARC')\n", "passed": true, "time": 0.24, "memory": 14220.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.24, "memory": 14080.0, "status": "done"}, {"code": "# A - ABC/ARC\n\n# x=1200\u672a\u6e80\u306a\u3089\u3070'ABC'\u3092\u3001\u305d\u3046\u3067\u306a\u3051\u308c\u3070'ARC'\u3092\u51fa\u529b\u3059\u308b\n\n\nx = int(input())\n\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')\n", "passed": true, "time": 0.25, "memory": 13960.0, "status": "done"}, {"code": "if int(input()) < 1200:\n print('ABC')\nelse:\n print('ARC')\n", "passed": true, "time": 0.22, "memory": 14076.0, "status": "done"}, {"code": "x = int (input ())\nif x>=1200:\n print ('ARC')\nelse:\n print ('ABC')", "passed": true, "time": 0.15, "memory": 13976.0, "status": "done"}, {"code": "if int(input()) < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.16, "memory": 14052.0, "status": "done"}, {"code": "x = int(input())\n\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.17, "memory": 13964.0, "status": "done"}, {"code": "rate = int(input())\nif rate < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "a=int(input())\nif a<1200:print(\"ABC\")\nelse:print(\"ARC\")", "passed": true, "time": 0.15, "memory": 14020.0, "status": "done"}, {"code": "print(\"ABC\" if int(input())<1200 else \"ARC\")", "passed": true, "time": 0.15, "memory": 14276.0, "status": "done"}, {"code": "x = int(input())\n\nif x >= 1200:\n print(\"ARC\")\nelse:\n print(\"ABC\")", "passed": true, "time": 0.16, "memory": 13996.0, "status": "done"}, {"code": "x=int(input())\nif x<1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 13956.0, "status": "done"}, {"code": "if int(input())<1200:\n\tprint('ABC')\nelse:\n\tprint(\"ARC\")", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "a=int(input())\nif(a<1200):\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "x=int(input())\n\nif x>=1200:\n ans=\"ARC\"\nelse:\n ans=\"ABC\"\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "print(\"ABC\" if int(input()) < 1200 else \"ARC\")", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "x = int(input())\n\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')\n", "passed": true, "time": 0.14, "memory": 14020.0, "status": "done"}, {"code": "x = int(input())\n\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "print('ABC' if int(input()) < 1200 else 'ARC')", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "num = int(input())\nif num < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "# \u30ec\u30fc\u30c8\u3092\u53d6\u5f97\nx = int(input())\n\n# \u30ec\u30fc\u30c8\u306b\u6cbf\u3063\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 13976.0, "status": "done"}, {"code": "x = int(input())\n\nif 1200 > x:\n print(\"ABC\")\nelse:\n print(\"ARC\")\n", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "# \u5165\u529b\nx = int(input())\n\n# \u51e6\u7406\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.17, "memory": 14080.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "x=int(input())\n\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "# 053a\n\nx = int(input()) # \u30ec\u30fc\u30c8x\u3092\u4ee3\u5165\n\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')\n", "passed": true, "time": 0.21, "memory": 14120.0, "status": "done"}, {"code": "X = int(input())\n\nif X < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.29, "memory": 14132.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "x = int(input())\n\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.16, "memory": 14180.0, "status": "done"}, {"code": "# A - ABC/ARC\n# https://atcoder.jp/contests/abc053/tasks/abc053_a\n\nx = int(input())\n\nresult = 'ARC'\nif x < 1200:\n result = 'ABC'\n\nprint(result)\n", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "#53\nx=int(input())\nif x<1200:\n print('ABC')\nelse:\n print('ARC')\n", "passed": true, "time": 0.27, "memory": 13988.0, "status": "done"}, {"code": "X= int(input())\nif X<1200:\n print(\"ABC\")\nelse :\n print(\"ARC\")", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "a = int(input())\nif a < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.15, "memory": 14000.0, "status": "done"}, {"code": "print(\"ABC\" if int(input())<1200 else \"ARC\")", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "x=int(input())\nif x>=1200:\n print(\"ARC\")\nelse:\n print(\"ABC\")", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "if int(input())//1200:\n print(\"ARC\")\nelse:\n print(\"ABC\")\n", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "x = int(input())\nif(x >= 1200):\n print(\"ARC\")\nelse:\n print(\"ABC\")", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "x = int(input())\nprint('ARC' if x >= 1200 else 'ABC')", "passed": true, "time": 0.24, "memory": 13936.0, "status": "done"}, {"code": "x = int(input())\nprint('ABC' if x < 1200 else 'ARC')", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "print((\"ABC\" if int(input()) < 1200 else \"ARC\"))\n", "passed": true, "time": 0.17, "memory": 14156.0, "status": "done"}, {"code": "x = int(input())\nprint(\"ABC\" if x < 1200 else \"ARC\")", "passed": true, "time": 0.24, "memory": 13948.0, "status": "done"}, {"code": "def solve():\n x = int(input())\n if x < 1200:\n print('ABC')\n else:\n print('ARC')\n\n\ndef __starting_point():\n solve()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "# \u5165\u529b\nx = int(input())\n\n# x\u304c1200\u672a\u6e80\u306a\u3089ABC\u3001\u305d\u3046\u3067\u306a\u3051\u308c\u3070ARC\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.14, "memory": 14020.0, "status": "done"}, {"code": "x = int(input())\n\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")\n", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "#\u5165\u529b\nx = int(input())\n\n# \u51fa\u529b\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.22, "memory": 14152.0, "status": "done"}, {"code": "# \u30ec\u30fc\u30c8\u306b\u3088\u3063\u3066\u51fa\u529b\u3092\u5909\u66f4\n\nx = int(input())\n\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')", "passed": true, "time": 0.23, "memory": 14136.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")\n", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "# \u3059\u3081\u3051\u304f\u3093\u306f\n# \u73fe\u5728\u306e\u30ec\u30fc\u30c8\u304c 1200\u672a\u6e80\u306a\u3089\u3070 AtCoder Beginner Contest (ABC) \u306b\u3001\n# \u305d\u3046\u3067\u306a\u3051\u308c\u3070 AtCoder Regular Contest (ARC) \u306b\u53c2\u52a0\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\n# \u3059\u3081\u3051\u304f\u3093\u306e\u73fe\u5728\u306e\u30ec\u30fc\u30c8 x\u304c\u4e0e\u3048\u3089\u308c\u307e\u3059\u3002\n# \u3059\u3081\u3051\u304f\u3093\u304c\u53c2\u52a0\u3059\u308b\u30b3\u30f3\u30c6\u30b9\u30c8\u304c ABC \u306a\u3089\u3070 ABC \u3068\u3001\u305d\u3046\u3067\u306a\u3051\u308c\u3070 ARC \u3068\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\n# \u5236\u7d04\n# 1 \u2266 x \u2266 3,000\n# x \u306f\u6574\u6570\n\n# \u6a19\u6e96\u5165\u529b\u304b\u3089 x \u3092\u53d6\u5f97\u3059\u308b\nx = int(input())\n\n# \u30ec\u30fc\u30c8\u3092\u5224\u5b9a\u3057\u3066\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\nresult = \"ret\"\n\nif x < 1200:\n result = \"ABC\"\nelse:\n result = \"ARC\"\n\nprint(result)\n", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print('ABC')\nelse:\n print('ARC')\n", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "print('ABC' if int(input()) < 1200 else 'ARC')", "passed": true, "time": 0.16, "memory": 14164.0, "status": "done"}, {"code": "# AtCoder abc053 a\n# \u30b9\u30c8\u30ec\u30c3\u30c1\u8ab2\u984c\n\n# \u5165\u529b\nx = int(input())\n\n# \u5224\u5b9a\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")\n", "passed": true, "time": 0.19, "memory": 14136.0, "status": "done"}, {"code": "x = int(input())\nprint(['ABC','ARC'][1200<=x])", "passed": true, "time": 0.23, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\n\nif (n < 1200):\n print(\"ABC\")\nelse:\n print(\"ARC\")\n\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "print('ABC' if int(input()) < 1200 else 'ARC')", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "s = int(input())\n\nif s < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "print('AARBCC'[int(input())<1200::2])", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "x = int(input())\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "print('ABC' if int(input()) < 1200 else 'ARC')", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "x = input()\nx = int(x)\nif x < 1200:\n print('ABC')\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "x = int(input())\nprint('ABC' if x < 1200 else 'ARC')", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "x = int(input())\n\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "x = input()\nx = int(x)\n\nif x < 1200:\n print(\"ABC\")\nelse:\n print(\"ARC\")", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "def main():\n x = int(input())\n print('ARC') if x >= 1200 else print('ABC')\n \n \ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}]
[{"input": "1000\n", "output": "ABC\n"}, {"input": "2000\n", "output": "ARC\n"}]
4,711
Snuke is buying a bicycle. The bicycle of his choice does not come with a bell, so he has to buy one separately. He has very high awareness of safety, and decides to buy two bells, one for each hand. The store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively. Find the minimum total price of two different bells. -----Constraints----- - 1 \leq a,b,c \leq 10000 - a, b and c are integers. -----Input----- Input is given from Standard Input in the following format: a b c -----Output----- Print the minimum total price of two different bells. -----Sample Input----- 700 600 780 -----Sample Output----- 1300 - Buying a 700-yen bell and a 600-yen bell costs 1300 yen. - Buying a 700-yen bell and a 780-yen bell costs 1480 yen. - Buying a 600-yen bell and a 780-yen bell costs 1380 yen. The minimum among these is 1300 yen.
introductory
[{"code": "# A - ringring\n# https://atcoder.jp/contests/abc066/tasks/abc066_a\n\na = list(map(int, input().split()))\n\na.sort()\nprint((a[0] + a[1]))\n", "passed": true, "time": 0.92, "memory": 14240.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\n\nprint(min(a+b, b+c, c+a))", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "# A - ringring\ndef main():\n abc = list(map(int, input().split()))\n abc.sort()\n cnt = 0\n\n for _ in range(2):\n cnt += abc.pop(0)\n else:\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()", "passed": true, "time": 0.23, "memory": 14272.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\n\n\nl.sort()\n\nprint(l[0] + l[1])", "passed": true, "time": 1.56, "memory": 14240.0, "status": "done"}, {"code": "a,b,c = sorted(map(int,input().split()))\nprint(a+b)", "passed": true, "time": 0.23, "memory": 14208.0, "status": "done"}, {"code": "data = list(map(int,input().split()))\ndata.sort()\nprint(data[0]+data[1])", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "a,b,c = list(map(int,input().split()))\n\nprint((min(a+b,a+c,b+c)))\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\n\nprint(min(a + b, b + c, c + a))", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "a,b,c=(int(x) for x in input().split())\n\nX=[a,b,c]\nX.sort()\n\nY=X[0]+X[1]\n\nprint(Y)", "passed": true, "time": 0.18, "memory": 14192.0, "status": "done"}, {"code": "# 066a\n\ndef atc_066a(abc: str) -> int:\n abc_int = [int(ai) for ai in abc.split(\" \")]\n abc_int.sort()\n return abc_int[0] + abc_int[1]\n\nabc = input()\nprint(atc_066a(abc))", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "\na,b,c=list(map(int,input().split()))\n\nprint((min(a+b,b+c,a+c)))\n\n", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "'''\n\u554f\u984c\uff1a\n snuke \u541b\u306f\u81ea\u8ee2\u8eca\u3092\u8cb7\u3044\u306b\u6765\u307e\u3057\u305f\u3002\n snuke \u541b\u306f\u3059\u3067\u306b\u8cb7\u3046\u81ea\u8ee2\u8eca\u3092\u6c7a\u3081\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u81ea\u8ee2\u8eca\u306b\u306f\u30d9\u30eb\u304c\u4ed8\u3044\u3066\u3044\u306a\u3044\u305f\u3081\u3001 \u81ea\u8ee2\u8eca\u3068\u306f\u5225\u306b\u30d9\u30eb\u3082\u8cb7\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\n snuke \u541b\u306f\u5b89\u5168\u610f\u8b58\u304c\u9ad8\u3044\u306e\u3067\u3001\u30d9\u30eb\u3092\u3069\u3061\u3089\u306e\u624b\u3067\u3082\u9cf4\u3089\u305b\u308b\u3088\u3046\u3001\n \u4e21\u65b9\u306e\u30cf\u30f3\u30c9\u30eb\u306b 1 \u3064\u305a\u3064 \u4ed8\u3051\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\n\n \u304a\u5e97\u306b\u3042\u308b\u30d9\u30eb\u306f 3 \u7a2e\u985e\u3067\u3001\u305d\u308c\u305e\u308c a\u5186\u3001b\u5186\u3001c\u5186\u3067\u3059\u3002\n \u3053\u306e 3\u3064\u306e\u3046\u3061\u3001\u7570\u306a\u308b 2\u3064\u306e\u30d9\u30eb\u3092\u9078\u3093\u3067\u8cb7\u3046\u3068\u304d\u306e\u3001\u5024\u6bb5\u306e\u5408\u8a08\u306e\u6700\u5c0f\u5024\u3092\u6c42\u3081\u3066\u4e0b\u3055\u3044\u3002\n'''\n\n'''\n\u5236\u7d04\uff1a\n 1 \u2264 a,b,c \u2264 10000\n a,b,c\u306f\u6574\u6570\n'''\n\n# \u6a19\u6e96\u5165\u529b\u304b\u3089 a, b, c \u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\na, b, c = list(map(int, input().split()))\n\nresult = [a + b, b + c, a + c] # \u7d50\u679c\u51fa\u529b\u7528\u30ea\u30b9\u30c8\n\nprint((min(result)))\n", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "bell=[a, b, c]=list(map(int, input().split(\" \")))\ncandidate=sorted(bell)\nprint(candidate[0]+candidate[1])", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "cost = list(map(int, input().split()))\nprint(sum(sorted(cost)[:2]))", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "a, b, c = list(map(int,input().split()))\n\nbell_price = [a, b, c]\n\nprint((sum(bell_price) - max(bell_price)))\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "li=a,b,c=list(map(int,input().split()))\nprint(sorted(li)[0]+sorted(li)[1])", "passed": true, "time": 0.19, "memory": 14264.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\n# \u30d9\u30eb\u306e\u4fa1\u683c\u3092\u30ea\u30b9\u30c8\u5316\nbell_price = (a,b,c)\n# \u30ea\u30b9\u30c8\u306e\u5408\u8a08\u5024\u304b\u3089\u6700\u9ad8\u5024\u306e\u30d9\u30eb\u306e\u5024\u6bb5\u3092\u9664\u5916\nprint(sum(bell_price)-max(bell_price))", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "a, b, c, = list(map(int, input().split()))\n\nring=[]\nring.append(a)\nring.append(b)\nring.append(c)\n\nring.sort()\nprint((ring[0] + ring[1]))\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "lst = input().split()\n\nfor i in range(3):\n lst[i] = int(lst[i])\n\nlst.sort()\nprint(lst[0] + lst[1])", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\n\nprint(a+b+c-max(a,b,c))", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "# 066a\n\ndef atc_066a(abc: str) -> int:\n abc_int = [int(ai) for ai in abc.split(\" \")]\n abc_int.sort()\n return abc_int[0] + abc_int[1]\n\nabc = input()\nprint((atc_066a(abc)))\n", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "a=list(map(int,input().split()))\na.sort()\nprint(sum(a[:2]))", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "a, b, c = map(int,input().split())\n\nbell_list = []\nbell_list.append(a + b)\nbell_list.append(b + c)\nbell_list.append(a + c)\n\nprint(min(bell_list))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nbell = [a + b, a + c, b + c]\nprint(min(bell))", "passed": true, "time": 0.15, "memory": 14192.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nmin_price = min(a + b, b + c, a + c)\nprint(min_price)", "passed": true, "time": 0.23, "memory": 14316.0, "status": "done"}, {"code": "a=list(map(int,input().split()))\nprint((sum(a)-max(a)))\n", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "a, b, c = map(int,input().split())\n\nprint(min(a + b, b + c, c + a))", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "bell=[a, b, c]=list(map(int, input().split(\" \")))\n\nprint(sorted(bell).pop(0)\\\n +sorted(bell).pop(1))", "passed": true, "time": 0.23, "memory": 14104.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nprint(min(a + b, b + c, a + c))", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nprint(min(a+b,a+c,b+c))", "passed": true, "time": 0.15, "memory": 14224.0, "status": "done"}, {"code": "l = sorted(list(map(int, input().split())))\nprint(sum(l[:2]))", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nx=[a,b,c]\nprint(sum(x)-max(x))", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "print(sum(sorted(map(int, input().split()))[:2]))", "passed": true, "time": 0.27, "memory": 14048.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\ns=[]\ns.append(a+b)\ns.append(a+c)\ns.append(b+c)\n\n\nprint(min(s))", "passed": true, "time": 0.28, "memory": 14120.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nx=min(a,b,c)\nz=max(a,b,c)\ny=a+b+c-x-z\nprint(x+y)", "passed": true, "time": 0.31, "memory": 14284.0, "status": "done"}, {"code": "A = list(map(int, input().split()))\n\nprint(sum(sorted(A)[:2]))", "passed": true, "time": 0.24, "memory": 14164.0, "status": "done"}, {"code": "a,b,c = list(map(int,input().split()))\n\nprice = min(a + b,b + c,a + c)\nprint(price)\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "\n\na, b, c = map(int, input().split())\n\n\n\nprint(min(a+b, b+c, a+c))", "passed": true, "time": 0.23, "memory": 14216.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\n\nprint(min(a+b,a+c,b+c))", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\n\ndef answer(a: int, b: int, c: int) -> int:\n return min(a + b, a + c, b + c)\n\nprint(answer(a, b, c))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\n\nprint(min(a+b,a+c,b+c))", "passed": true, "time": 0.27, "memory": 14300.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nprint(min(a + b, a + c, c + b))", "passed": true, "time": 0.24, "memory": 14172.0, "status": "done"}, {"code": "S_list = list(map(int,input().split()))\nsum_bell=sum(S_list)\nhantei = list()\nfor i in S_list:\n hantei.append(sum_bell - i)\nprint(min(hantei))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "kingaku = list(map(int, input().split()))\nkingaku.sort()\n\nprint((kingaku[0] + kingaku[1]))\n\n", "passed": true, "time": 0.21, "memory": 14084.0, "status": "done"}, {"code": "a, b, c = map(int,input().split())\n\nmax_bell = max(a,b,c)\nprint(a + b + c - max_bell)", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "# snuke \u541b\u306f\u81ea\u8ee2\u8eca\u3092\u8cb7\u3044\u306b\u6765\u307e\u3057\u305f\u3002 snuke \u541b\u306f\u3059\u3067\u306b\u8cb7\u3046\u81ea\u8ee2\u8eca\u3092\u6c7a\u3081\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u81ea\u8ee2\u8eca\u306b\u306f\u30d9\u30eb\u304c\u4ed8\u3044\u3066\u3044\u306a\u3044\u305f\u3081\u3001\n# \u81ea\u8ee2\u8eca\u3068\u306f\u5225\u306b\u30d9\u30eb\u3082\u8cb7\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 snuke \u541b\u306f\u5b89\u5168\u610f\u8b58\u304c\u9ad8\u3044\u306e\u3067\u3001\u30d9\u30eb\u3092\u3069\u3061\u3089\u306e\u624b\u3067\u3082\u9cf4\u3089\u305b\u308b\u3088\u3046\u3001\u4e21\u65b9\u306e\u30cf\u30f3\u30c9\u30eb\u306b 1 \u3064\u305a\u3064 \u4ed8\u3051\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\n# \u304a\u5e97\u306b\u3042\u308b\u30d9\u30eb\u306f 3 \u7a2e\u985e\u3067\u3001\u305d\u308c\u305e\u308c a \u5186\u3001 b \u5186\u3001 c \u5186\u3067\u3059\u3002 \u3053\u306e 3 \u3064\u306e\u3046\u3061\u3001\u7570\u306a\u308b 2 \u3064\u306e\u30d9\u30eb\u3092\u9078\u3093\u3067\u8cb7\u3046\u3068\u304d\u306e\u3001\u5024\u6bb5\u306e\u5408\u8a08\u306e\u6700\u5c0f\u5024\u3092\u6c42\u3081\u3066\u4e0b\u3055\u3044\u3002\n\na,b,c = map(int,input().split())\n\nif a >= b and a >= c :\n print(b + c)\nelif b >= a and b >= c:\n print(a + c)\nelif c >= a and c >= b:\n print(a + b)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\n\nplan1 = a + b\nplan2 = b + c\nplan3 = c + a\n\nprint(min(plan1, plan2, plan3))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "l=sorted(map(int,input().split()))\nprint(l[0]+l[1])", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "\n# 066a\n\ndef atc_066a(abc: str) -> int:\n abc_int = [int(ai) for ai in abc.split(\" \")]\n abc_int.sort()\n return abc_int[0] + abc_int[1]\n\nabc = input()\nprint(atc_066a(abc))", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "a, b, c = list(map(int,input().split()))\nbell = [a, b, c]\nbell.sort()\nanswer = bell[0] + bell[1]\nprint(answer)\n", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "# A - ringring\n\n# a b c\na, b, c = list(map(int, input().split()))\nmy_list = [a, b, c]\nmy_list.sort()\nprint((my_list[0] + my_list[1]))\n", "passed": true, "time": 0.14, "memory": 13980.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\ntotal_price = min(a+b, a+c, b+c)\nprint(total_price)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nprint(min(a+b, b+c, a+c))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a, b, c = sorted([int(n) for n in input().split()])\nprint(a + b)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "m=list(map(int,input().split()))\nprint(sum(m)-max(m))", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "def iroha():\n lists = list(map(int, input().split()))\n lists.sort()\n print((lists[0]+lists[1]))\n\n\n\ndef __starting_point():\n iroha()\n\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "n=sorted(list(map(int, input().split())))\nprint((n[0]+n[1]))\n", "passed": true, "time": 0.15, "memory": 14028.0, "status": "done"}, {"code": "D=list(map(int,input().split()))\nD.sort()\nprint(D[0]+D[1])", "passed": true, "time": 0.52, "memory": 14180.0, "status": "done"}, {"code": "#066A\n# 1.\u5024\u3092\u6b63\u3057\u304f\u53d6\u5f97\na, b, c = (int(x) for x in input().split())\n\n# 2.\u6b63\u3057\u304f\u51e6\u7406\ngokei1 = a + b\ngokei2 = a + c\ngokei3 = b + c\n\nresalt=[gokei1,gokei2,gokei3]\n\nprint(min(resalt))", "passed": true, "time": 0.15, "memory": 14076.0, "status": "done"}, {"code": "a, b, c = list(map(int, input().split()))\nprint((min(a + b, a + c, c + b)))\n", "passed": true, "time": 0.25, "memory": 14184.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nx = a + b\ny = b + c\nz = c + a\nif x <= y and x <= z:\n print(x)\nelif y <= x and y <= z:\n print(y)\nelse:\n print(z)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "a = list(map(int,input().split()))\nprint(sum(a)-max(a))", "passed": true, "time": 0.14, "memory": 14000.0, "status": "done"}, {"code": "# \u7570\u306a\u308b\u4e8c\u3064\u306e\u7d44\u307f\u5408\u308f\u305b\u306e\u6700\u5c0f\u5024\u3092\u6c42\u3081\u308b\n\na, b, c = list(map(int, input().split()))\n\nvales = [a + b, a + c, b + c]\n\nprint((min(vales)))\n", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nprint(min(a + b, a + c, b + c))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "bells = sorted(list(map(int, input().split())))\nprint(bells[0]+bells[1])", "passed": true, "time": 0.19, "memory": 14224.0, "status": "done"}, {"code": "p = sorted(map(int, input().split()))\n\nprint(p[0]+p[1])", "passed": true, "time": 0.23, "memory": 14220.0, "status": "done"}, {"code": "bell = sorted(list(map(int, input().split())))\n\nprint((bell[0] + bell[1]))", "passed": true, "time": 0.15, "memory": 14168.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\na.sort()\nprint(a[0] + a[1])", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "A = list(map(int, input().split()))\nA = sorted(A)\nprint((A[0] + A[1]))\n", "passed": true, "time": 0.15, "memory": 14184.0, "status": "done"}, {"code": "'''\nABC066 A - ringring\nhttps://atcoder.jp/contests/abc066/tasks/abc066_a\n'''\nnums = list(map(int, input().split()))\nans = sum(nums) - max(nums)\nprint(ans)\n", "passed": true, "time": 0.22, "memory": 14076.0, "status": "done"}, {"code": "a = list(map(int,input().split()))\nprint(sum(a)-max(a))", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\nprint(sum(a)-max(a))", "passed": true, "time": 0.19, "memory": 14212.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nlist01 = [a + b, b + c, a + c]\nprint(min(list01))", "passed": true, "time": 0.21, "memory": 14092.0, "status": "done"}, {"code": "a=sorted(map(int,input().split(\" \")))\nprint(a[0]+a[1])", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "a, b, c = [int(i) for i in input().split()]\n\nprint((sum([a, b, c]) - max(a, b, c)))\n", "passed": true, "time": 0.15, "memory": 14124.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\n\nA = a + b\nB = b + c\nC = c + a\n\nprint(min(A,B,C))", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "#ABC066\na = sorted(list(map(int,input().split())))\nprint(a[0]+a[1])", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "a = list(map(int,input().split()))\na = sorted(a)\nprint((a[0]+a[1]))\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\n\nans = sum(l) - max(l)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a,b,c = sorted(map(int, input().split()))\n\nprint(a + b)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nprint(a+b+c-max(a,b,c))", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\n\nprices = [a + b, a + c, b + c]\n\nprint(min(prices))", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "a = list(map(int,input().split()))\na.sort()\n\nprint(a[0]+a[1])", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "a = [int(x) for x in input().split()]\nprint(sum(a) - max(a))", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nprint(min(a + b, b + c, a + c))", "passed": true, "time": 0.23, "memory": 14312.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nprint(min(a+b,b+c,a+c))", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "a = list(map(int,input().split()))\nprint(sum(a)-max(a))", "passed": true, "time": 0.88, "memory": 14140.0, "status": "done"}, {"code": "a,b,c=map(int, input().split())\n\nprint(min(a+b,b+c,c+a))", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "a, b, c=map(int, input().split())\nprint(a+b+c-max(a, b, c))", "passed": true, "time": 0.88, "memory": 14228.0, "status": "done"}, {"code": "price = list(map(int, input().split()))\nprice.sort()\n\nprint((price[0]+price[1]))\n", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "a,b,c = map(int, input().split())\n\nkei = a + b + c\n\nif a >= b and a >= c:\n kei -= a\n print(kei)\n\nelif b >= a and b >= c:\n kei -= b\n print(kei)\nelse:\n kei -= c\n print(kei)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "abc = list(map(int, input().split()))\nabc.sort()\nprint((abc[0] + abc[1]))\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\n\nsums = [a + b, b + c, c + a]\n\nprint(min(sums))", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "# \u6570\u5024\u306e\u53d6\u5f97\np_list = list(map(int,input().split()))\n\n# \u5024\u6bb5\u306e\u5b89\u30442\u3064\u3092\u52a0\u7b97\u3057\u51fa\u529b\np_list = sorted(p_list)\npare = p_list[0] + p_list[1]\nprint(pare)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "bell_cost = list(map(int, input().split()))\nbell_cost.sort()\nminimum_cost = bell_cost[0] + bell_cost[1]\nprint(minimum_cost)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}]
[{"input": "700 600 780\n", "output": "1300\n"}, {"input": "10000 10000 10000\n", "output": "20000\n"}]
4,712
You are given a image with a height of H pixels and a width of W pixels. Each pixel is represented by a lowercase English letter. The pixel at the i-th row from the top and j-th column from the left is a_{ij}. Put a box around this image and output the result. The box should consist of # and have a thickness of 1. -----Constraints----- - 1 ≤ H, W ≤ 100 - a_{ij} is a lowercase English letter. -----Input----- Input is given from Standard Input in the following format: H W a_{11} ... a_{1W} : a_{H1} ... a_{HW} -----Output----- Print the image surrounded by a box that consists of # and has a thickness of 1. -----Sample Input----- 2 3 abc arc -----Sample Output----- ##### #abc# #arc# #####
introductory
[{"code": "H, W = map(int, input().split())\ns = '#' * (W + 2)\ndata = []\ndata.append(s)\nfor i in range(H):\n data.append('#' + str(input()) + '#')\ndata.append(s)\n \nfor i in range(H + 2):\n print(data[i])", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "h, w = map(int, input().split())\na = [input() for _ in range(h)]\nfor i in range(h+2):\n if i == 0 or i == h+1:\n print(\"#\"*(w+2))\n else:\n print(\"#\" + a[i-1] + \"#\")", "passed": true, "time": 0.23, "memory": 14088.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools\ndef main():\n H, W = list(map(int, input().split()))\n print((\"#\"*(W+2)))\n for _ in range(H):\n print((\"#{}#\".format(input())))\n print((\"#\"*(W+2)))\n\ndef test():\n import doctest\n doctest.testmod()\n\ndef __starting_point():\n #test()\n main()\n\n__starting_point()", "passed": true, "time": 0.21, "memory": 14084.0, "status": "done"}, {"code": "h, w = map(int, input().split())\nfor i in range(h+1):\n if i == 0 or i == h:\n print(\"#\"*(w +2))\n if i == h:\n return\n print(\"#\", end = \"\")\n print(input(), end = \"\")\n print(\"#\")\n", "passed": true, "time": 0.16, "memory": 14104.0, "status": "done"}, {"code": "h,w = map(int,input().split())\nl=[]\n[l.append(input()) for _ in range(h)]\n\nprint(\"#\"*(w + 2))\nfor s in l:\n print(\"#\",s,\"#\",sep='')\n\nprint(\"#\"*(w + 2))", "passed": true, "time": 0.17, "memory": 14268.0, "status": "done"}, {"code": "h, w = map(int, input().split())\nprint('#'*-~-~w)\nfor _ in [0]*h:\n print('#'+input()+'#')\nprint('#'*-~-~w)", "passed": true, "time": 0.21, "memory": 14080.0, "status": "done"}, {"code": "h, w = list(map(int, input().split()))\n\nprint(('#' * (w+2)))\nfor i in range(h):\n data = list(map(str, input().split()))\n data2 = ['#'] + data + ['#']\n print((''.join(data2)))\n\n\nprint(('#' * (w + 2)))\n", "passed": true, "time": 0.16, "memory": 14340.0, "status": "done"}, {"code": "h,w = map(int, input().split())\na = list(list(input().split()) for _ in range(h))\nprint(\"#\"*(int(w)+2))\nfor i in range(h):\n print(\"#\",*a[i],\"#\",sep=\"\")\nprint(\"#\"*(int(w)+2))", "passed": true, "time": 0.19, "memory": 14196.0, "status": "done"}, {"code": "H, W = map(int, input().split())\nprint(\"#\"*(W+2))\nfor i in range(H):\n a = input()\n print(\"#\" + a + \"#\")\nprint(\"#\"*(W+2))", "passed": true, "time": 0.16, "memory": 14240.0, "status": "done"}, {"code": "h,w=map(int,input().split())\na=[list(input()) for i in range(h)]\n\nd=[['#']*(w+2) for i in range(h+2)]\nfor i in range(h):\n for j in range(w):\n d[i+1][j+1]=a[i][j]\nfor i in range(h+2):\n print(*d[i],sep='')", "passed": true, "time": 0.16, "memory": 14180.0, "status": "done"}, {"code": "H, W = map(int, input().split())\nL = ['#' + input() + '#' for _ in range(H)]\nL = ['#' * (W + 2)] + L + ['#' * (W + 2)]\n[print(i) for i in L]", "passed": true, "time": 0.23, "memory": 14324.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint(*['#'*-~-~m]+['#'+input()+'#' for _ in range(n)]+['#'*-~-~m],sep='\\n')", "passed": true, "time": 0.3, "memory": 14180.0, "status": "done"}, {"code": "h, w = map(int, input().split())\nprint(\"#\"*(w+2))\nfor i in range(h):\n a = str(input())\n a = \"#\" + a + \"#\"\n print(a)\nprint(\"#\"*(w+2))", "passed": true, "time": 0.22, "memory": 14164.0, "status": "done"}, {"code": "h, w = list(map(int, input().split()))\na = [input() for x in range(h)]\nprint(('#' * (w + 2)))\nfor s in a:\n print(('#' + s + '#'))\nprint(('#' * (w + 2)))\n", "passed": true, "time": 0.16, "memory": 14308.0, "status": "done"}, {"code": "h, w = list(map(int, input().split()))\na = [input() for _ in range(h)]\nans = ['#'*(w+2)]\n# print(ans)\nfor i in range(h):\n ans.append('#' + a[i] + '#')\n\nans.append('#'*(w+2))\nfor i in range(h+2):\n print((ans[i]))\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "H,W=list(map(int,input().split()))\na=[input() for _ in range(H)]\nfor i in range(0,H):\n a[i]='#'+a[i]+'#'\n\nprint(('#'*(W+2)))\nfor i in range(H):\n print((a[i]))\nprint(('#'*(W+2)))\n", "passed": true, "time": 0.29, "memory": 14332.0, "status": "done"}, {"code": "# https://atcoder.jp/contests/abc152/tasks/abc152_c\n\nh, w = list(map(int, input().split()))\n\nrow = '#' * (w + 2)\n\nprint(row)\nfor _ in range(h):\n print(('#' + input() + '#'))\n\nprint(row)\n", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "h,w = map(int,input().split())\ns = []\ns.append(\"#\"*(w+2))\nfor i in range(h):\n t = input()\n t = \"#\" + t + \"#\"\n s.append(t)\ns.append(\"#\"*(w+2))\nfor ss in s:\n print(\"\".join(ss))", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "from typing import List\n\n\ndef answer(h: int, w: int, a: List[str]) -> List[str]:\n top_bottom_line = '#' * (w + 2)\n\n result = [top_bottom_line]\n for line in a:\n result.append(f'#{line}#')\n result.append(top_bottom_line)\n\n return result\n\n\ndef main():\n h, w = list(map(int, input().split()))\n a = [input() for _ in range(h)]\n for i in answer(h, w, a):\n print(i)\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 15112.0, "status": "done"}, {"code": "h,w = map(int,input().split())\nli = [list(input().split()) for i in range(h)]\n#\u6a2a\u6cb3\nfor i in range(len(li)):\n st = li[i][0]\n li[i] = '#'+st+'#'\n#\u4e0a\u5074\nlis = '#'*(w+2)\nli.append(lis)\nli.insert(0,lis)\nfor i in li:\n print(i)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "h, w = map(int, input().split())\na = [[]]\nprint(\"#\"*(w+2))\nfor _ in range(h):\n print(\"#\", input().strip(),\"#\",sep=\"\")\nprint(\"#\"*(w+2))\n", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "H, W = list(map(int, input().split()))\nans = []\nfor _ in range(H):\n a = input()\n ans.append(\"#\" + a + \"#\")\n\nprint((\"#\" * (W + 2)))\nfor i in range(H):\n print((ans[i]))\nprint((\"#\" * (W + 2)))\n", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "h,w=map(int,input().split())\nprint('#'*(w+2))\nfor i in range(h): \n print('#'+input()+'#')\nprint('#'*(w+2))", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "H, W = [int(x) for x in input().split()]\npic = [list(input()) for _ in range(H)]\nans = [['#' for i in range(W+2)] for j in range(H+2)]\nfor i in range(H):\n for j in range(W):\n ans[i+1][j+1] = pic[i][j]\nlow = ''\nfor i in range(H+2):\n for j in range(W+2):\n low += ans[i][j]\n print(low)\n low = ''", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "h, w = map(int, input().split())\np = [input() for _ in range(h)]\n\nprint('#' * (w + 2))\nfor s in p:\n print('#' + s + '#')\nprint('#' * (w + 2))", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "h, w = map(int,input().split())\n\nprint(\"#\" * (w + 2))\nfor i in range(h):\n print(\"#\" + input() + \"#\")\nprint(\"#\" * (w + 2))", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint(*['#'*(m+2)]+['#'+input()+'#' for _ in range(n)]+['#'*(m+2)],sep='\\n')", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "#-*-coding:utf-8-*-\nimport sys\ninput=sys.stdin.readline\n\ndef main():\n strings=[]\n h,w = map(int,input().split())\n strings=[input().rstrip() for _ in range(h)]\n output=\"\"\n\n for i in range(h+2):\n if i==0 or i==h+1:\n igeta=\"#\"*(w+2)\n print(\"{}\".format(igeta))\n else:\n output=\"#\"+strings[i-1]+\"#\"\n print(output)\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "h,w= map(int,input().split())\na = [input() for _ in range(h)]\ns = ''\nfor i in range(w+2):\n s+='#'\nprint(s)\nfor i in a:\n t = list(i)\n t.insert(0,'#')\n t.append('#')\n print(''.join(t))\nprint(s)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "H, W = [int(x) for x in input().split()]\n\nfor i in range(H):\n if i == 0:\n print((''.join(['#'] * (W + 2))))\n\n print(('#' + input() + '#'))\n\nprint((''.join(['#'] * (W + 2))))\n", "passed": true, "time": 0.15, "memory": 14260.0, "status": "done"}, {"code": "h, w = list(map(int, input().split()))\npixel = [[] for i in range(h+2)]\nfor i in range(h+2):\n if i == 0:\n pixel[i].append('#'*(w+2))\n elif i == h+1:\n pixel[i].append('#'*(w+2))\n else :\n pixel[i].append('#')\n s = input()\n pixel[i].append(s)\n pixel[i].append('#')\nfor i in range(h+2):\n print((\"\".join(pixel[i])))\n\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "import sys\n\nH, W = map(int, sys.stdin.readline().split())\nprint(\"#\" * (W + 2))\nfor _ in range(H):\n s = sys.stdin.readline().strip()\n print(\"#\" + s + \"#\")\nprint(\"#\" * (W + 2))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "h,w = map(int,input().split())\nfor i in range(w+1):\n print(\"#\",end = \"\")\nprint(\"#\")\nfor i in range(h):\n print(\"#\"+input()+\"#\")\nfor i in range(w+1):\n print(\"#\",end = \"\")\nprint(\"#\")", "passed": true, "time": 0.23, "memory": 14100.0, "status": "done"}, {"code": "h,w = map(int, input().split())\nprint(\"#\" * (w + 2))\nfor i in range(h):\n s = input()\n print(\"#\" + s + \"#\")\n \nprint(\"#\" * (w + 2))", "passed": true, "time": 0.29, "memory": 14064.0, "status": "done"}, {"code": "h,w=map(int,input().split())\nhuta=['#' for _ in range(w+2)]\nhuta=''.join(huta)\nprint(huta)\nfor _ in range(h):\n a=input()\n print('#{}#'.format(a))\nprint(huta)", "passed": true, "time": 0.31, "memory": 14076.0, "status": "done"}, {"code": "h, w = list(map(int, input().split()))\na = [input() for i in range(h)]\nprint((\"#\" * (w + 2)))\nfor i in a:\n print((\"#\" + i + \"#\"))\nprint((\"#\" * (w + 2)))\n", "passed": true, "time": 0.28, "memory": 14172.0, "status": "done"}, {"code": "H,W = map(int,input().split())\nls = [[\"#\" for _ in range(W+2)]]\n\nfor _ in range(H):\n A = [\"#\"] + list(input()) + [\"#\"]\n ls.append(A)\n \nls.append([\"#\" for _ in range(W+2)])\n\nfor i in range(H+2):\n print(\"\".join(ls[i]))", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "h,w=map(int,input().split())\n \nprint(\"#\"*(w+2))\n \nfor i in range(h):\n num=input()\n print(\"#\"+num+\"#\")\n \nprint(\"#\"*(w+2))", "passed": true, "time": 0.2, "memory": 14224.0, "status": "done"}, {"code": "def inpl(): return list(map(int, input().split()))\nH, W = inpl()\nans = [[\"#\"]*(W+2) for _ in range(H+2)]\n\nfor h in range(H):\n A = input()\n for w in range(W):\n ans[h+1][w+1] = A[w]\n\nprint(*[\"\".join(a) for a in ans], sep=\"\\n\")", "passed": true, "time": 0.22, "memory": 14332.0, "status": "done"}, {"code": "H, W = list(map(int, input().split()))\nres = []\n\nfor i in range(H+2):\n if i == 0 or i == H+1:\n l = '#'*(W+2)\n res.append(l)\n else:\n a = input()\n a = '#' + a + '#'\n res.append(a)\n\nfor i in res:\n print(i)\n", "passed": true, "time": 0.22, "memory": 14188.0, "status": "done"}, {"code": "h,w = map(int,input().split())\nprint(\"#\"*(w+2))\nfor _ in range(h):\n print(\"#\" + input() + \"#\")\nprint(\"#\"*(w+2))", "passed": true, "time": 0.19, "memory": 14196.0, "status": "done"}, {"code": "h, w = map(int, input().split())\nprint(\"#\" * w + \"#\" * 2)\nfor _ in range(h):\n line = \"#\" + input() + \"#\"\n print(line)\n\nprint(\"#\" * w + \"#\" * 2)", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "h, w = map(int, input().split())\nwords = [0]*(h+2)\nfor i in range(1, h+1, 1):\n s = input()\n words[i] = s\n\nfor j in range(len(words)):\n if words[j] == 0:\n words[j] = '#'*(w+2)\n else:\n words[j] = '#'+words[j]+'#'\n\nfor ans in words:\n print(ans)", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "h, w = map(int, input().split())\nprint(\"#\" * (w + 2))\nfor _ in range(h):\n print(\"#\" + input() + \"#\")\nprint(\"#\" * (w + 2))", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "#ABC062 B:PictureFrame\n\nH,W = map(int, input().split())\npic = []\nfor _ in range(H):\n a = input()\n pic.append(a)\nprint('#'*(W+2))\nfor i in range(H):\n print('#' + pic[i] + '#')\nprint('#'*(W+2))", "passed": true, "time": 0.14, "memory": 14356.0, "status": "done"}, {"code": "h, w = map(int, input().split())\ngrid = [[\"#\"] * (w + 2) for _ in range(h + 2)]\n\nfor i in range(h):\n grid[i + 1] = [\"#\"] + list(map(str, input().rstrip())) + [\"#\"]\n\nfor i in range(h + 2):\n print(\"\".join(grid[i]))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "h,w = list(map(int, input().split()))\nprint('#' * (w + 2))\nfor _ in range(h):\n print('#' + input() + \"#\")\nprint('#' * (w + 2))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "H,W=map(int,input().split())\nanslist = [[\"#\" for i in range(W+2)]for j in range(H+2)]\nfor i in range(H):\n a=input()\n for j in range(W):\n anslist[i+1][j+1]=a[j]\nfor i in range(H+2):\n for j in range(W+2):\n print(anslist[i][j],end=\"\")\n print()", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "h, w = map(int,input().split())\na = [input() for _ in range(h)]\nprint(\"#\"*(w+2))\nfor i in range(h):\n print(\"#\" + a[i] + \"#\")\nprint(\"#\"*(w+2))", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "HW = input().split()\n\nH = int(HW[0])\nW = int(HW[1])\n\nlst = []\n\nfor i in range(H):\n lst.append('#' + input() + '#')\n\nprint('#' * (W+2))\n\nfor s in lst:\n print(s)\n\nprint('#' * (W+2))", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "H, W = map(int, input().split())\n\n\nframe = [['#' for _ in range(W+2)] for _ in range(H+2)]\n\nmat = [['#' for _ in range(W)] for _ in range(H)]\nfor i in range(H):\n line = input()\n for j in range(W):\n mat[i][j] = line[j]\n\nfor i, row in enumerate(mat):\n for j, char in enumerate(row):\n frame[i+1][j+1] = char\n\nfor i in frame:\n for j in i:\n print(j, end=\"\")\n print()\n", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "h,w=map(int, input().split())\n\nprint(\"#\"*(w+2))\nfor i in range(h):\n print(\"#{}#\".format(input()))\nprint(\"#\"*(w+2))", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "h,w = map(int,input().split())\n\nprint('#'*(w+2))\nfor i in range (h):\n print('#' + input() + '#')\nprint('#'*(w+2))", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "H, W = map(int, input().split())\nprint(\"#\"* (W + 2) )\nfor i in range(H):\n print(\"#\" + input() + \"#\")\nprint(\"#\"* (W + 2) )", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "h,w = list(map(int, input().split()))\nprint((\"#\"*(w+2)))\nfor i in range(h):\n s = input()\n print((\"#\" + s + \"#\"))\nprint((\"#\"*(w+2)))\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "H,W=map(int,input().split())\na=[\"\" for i in range(H)]\nfor i in range(H):\n a[i]=list(str(input()))\n\nfor s in range(-1,H+1):\n for t in range(-1,W+1): \n if s==-1 or s==H:\n print(\"#\"*(W+2))\n break\n else:\n if t==-1:\n print(\"#\",end=\"\")\n elif t==W:\n print(\"#\")\n else:\n print(a[s][t],end=\"\")", "passed": true, "time": 0.22, "memory": 14124.0, "status": "done"}, {"code": "h,w = map(int,input().split())\nprint(\"#\"*(w+2))\nfor i in range(h):\n print(\"#\"+input()+\"#\")\nprint(\"#\"*(w+2))", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "a,b=map(int,input().split())\ns=[]\nfor i in range(a):\n s.append(input())\nprint(\"#\"*(b+2))\nfor i in range(a):\n print(\"#\",end=\"\")\n print(s[i],end=\"\")\n print(\"#\")\nprint(\"#\"*(b+2))", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "N, W = list(map(int, input().split()))\nl = [input() for _ in range(N)]\n\nprint(('#'*(W+2)))\nfor i in l:\n print(('#' + i + '#'))\nprint(('#'*(W+2)))\n", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "H,W = map(int, input().split())\nH += 2\nW += 2\nfor i in range(H):\n\tif i == 0 or i == H-1:\n\t\tout = '#'*W\n\telse:\n\t\ta = input()\n\t\tout = '#{}#'.format(a)\n\tprint(out)", "passed": true, "time": 0.16, "memory": 14252.0, "status": "done"}, {"code": "H, W = map(int, input().split())\nprint('#' * (W + 2) ) # head\nfor _ in range(H):\n print('#', input(), '#', sep='')\n\nprint('#' * (W + 2) ) # tail", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "h, w = map(int, input().split())\na_l = [ ['#'] + list(map(str, input().split())) + ['#'] for i in range(h) ]\n\nprint(''.join(['#']*(w+2)))\nfor a in a_l:\n print(''.join(a))\nprint(''.join(['#']*(w+2)))", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "from collections import Counter,defaultdict,deque\nfrom heapq import heappop,heappush\nfrom bisect import bisect_left,bisect_right \nimport sys,math,itertools,fractions\nsys.setrecursionlimit(10**8)\nmod = 10**9+7\nINF = float('inf')\ndef inp(): return int(sys.stdin.readline())\ndef inpl(): return list(map(int, sys.stdin.readline().split()))\n\nh,w = inpl()\ns = [input() for _ in range(h)]\nres = []\nfor i in range(h+2):\n if i == 0 or i == h+1:\n res.append('#' * (w+2))\n else:\n res.append('#' + s[i-1] + '#')\nfor x in res:\n print(x)", "passed": true, "time": 0.25, "memory": 14064.0, "status": "done"}, {"code": "h, w = map(int, input().split())\na = ['#' * (w + 2)]\nfor i in range(h):\n a.append('#' + input() + '#')\na += ['#' * (w + 2)]\n\nfor i in range(h + 2):\n print(a[i])", "passed": true, "time": 0.23, "memory": 14068.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\nINF = float('inf')\nMOD = 10**9 + 7\n#MOD = 998244353\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lintdec(): return list(map(lambda x:int(x) - 1, input().split()))\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nH, W = lint()\n\nans = ['#' * (W + 2)]\nfor _ in range(H):\n ans.append('#' + input() + '#')\nans.append('#' * (W + 2))\n\nprint('\\n'.join(ans))", "passed": true, "time": 0.15, "memory": 14328.0, "status": "done"}, {"code": "h, w = list(map(int, input().split()))\nprint(('#'*(w + 2)))\nfor _ in range(h):\n print(('#' + input() + '#'))\nprint(('#'*(w + 2)))\n", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "h,w=map(int, input().split())\nprint(\"#\"*(w+2))\n\nfor i in range(h):\n s=input()\n print(\"#\"+s+\"#\")\n\nprint(\"#\"*(w+2))", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "def main():\n h,w= list(map(int, input().split()))\n a = []\n for i in range(h):\n a.append(input())\n cnt = len(a[0])+2\n print((\"#\" * cnt))\n for _ in a:\n print(f'#{_}#')\n print((\"#\" * cnt))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.23, "memory": 14116.0, "status": "done"}, {"code": "h,w=map(int,input().split())\n\nprint(\"#\"*(w+2))\n\nfor i in range(h):\n num=input()\n print(\"#\"+num+\"#\")\n \nprint(\"#\"*(w+2))", "passed": true, "time": 0.27, "memory": 14284.0, "status": "done"}, {"code": "h,w=map(int,input().split())\ns=[\"\"]*h\nfor i in range(h) :\n s[i]=input()\nprint(\"#\"*(w+2))\nfor i in range(h) :\n print(\"#\"+s[i]+\"#\")\nprint(\"#\"*(w+2))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "H,W = map(int,input().split())\nA = [input() for i in range(H)]\nprint('#'*(W+2))\nfor a in A:\n print('#' + a + '#')\nprint('#'*(W+2))", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "h,w = map(int,input().split())\na = [\"#\"*(w+2)]\nfor i in range(h):\n a.append('#'+input()+\"#\")\na.append(\"#\"*(w+2))\nfor i in range(h+2):\n print(a[i])", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "H, W=map(int, input().split())\nout=['#'*(W+2)]+['#'+input()+'#' for _ in range(H)]+['#'*(W+2)]\nprint(*out, sep='\\n')\n", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "x,y=input().split()\nx=int(x)\ny=int(y)\na=[input() for i in range(x)]\nc=\"\"\nfor i in range(y+2):\n c=c+\"#\"\nprint(c)\nfor i in range(x):\n print(\"#\"+a[i]+\"#\")\nprint(c)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "h,w=list(map(int,input().split()))\ntop = \"#\"\ntop *=(w + 2)\nprint(top)\nfor i in range(h):\n tmp = input()\n print((\"#\"+tmp+\"#\"))\nprint(top)\n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "H, W = map(int, input().split())\nA = [input() for _ in range(H)]\n\nW += 2\nf = '#'\nprint(f * W)\nfor a in A:\n print(f'#{a}#')\nprint(f * W)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "h, w = map(int, input().split())\na = []\nfor _ in range(h):\n a.append('#' + input() + '#')\nsharp = '#' * (w + 2)\nprint(sharp)\nfor j in range(0, h):\n print(a[j])\nprint(sharp)", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "h,w = map(int,input().split())\n\nprint('#'*(w+2))\nfor i in range(h):\n s = input()\n print('#'+s+'#')\nprint('#'*(w+2))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "h, w = map(int, input().split())\n\ns = \"#\" * (w+2)\n\nprint(s)\nfor i in range(h):\n t = input()\n print(\"#\", end=\"\")\n print(t, end=\"#\\n\")\nprint(s)\n", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "H, W = map(int, input().split())\n\nscr_list = [input() for _ in range(H)]\n\nprint('#' * (W+2))\nfor i in scr_list:\n print('#' + i + '#')\nprint('#' * (W+2))", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "def resolve():\n '''\n code here\n '''\n H, W = [int(item) for item in input().split()]\n grid = [input() for _ in range(H)]\n \n print(('#'*(W+2)))\n for line in grid:\n print(('#' + line + '#'))\n print(('#'*(W+2)))\n\ndef __starting_point():\n resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14012.0, "status": "done"}, {"code": "h, w = map(int, input().split())\na = []\nfor _ in range(h):\n a.append(input())\nprint('#' * (w + 2))\nfor i in range(h):\n print('#' + a[i] + '#')\nprint('#' * (w + 2))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "h, w = map(int, input().split())\nprint(\"#\"*(w+2))\nfor i in range(h):\n s=input()\n print(\"#\" + s + \"#\")\nprint(\"#\"*(w+2))", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "H, W = list(map(int, input().split()))\nA = [list(input()) for _ in range(H)]\n\n# \u4e00\u6bb5\u76ee\nprint((\"#\"*(W+2)))\nfor a in A:\n print((\"#\" + \"\".join(a) + \"#\"))\n# \u6700\u7d42\u6bb5\nprint((\"#\"*(W+2)))\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "h,w = [int(x) for x in input().split()]\nprint(\"#\" * (w + 2))\nfor i in range(h):\n print(\"#\" + input() + \"#\")\nprint(\"#\" * (w + 2))", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "h,w = map(int, input().split())\nal = []\nfor _ in range(h):\n row = input()\n row = '#' + row + '#'\n al.append(row)\n\ntop = '#'*(w+2)\nprint(top)\nfor a in al:\n print(a)\nprint(top)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "H,W = list(map(int,input().split()))\na = ''\nfor i in range(W + 2):\n a += '#'\nL = []\nL.append(a)\nfor j in range(H):\n b = str(input())\n c = '#' + b + '#'\n L.append(c)\nL.append(a)\nfor k in range(H + 2):\n print((L[k]))\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "h, w = map(int, input().split())\n\nprint(\"#\" * (w+2))\n\nfor i in range(h):\n s = input()\n print(\"#\" + s + \"#\")\n\nprint(\"#\" * (w+2))", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "h,w = map(int, input().split())\nprint(\"#\"*(w+2))\nfor i in range(h):\n s = input()\n print(\"#\"+s+\"#\")\nprint(\"#\"*(w+2))", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "h,w = map(int, input().split())\na = [input() for i in range(h)]\n\nprint(\"#\"*(w+2))\nfor i in range(h):\n print(\"#\" + a[i] + \"#\")\nprint(\"#\"*(w+2))", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "x,y = map(int,input().split())\nL = [list(input()) for _ in range(x)]\nF = [['#']*(y+2) for _ in range(x+2)]\nfor i in range(x):\n for j in range(y):\n F[i+1][j+1] = L[i][j]\nfor f in F:\n print(''.join(f))", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}]
[{"input": "2 3\nabc\narc\n", "output": "#####\n#abc#\n#arc#\n#####\n"}, {"input": "1 1\nz\n", "output": "###\n#z#\n###\n"}]
4,713
You have an integer variable x. Initially, x=0. Some person gave you a string S of length N, and using the string you performed the following operation N times. In the i-th operation, you incremented the value of x by 1 if S_i=I, and decremented the value of x by 1 if S_i=D. Find the maximum value taken by x during the operations (including before the first operation, and after the last operation). -----Constraints----- - 1≤N≤100 - |S|=N - No characters except I and D occur in S. -----Input----- The input is given from Standard Input in the following format: N S -----Output----- Print the maximum value taken by x during the operations. -----Sample Input----- 5 IIDID -----Sample Output----- 2 After each operation, the value of x becomes 1, 2, 1, 2 and 1, respectively. Thus, the output should be 2, the maximum value.
introductory
[{"code": "N = int(input())\nS = input()\nres = 0\ntmp = 0\nfor s in S:\n if s == 'I':\n tmp += 1\n elif s == 'D':\n tmp -= 1\n \n res = max(res, tmp)\n\nprint(res)\n", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nx=0\nans=0\nfor i in range(n):\n if s[i]==\"I\":\n x+=1\n else:\n x-=1\n ans=max(ans,x)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\nmax = x = 0\n\nfor i in s:\n if i=='I':\n x += 1\n else:\n x -= 1\n if max < x :\n max = x\nprint(max)", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nxl = [0]\nfor i in range(n):\n if s[i] == \"I\":\n x += 1\n xl.append(x)\n else:\n x -= 1\n xl.append(x)\nprint(max(xl))", "passed": true, "time": 0.2, "memory": 14224.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nx = 0\nans = 0\nfor a in s:\n if a == 'I':\n x += 1\n else:\n x -= 1\n ans = max(ans, x)\nprint(ans)", "passed": true, "time": 0.28, "memory": 14228.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = 0\n \nfor i in S:\n if i == \"I\":\n x += 1\n elif i == \"D\":\n x -= 1\n ans = max(ans,x)\n \nprint(ans)", "passed": true, "time": 0.17, "memory": 14284.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nans = 0\nx = 0\nfor i in range(n):\n if s[i] == 'I':\n x += 1\n else:\n x -= 1\n ans = max(ans, x)\n \nprint(ans)", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nx=[0]\nfor i in s:\n if i==\"I\":\n x.append(x[-1]+1)\n else:\n x.append(x[-1]-1)\nprint(max(x))", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nx = 0\nlst = [0]\n\nfor i in range(N):\n if S[i] == 'I':\n x += 1\n else:\n x -= 1\n lst.append(x)\n\nprint(max(lst))", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nres = x = 0\nfor s_ in s:\n if s_==\"I\":\n x+=1\n else:\n x-=1\n res = max(res, x)\nprint(res)", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\n\nx = 0\nmx = 0\n\nfor a in s:\n if a == \"I\":\n x +=1\n else:\n x -=1\n if x > mx:\n mx = x\n \nprint(mx)\n", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nx, ans = 0, 0\nfor o in s:\n if o == 'I':\n x += 1 \n else:\n x -= 1\n ans = max(ans, x)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = [0]\nfor i in range(N):\n if S[i] == 'I':\n x += 1\n else:\n x -= 1\n ans.append(x)\nprint(max(ans))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\ntmp = 0\nans = 0\nfor i in range(N):\n if 'I' == S[i]:\n tmp += 1\n else:\n tmp -= 1\n ans = max(tmp, ans)\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "input();x,r=0,0\nfor i in input():\n if i=='I': x+=1\n else: x-=1\n r=max(r,x)\nprint(r)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "n = int(input())\na = list(input())\nxlist = [0]\nx = 0\nfor i in range(n):\n if a[i]==\"D\":\n x-=1\n elif a[i]==\"I\":\n x+=1\n xlist.append(x)\nprint(max(xlist))", "passed": true, "time": 0.43, "memory": 14236.0, "status": "done"}, {"code": "x=0\nn=int(input())\ns=input()\nl=[0]\nfor i in s:\n if i==\"I\":\n x+=1\n l.append(x)\n else:\n x-=1\n l.append(x)\nprint(max(l))", "passed": true, "time": 1.25, "memory": 14104.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nans = 0\nhighest = 0\nfor i in S:\n if i == \"I\":\n ans += 1\n else:\n ans -= 1\n if highest <= ans:\n highest = ans \n\nprint(highest)", "passed": true, "time": 0.14, "memory": 14380.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nmax_num = 0\nidx = 0\nx = 0\nwhile idx < N:\n if S[idx] == 'I':\n x += 1\n else:\n x -= 1\n max_num = max(x, max_num)\n idx += 1\n\nprint(max_num)\n", "passed": true, "time": 0.23, "memory": 14296.0, "status": "done"}, {"code": "N=int(input())\nS=input()\nans=0\ncnt=0\nfor i in range(len(S)):\n if S[i]=='I':\n cnt+=1\n else:\n cnt-=1\n ans=max(ans,cnt)\nprint(ans)", "passed": true, "time": 0.22, "memory": 14120.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lint_dec(): return list(map(lambda x:int(x) - 1, input().split()))\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nN = ii()\nS = si()\nx = 0\nans = 0\n\nfor s in S:\n if s == 'I':\n x += 1\n else:\n x -= 1\n ans = max(x, ans)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "n=int(input())\nx=0\nb=[]\ns=input()\nfor S in s:\n if S=='I':\n x += 1\n b.append(x)\n else:\n x -= 1\n b.append(x)\nprint((max(max(b),0)))\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "cnt = int(input())\nstring = input()\nx = [0]\n\ni = 0\nfor _ in string:\n if _ == \"I\":\n i += 1\n x.append(i)\n else:\n i -= 1\n x.append(i)\n\nprint(max(x))", "passed": true, "time": 0.15, "memory": 14124.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nm = 0\nfor i in range(n):\n if s[i] == \"I\":\n x += 1\n m = max(m, x)\n else:\n x -= 1\nprint(m)", "passed": true, "time": 0.16, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\ns = str(input())\nx = 0\nmaximum = 0\n\nfor i in range(n):\n if s[i] == 'I':\n x += 1\n elif s[i] == 'D':\n x -= 1\n maximum = max(maximum, x)\n\nprint(maximum)", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = ans = 0\nfor i in s:\n if i == \"I\":\n x += 1\n else:\n x -= 1\n ans = max(ans,x)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\n\ncounter = 0\nli = [0]\nfor i in range(N):\n if S[i] == 'I':\n counter +=1\n else:\n counter -= 1\n li.append(counter)\nprint(max(li))", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "N=int(input())\nS=input()\nx=0\nans=0\nfor c in S:\n if c=='I':\n x+=1\n ans=max(ans,x)\n else:\n x-=1\nprint(ans)\n", "passed": true, "time": 0.3, "memory": 14108.0, "status": "done"}, {"code": "N = int(input())\nS = str(input())\n\nans = 0\ntmp = 0\nfor i in S:\n if i == 'I':\n tmp += 1\n ans = max(ans, tmp)\n else:\n tmp -= 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nnum_list = [0]\nsum = 0\nfor w in s:\n if w == 'I':\n sum += 1\n else:\n sum -= 1\n num_list.append(sum)\n\nnum_list.sort()\nans = num_list[-1]\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = 0\nfor s in S:\n if s == \"I\":\n x += 1\n else:\n x -= 1\n ans = max(ans, x)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14232.0, "status": "done"}, {"code": "a,b=[input() for i in range(2)]\np=0\nans=0\n\nfor i in b:\n if i =='I':\n p+=1\n elif i =='D' and p>0:\n p-=1\n else:\n p-=1\n \n if ans<p:\n ans=p\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nx = 0\nans = 0\nfor i in s:\n if i == 'I':\n x += 1\n elif i == 'D':\n x -= 1\n ans = max(ans, x)\n\nprint(ans)", "passed": true, "time": 0.16, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nl = [0]\nfor a in s:\n if a == \"I\":\n x = x + 1\n l.append(x)\n else:\n x = x - 1\n l.append(x)\n\nprint(max(l))", "passed": true, "time": 0.15, "memory": 14068.0, "status": "done"}, {"code": "N, S = input(), input()\nx, xmax = 0, 0\nfor s in S:\n x = (lambda a:x+1 if a=='I' else x-1)(s)\n xmax = max(x,xmax)\nprint(xmax)", "passed": true, "time": 0.32, "memory": 14268.0, "status": "done"}, {"code": "# coding: utf-8\n\nnum = input()\ncount = 0\nmax = 0\nmessage = input()\ntable = list(message)\nfor i in table:\n if i == \"I\":\n count += 1\n elif i == \"D\":\n count -= 1\n if max <= count:\n max = count\nprint(max)", "passed": true, "time": 0.32, "memory": 14012.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\ncnt = 0\n\nfor i in range(n):\n cnt = max(cnt, s[0:i+1].count(\"I\") - s[0:i+1].count(\"D\"))\n\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nans = 0\nfor i in range(n):\n ans = max(ans, x)\n if s[i] == 'I':\n x += 1\n else :\n x -= 1\n ans = max(ans, x)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "x = int(input())\ns = input()\nli = [0]\nc = 0\nfor i in range(x):\n if s[i] == \"I\":\n c += 1\n li.append(c)\n else:\n c -= 1\n li.append(c)\nprint(max(li))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nmax = 0\nfor i in S:\n if i == 'I':\n x += 1\n else:\n x -= 1\n if x > max:\n max = x\nprint(max)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nans=0\nx=0\nfor i in range(n):\n if s[i]=='I':\n x+=1\n else:\n x-=1\n ans=max(ans,x)\nprint(ans)", "passed": true, "time": 0.16, "memory": 14192.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nm = 0\nx = 0\nfor w in s:\n\tif w == \"I\":\n\t\tx += 1\n\telse:\n\t\tx -= 1\n\t\n\tif x > m:\n\t\tm = x\n\t\t\nprint(m)", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\nx = 0\ntmp = 0\nfor i in s:\n if i == \"I\":\n x += 1\n else:\n x -= 1\n tmp = max(x, tmp)\nprint(tmp)", "passed": true, "time": 0.17, "memory": 14060.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nx = 0\nx_list= [0]\nfor s in S:\n if s == 'I':\n x += 1\n x_list.append(x)\n else:\n x -= 1\n x_list.append(x)\n\nprint(max(x_list))", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nc = 0\nfor i in s:\n if i == \"I\":\n x += 1\n else:\n x -= 1\n c = max(x,c)\nprint(c)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "def answer(n: int, s: str) -> int:\n while 'DI' in s:\n s = s.replace('DI', '')\n\n return s.count('I')\n\n\ndef main():\n n = int(input())\n s = input()\n print(answer(n, s))\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 14004.0, "status": "done"}, {"code": "N=int(input())\nS=input()\na=[]\ntotal=0\nfor i in range(len(S)):\n if S[i]==\"I\":\n total+=1\n a.append(total)\n else:\n total-=1\n a.append(total)\nprint(max(max(a),0))", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nans = 0\nx = 0\nfor c in s:\n if c == 'I':\n x += 1\n else:\n x -= 1\n ans = max(ans, x)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "N = int(input())\nS = str(input())\nmax_int = 0\ncount = 0\nfor i in S:\n if i == 'I':\n count +=1\n max_int = max(max_int, count)\n elif i == 'D':\n count -= 1\nprint(max_int)", "passed": true, "time": 0.15, "memory": 14060.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nans = 0\ncnt = 0\nfor i in range(N):\n if S[i] == 'I':\n cnt += 1\n ans = max(ans, cnt)\n else:\n cnt -= 1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "#-*-coding:utf-8-*-\nimport sys\ninput=sys.stdin.readline\n\ndef main():\n answers=[0]\n n = int(input())\n S = input()\n x=0\n\n for s in S:\n if \"I\" in s:\n x+=1\n answers.append(x)\n elif \"D\" in s:\n x-=1\n answers.append(x)\n print(max(answers))\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nx=0\nm = 0\nfor i in range(n):\n if s[i] == \"I\":\n x += 1\n m = max(x, m)\n else:\n x -= 1\nprint(m) ", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nans = 0\ncnt = 0\n\nfor i in range(N):\n if S[i] == \"I\":\n cnt += 1\n elif S[i] == \"D\":\n cnt -= 1\n \n ans = max(ans, cnt)\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\nans = 0\nn_ans = 0\nfor i in range(N):\n if(S[i]=='I'):\n n_ans += 1\n ans = max(ans, n_ans)\n else:\n n_ans -= 1\n ans = max(ans, n_ans)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = 0\n\nfor i in range(len(S)):\n if S[i] == 'I':\n x += 1\n ans = max(x, ans)\n else:\n x -= 1\nprint(ans)\n", "passed": true, "time": 0.13, "memory": 14188.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = x\n\nfor i in range(N):\n if S[i]==\"I\":\n x += 1\n ans = max(ans, x)\n else:\n x -= 1\nprint(ans)", "passed": true, "time": 0.23, "memory": 14328.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\ny = 0\n\nfor i in range(n):\n\tif s[i] == 'I':\n\t\tx += 1\n\t\tif x>y:\n\t\t\ty = x\n\telse:\n\t\tx -= 1\n\nprint(y)", "passed": true, "time": 0.4, "memory": 14112.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nresult = 0\nx = 0\nfor i in S:\n if i == 'I':\n x += 1\n else:\n x -= 1\n result = max(result, x)\n\nprint(result)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nc = 0\nans = 0\nfor i in list(s):\n if i == 'I':\n c+=1\n else:\n c-=1\n ans = max(ans, c)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "n = int(input())\ns = list(map(str, input()))\nmx = 0\nsm = 0\n\nfor char in s:\n if char == \"I\":\n sm += 1\n mx = max(mx, sm)\n elif char == \"D\":\n sm -= 1\n else:\n continue\n\nprint(mx)", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nans = x\nfor i in range(n):\n if s[i] == 'I':\n x += 1\n else:\n x -= 1\n ans = max(ans,x)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nmaxnum = 0\ncnt = 0\nfor i in range(len(s)):\n if s[i] == 'I':\n cnt += 1\n if cnt >= maxnum:\n maxnum = cnt\n elif s[i] == 'D':\n cnt -= 1\nprint(maxnum)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\ncount = 0\nmax = 0\nfor i in range(n):\n \n if s[i] == \"I\":\n count += 1\n if max < count:\n max = count\n elif s[i] == \"D\":\n count -= 1\nprint(max)", "passed": true, "time": 0.45, "memory": 14260.0, "status": "done"}, {"code": "# 31\nN = int(input())\nS = str(input())\n\nans = 0\ncount = 0\nfor i in S:\n if i == 'I': count += 1\n elif i == 'D': count -= 1\n ans = max(ans, count)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a=int(input())\nb=input()\nc=0\nd=[0]\nfor i in b:\n if(i==\"I\"):\n c+=1\n d.append(c)\n elif(i==\"D\"):\n c-=1\n d.append(c)\nprint(max(d))", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nans = 0\nx = 0\nfor i in S:\n if i == 'I':\n x += 1\n ans = max(ans, x)\n else:\n x -= 1\nprint(ans)", "passed": true, "time": 0.18, "memory": 14240.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\nx = 0\na = [0]\n\nfor s in S:\n if s == 'I':\n x += 1\n else:\n x -= 1\n a.append(x)\n\nprint(max(a))", "passed": true, "time": 0.22, "memory": 14312.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nans = 0\nx = 0\nfor i in s:\n if i == 'I':\n x += 1\n else:\n x -= 1\n if x > ans:\n ans = x\nprint(ans)", "passed": true, "time": 0.19, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nmaxx = 0\nfor i in range(n):\n if s[i] == \"I\":\n x += 1\n if maxx < x:\n maxx = x\n else:\n x -= 1\nprint(maxx)", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nm = 0\nx=0\nfor i in range(N):\n if S[i] == 'I':\n x+=1\n \n else:\n x-=1\n \n m=max(m,x)\n \nprint(m)\n", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nX = [0]*(N+1)\n\nfor i in range(1, N+1):\n if S[i-1] == \"I\":\n x += 1\n X[i] = x\n else:\n x -= 1\n X[i] = x\nprint((max(X)))\n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\nx = 0\nmax = 0\nfor i in range(N):\n if S[i] == \"I\":\n x += 1\n else:\n x -= 1\n if x > max:\n max = x\nprint(max)", "passed": true, "time": 0.16, "memory": 14140.0, "status": "done"}, {"code": "n=int(input())\ns=input()\n\nans=0\nnum=0\nfor i in s:\n if i==\"I\":\n num+=1\n ans=max(ans,num)\n elif i==\"D\":\n num-=1\n ans=max(ans,num)\n \nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "N = int(input())\nS = str(input())\nx = 0\nL = [x]\nfor i in S:\n if i == 'I':\n x += 1\n if i == 'D':\n x -= 1\n L.append(x)\nprint((max(L)))\n", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\ns = str(input())\n\nmax_result = 0\nresult = 0\n\n\nfor i in s:\n if i == \"I\":\n result += 1\n if result > max_result:\n max_result = result\n else:\n result -= 1\n\n\nprint(max_result)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nres = 0\n\nfor i in range(n):\n if s[i] == \"I\":\n x += 1\n else:\n x -= 1\n res = max(res, x)\n\nprint(res)\n", "passed": true, "time": 0.23, "memory": 14260.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = 0\nfor i in range(N):\n if S[i] == 'I':\n x += 1\n else:\n x -= 1\n ans = max(ans, x)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "n = int(input())\nans = list(input())\ncount = 0\na = set()\nfor i in range(n):\n if ans[i] == 'I':\n count += 1\n a.add(count)\n elif ans[i] == 'D':\n count -= 1\n a.add(count)\n\nprint(max(max(a), 0))", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "N=int(input())\nS=input()\n\ndef ans052(N:int, S:str):\n x=0\n x_list=[0]\n for i in range(N):\n if S[i]==\"I\":\n x+=1\n x_list.append(x)\n elif S[i]==\"D\":\n x-=1\n x_list.append(x)\n x_list.sort()\n return x_list[-1]\n\nprint(ans052(N,S))", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "a=int(input())\nb=input()\nc=0\nd=0\nfor i in range(a):\n if b[i]==\"D\":\n c=c-1\n if b[i]==\"I\":\n c=c+1\n if c>d:\n d=c\nprint(d)", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nx = 0\nx_max = x\n\nfor c in S:\n if c == \"I\":\n x += 1\n if x > x_max:\n x_max = x\n elif c == \"D\":\n x -= 1\n\nprint(x_max)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n = int(input())\ns = input()\ncount = 0\nx = 0\nfor i in range(n):\n if s[i] == \"I\":\n x += 1\n else:\n x -= 1\n count = max(count, x)\nprint(count)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n=int(input())\ns=str(input())\nans=0\nm=0\nfor i in range(n):\n if s[i]==\"I\":\n ans+=1\n m=max(m,ans)\n else:\n ans-=1\n\nprint(m)\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "N=int(input())\nS=input()\nx=0\nans=0\nfor i in range(N):\n if S[i]=='I':\n x+=1\n else:\n x-=1\n ans=max(ans,x)\nprint(ans)", "passed": true, "time": 0.23, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nres = 0\nans = 0\nfor i in range(n):\n if s[i] == \"D\":\n res -= 1\n else:\n res += 1\n ans = max(res,ans)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "# -*- coding:utf-8 -*-\nN = int(input())\nS = input()\n\nans = 0\nmax = 0\n\nfor s in S:\n if s == 'I':\n ans += 1\n else:\n ans -= 1\n \n if max < ans:\n max = ans\n\nprint(max)", "passed": true, "time": 0.23, "memory": 14124.0, "status": "done"}, {"code": "x = 0\nmx = 0\nn = int(input())\ns = input()\n\nfor c in s:\n if c == 'I':\n x += 1\n else:\n x -= 1\n mx = max(mx, x)\n\nprint(mx)\n", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nans = 0\nans_tmp = 0\nfor s in S:\n if s==\"I\":\n ans_tmp += 1\n ans = max(ans_tmp, ans)\n else:\n ans_tmp -= 1\nprint(ans)", "passed": true, "time": 0.23, "memory": 14316.0, "status": "done"}, {"code": "N,S=int(input()),input()\nprint(max([(t:=S[:m+1]).count(\"I\")-t.count(\"D\") for m in range(N)]+[0]))", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nans = 0\nfor i in s:\n if i == 'I':\n x+=1\n elif i == 'D':\n x-=1\n ans = max(ans,x)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\ns = str(input())\nx = 0\na = 0\nfor i in s:\n if i == 'I':\n x += 1\n if x > a:\n a = x\n else:\n x -= 1\nprint(a)", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nx = 0\nans = 0\nfor i in S:\n if i == 'I':\n x += 1\n elif i == 'D':\n x -= 1\n ans = max(x, ans)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14072.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nmax = 0\nsum = 0\nfor i in s:\n if(i == 'I'):\n sum += 1\n if(max < sum):\n max = sum\n else:\n sum -= 1\nprint(max)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "def main():\n input()\n s = input()\n tmp = 0\n ans = 0\n for v in s:\n if v == \"I\":\n tmp += 1\n else:\n tmp -= 1\n ans = max(ans, tmp)\n print(ans)\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.13, "memory": 14200.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nans = [0]\n\nfor c in s:\n if c == 'I':\n x += 1\n else:\n x -= 1\n ans.append(x)\nprint(max(ans))", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "N = int(input())\nS = str(input())\n\nM = 0\nSum = 0\n\nfor x in S:\n if x == 'I':\n Sum += 1\n else:\n Sum -= 1\n M = max(M, Sum)\n\nprint(M)\n", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\n\nx = 0\nmaxi = 0\n\nfor i in S:\n if i == 'I':\n x += 1\n else:\n x -= 1\n\n if x > maxi:\n maxi = x\n\nprint(maxi)", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "input()\n\ncur = 0\nmax_value = 0\nfor c in input():\n x = 1 if c == 'I' else -1\n cur += x\n max_value = max(max_value, cur)\n \nprint(max_value)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}]
[{"input": "5\nIIDID\n", "output": "2\n"}, {"input": "7\nDDIDDII\n", "output": "0\n"}]
4,714
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward. -----Constraints----- - 10000 \leq A \leq B \leq 99999 - All input values are integers. -----Input----- Input is given from Standard Input in the following format: A B -----Output----- Print the number of palindromic numbers among the integers between A and B (inclusive). -----Sample Input----- 11009 11332 -----Sample Output----- 4 There are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.
introductory
[{"code": "a,b = map(int,input().split())\nans = 0\nfor i in range(a,b+1):\n c = str(i)\n l = len(c)\n d = l // 2\n cnt = 0\n for i in range(d):\n if c[i] == c[-i-1]:\n cnt += 1\n if cnt == d:\n ans += 1\nprint(ans)", "passed": true, "time": 0.31, "memory": 14136.0, "status": "done"}, {"code": "A,B = list(map(str,input().split()))\nLa = [int(A[:3]),int(A[3:])]\nLb = [int(B[:3]),int(B[3:])]\nL = 900 - (La[0] - 100) - (999 - Lb[0])\nch1 = int(A[1] + A[0])\nch2 = int(B[1] + B[0])\nif Lb[1] < ch2:\n L -= 1\nif ch1 < La[1]:\n L -= 1\nprint(L)\n \n", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "A, B = [int(x) for x in input().split()]\nans = 0\nfor i in range(A, B+1):\n s = str(i)\n S = list(s)\n if(S[0]==S[4] and S[1]==S[3]):\n ans += 1\nprint(ans)", "passed": true, "time": 0.16, "memory": 14320.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\ncount = 0\n\nfor i in range(A, B+1):\n check = 0\n str_i = str(i)\n for j in range(0, (len(str_i)//2)+1):\n if int(str_i[j]) != int(str_i[-1-j]):\n check += 1\n if check == 0:\n count += 1\n\nprint(\"{}\".format(count))", "passed": true, "time": 0.22, "memory": 14136.0, "status": "done"}, {"code": "A,B = map(int,input().split())\n\nans = 0\n\nfor i in range(1,10):\n for j in range(10):\n for k in range(10):\n if A <= i*10000+j*1000+k*100+j*10+i <= B:\n ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\ncnt = 0\n\nfor i in range(a, b+1):\n l = []\n while (i > 0):\n l.append(i%10)\n i//=10\n if (l[0] == l[4] and l[1] == l[3]):\n cnt+=1\nprint(cnt)\n", "passed": true, "time": 1.57, "memory": 14088.0, "status": "done"}, {"code": "a,b=map(int,input().split())\ncount=0\nfor i in range(a,b+1):\n i=str(i)\n if i[0]==i[4] and i[1]==i[3]:\n count+=1\n \nprint(count)", "passed": true, "time": 0.19, "memory": 14216.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\ncount = 0\nfor i in range(A, B+1):\n num = str(i)\n if num[0] == num[4]:\n if num[1] == num[3]:\n count += 1\n\nprint(count)", "passed": true, "time": 0.17, "memory": 14076.0, "status": "done"}, {"code": "A, B = map(int,input().split())\n\ncount = 0\nfor i in range(A, B+1):\n if str(i) == str(i)[::-1]:\n count += 1\n\nprint(count)", "passed": true, "time": 0.17, "memory": 14068.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\ncount = 0\nfor i in range(A, B+1):\n if(str(i) == str(i)[::-1]):\n count += 1\n else: continue\nprint(count)", "passed": true, "time": 0.17, "memory": 14296.0, "status": "done"}, {"code": "# import math\n# import statistics\n# a=input()\n#b,c=int(input()),int(input())\n# c=[]\n# for i in a:\n# c.append(i)\ne1,e2 = map(str,input().split())\n# f = list(map(int,input().split()))\n#g = [input() for _ in range(a)]\n# h = []\n# for i in range(e1):\n# h.append(list(map(int,input().split())))\nc=[]\ncount=0\nans=0\nfor i in range(int(e1),int(e2)+1):\n count=0\n for k in range(len(str(i))//2):\n if str(i)[k]==str(i)[-(k+1)]:\n count+=1\n if len(str(i))//2 == count:\n ans+=1\n\nprint(ans)", "passed": true, "time": 0.24, "memory": 14180.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nans = 0\nfor i in range(a,b+1):\n num = 0\n j = i\n while j > 0:\n r = j % 10\n j //= 10\n num = num * 10 + r\n if i == num:\n ans += 1\n\n\nprint(ans)", "passed": true, "time": 0.18, "memory": 14104.0, "status": "done"}, {"code": "a,b=input().split()\na=int(a)\nb=int(b)\nc=0\nfor i in range(a,b+1):\n i=str(i)\n if i[0]==i[4] and i[1]==i[3]:\n c+=1\nprint(c)", "passed": true, "time": 1.62, "memory": 14288.0, "status": "done"}, {"code": "A, B = map(int, input().split())\ncount = 0\n\nfor i in range(A, B+1):\n if str(i)[0] == str(i)[4]:\n if str(i)[1] == str(i)[3]:\n count += 1\n \nprint(count)", "passed": true, "time": 0.16, "memory": 14384.0, "status": "done"}, {"code": "A,B=list(map(int,input().split()))\ndef ans090(A:int,B:int):\n ans_count = 0\n for i in range(A,B+1):\n if str(i) == str(i)[::-1]:\n ans_count+=1\n return ans_count\nprint((ans090(A,B)))\n", "passed": true, "time": 0.17, "memory": 14192.0, "status": "done"}, {"code": "A, B = map(int,input().split())\n\ncnt = 0\nfor i in range(A, B + 1):\n i = str(i)\n x = len(i) // 2\n left = i[0: x]\n right = i[x + 1 :]\n reverse_right = right[::-1]\n if left == reverse_right:\n cnt += 1\nprint(cnt)", "passed": true, "time": 0.17, "memory": 14320.0, "status": "done"}, {"code": "A, B = map(int,input().split())\n\nNumbers = []\n\nfor i in range(A,B+1):\n number = str(A)\n # print(number)\n if number[0] == number[4] and number[1] == number[3]:\n Numbers.append(number)\n A += 1\n\nprint(len(Numbers))", "passed": true, "time": 0.16, "memory": 14180.0, "status": "done"}, {"code": "A, B = list(map(int, input().split()))\ncnt = 0\nfor i in range(A, B + 1):\n\tif str(i) == str(i)[::-1]:\n\t\tcnt += 1\nprint(cnt)\n", "passed": true, "time": 0.16, "memory": 14176.0, "status": "done"}, {"code": "a, b = map(int, input().split())\ncount = 0\nfor i in range(a, b + 1):\n s = str(i)\n if s[0] == s[4] and s[1] == s[3]:\n count += 1\nprint(count)", "passed": true, "time": 0.17, "memory": 14208.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nans = 0\nfor i in range(a, b+1):\n i = list(str(i))\n t_size = len(i)\n if t_size%2 == 0:\n if i[:t_size//2] == list(reversed(i[t_size//2:])):\n ans+=1\n else:\n if i[:t_size//2] == list(reversed(i[t_size//2+1:])):\n ans+=1\nprint(ans)", "passed": true, "time": 0.2, "memory": 14096.0, "status": "done"}, {"code": "ab = list(map(int, input().split()))\na, b = ab[0], ab[1]\ncount = 0\n\nfor num in range(a, b + 1):\n str_num = str(num)\n str_num_reversed = \"\".join(list(reversed(str_num)))\n if str_num == str_num_reversed:\n count += 1\n\nprint(count)\n", "passed": true, "time": 0.18, "memory": 14280.0, "status": "done"}, {"code": "lst = input().split()\n\ncount = 0\n\ndef judge(n):\n if str(n) == str(n)[::-1]:\n return True\n else:\n return False\n\nfor i in range(int(lst[0]), int(lst[1]) + 1):\n if judge(i):\n count += 1\n\nprint(count)", "passed": true, "time": 0.17, "memory": 14036.0, "status": "done"}, {"code": "A,B = map(int,input().split())\n\ncnt = 0\nfor i in range(A,B+1):\n s = str(i)\n half = len(s) // 2\n add = len(s) % 2\n #print(s,-1, s[0:half],-1, s[half+add:][::-1])\n if s[0:half] == s[half+add:][::-1]:\n cnt += 1\n \nprint(cnt)", "passed": true, "time": 0.2, "memory": 14200.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nanswer = 0\n\nfor k in range(a, b + 1):\n kk = str(k)\n if kk == kk[::-1]:\n answer += 1\n\nprint(answer)", "passed": true, "time": 0.15, "memory": 14100.0, "status": "done"}, {"code": "a, b = (int(i) for i in input().split())\nans = 0\nfor i in range(a, b + 1):\n str_i = str(i)\n if str_i[0] == str_i[-1] and str_i[1] == str_i[-2]: ans += 1\nprint(ans)", "passed": true, "time": 0.16, "memory": 14212.0, "status": "done"}, {"code": "a, b = input().split()\n\ncount = 0\nfor i in range(int(a), int(b) + 1):\n mylist = list(str(i))\n if mylist[0] == mylist[4] and mylist[1] == mylist[3]:\n count +=1\n\nprint(count)\n", "passed": true, "time": 0.16, "memory": 14112.0, "status": "done"}, {"code": "A, B = list(map(int, input().split()))\nans = 0\n\nfor nums in range(A, B + 1):\n nums = str(nums)\n if nums == nums[::-1]:\n ans += 1\n\nprint(ans)\n", "passed": true, "time": 0.17, "memory": 14196.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nans = 0\nfor i in range(a, b+1):\n if str(i)[0] == str(i)[4] and str(i)[1] == str(i)[3]:\n ans += 1\nprint(ans)", "passed": true, "time": 0.17, "memory": 14304.0, "status": "done"}, {"code": "A,B = map(int,input().split())\n\ncnt = 0\nfor i in range(A,B+1):\n i = str(i)\n if i == i[::-1]:\n cnt += 1\n \nprint(cnt)", "passed": true, "time": 0.16, "memory": 14372.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\nans = 0\nfor i in range(A, B+1):\n if str(i) == str(i)[::-1]:\n ans += 1\nprint(ans)", "passed": true, "time": 0.17, "memory": 14316.0, "status": "done"}, {"code": "#from statistics import median\n#import collections\n#aa = collections.Counter(a) # list to list || .most_common(2)\u3067\u6700\u5927\u306e2\u500b\u3068\u308a\u3060\u305b\u308b\u304a a[0][0]\nfrom math import gcd\nfrom itertools import combinations,permutations,accumulate, product # (string,3) 3\u56de\n#from collections import deque\nfrom collections import deque,defaultdict,Counter\nimport decimal\nimport re\nimport math\nimport bisect\nimport heapq\n#\n#\n#\n# python\u3067\u7121\u7406\u306a\u3068\u304d\u306f\u3001pypy\u3067\u3084\u308b\u3068\u6b63\u89e3\u3059\u308b\u304b\u3082\uff01\uff01\n#\n#\n# my_round_int = lambda x:np.round((x*2 + 1)//2)\n# \u56db\u6368\u4e94\u5165g\n#\n# \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u7cfb\n# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);\n# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);\n#\n#\nimport sys\nsys.setrecursionlimit(10000000)\nmod = 10**9 + 7\n# mod = 9982443453\n# mod = 998244353\nINF = float('inf')\nfrom sys import stdin\nreadline = stdin.readline\ndef readInts():\n return list(map(int,readline().split()))\ndef readTuples():\n return tuple(map(int,readline().split()))\ndef I():\n return int(readline())\na,b = readInts()\nans = 0\nfor num in range(a,b+1):\n s = str(num)\n if s == s[::-1]:\n ans += 1\nprint(ans)\n", "passed": true, "time": 0.16, "memory": 14072.0, "status": "done"}, {"code": "a,b=list(map(int,input().split()))\n\nc=0\nfor i in range(a,b+1):\n s=str(i)\n if s==s[::-1]:\n c+=1\nprint(c)\n", "passed": true, "time": 0.16, "memory": 14300.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\na, b = list(map(int, input().split()))\n\nans = 0\nfor i in range(a, b+1):\n i = str(i)\n if i[0] == i[-1] and i[1] == i[-2]:\n ans += 1\n\nprint(ans)\n", "passed": true, "time": 0.4, "memory": 14208.0, "status": "done"}, {"code": "a,b=map(int, input().split()) \ncnt=0\nfor i in range(a,b+1):\n if i//10000==i%10 and (i//1000)%10==(i%100)//10:\n cnt+=1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "A, B =list(map(int, input().split()))\nnum_palin = [0] * (B+1)\nfor i in range(1,B+1):\n if str(i) == str(i)[::-1]:\n num_palin[i] = num_palin[i-1] + 1\n else:\n num_palin[i] = num_palin[i-1]\nprint((num_palin[B]-num_palin[A-1]))\n", "passed": true, "time": 0.2, "memory": 14096.0, "status": "done"}, {"code": "a,b = input().split()\ncnt = 0\nfor n in range(int(a),int(b)+1):\n if str(n) == str(n)[::-1]:\n cnt += 1\nprint(cnt)", "passed": true, "time": 0.17, "memory": 14284.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nresult = 0\nfor x in range(a, b+1):\n if str(x) == ''.join(reversed(str(x))):\n result += 1\nprint(result)", "passed": true, "time": 0.19, "memory": 14128.0, "status": "done"}, {"code": "A, B = map(str, input().split())\nl = list(range(int(A), int(B)+1))\nc = 0\nfor i in l:\n t = str(i)\n if t[0] == t[4] and t[1] == t[3]:\n c += 1\nprint(c)", "passed": true, "time": 0.16, "memory": 15412.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nans = 0\nfor i in range(a,b+1):\n s = str(i)\n if s[0] == s[4] and s[1] == s[3]:\n ans += 1\nprint(ans)", "passed": true, "time": 0.16, "memory": 14108.0, "status": "done"}, {"code": "a,b = map(int,input().split())\ncnt = 0\nfor i in range(a,b+1):\n if str(i)==str(i)[::-1]:\n cnt += 1\nprint(cnt)", "passed": true, "time": 0.18, "memory": 14176.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nans = 0\nfor i in range(a,b+1):\n c = str(i)\n if c[0] == c[4] and c[1] == c[3]:\n ans += 1\nprint(ans)", "passed": true, "time": 0.27, "memory": 14200.0, "status": "done"}, {"code": "A,B=list(map(int,input().split()))\nans=0\nfor x in range(A,B+1):\n S=str(x)\n if S==S[::-1]:\n ans+=1\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14128.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\n\nans = 0\nfor x in range(a, b + 1):\n if x // 10000 == x % 10 and (x // 1000) % 10 == (x // 10) % 10:\n ans += 1\nprint(ans)\n", "passed": true, "time": 0.16, "memory": 14340.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\ncnt = 0\n\nfor i in range(a,b+1):\n lis_i = list(str(i))\n lis_i.reverse()\n rev_i = int(''.join(lis_i))\n if rev_i == i:\n cnt += 1\n \nprint(cnt)\n", "passed": true, "time": 0.17, "memory": 14220.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\nc = \"\"\nd = \"\"\nans = 0\nfor i in range(a,b+1):\n c = str(i)\n d = c[::-1]\n if c == d:\n ans += 1\nprint(ans)\n\n\n\n", "passed": true, "time": 0.16, "memory": 14220.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\ncnt = 0\n\nfor i in range(b-a+1):\n r = str(a+i)[::-1]\n if a+i == int(r):\n cnt += 1\nprint(cnt)\n", "passed": true, "time": 0.17, "memory": 14240.0, "status": "done"}, {"code": "A, B = list(map(int, input().split()))\nans = 0\nfor i in range(A, B + 1):\n S = str(i)\n N = len(S)\n if all(S[i] == S[-i - 1] for i in range(N // 2)):\n ans += 1\nprint(ans)\n", "passed": true, "time": 0.19, "memory": 14080.0, "status": "done"}, {"code": "def mapt(fn, *args):\n return tuple(map(fn, *args))\n\n\ndef Input():\n return mapt(int, input().split(\" \"))\n\n\ndef main():\n a, b = Input()\n ans = 0\n for i in range(a, b + 1):\n str_i = list(str(i))\n if str_i[0] == str_i[-1] and str_i[1] == str_i[-2]:\n ans += 1\n print(ans)\n\n\nmain()", "passed": true, "time": 0.28, "memory": 14212.0, "status": "done"}, {"code": "A,B=map(int,input().split())\n\ndef ans090(A:int, B:int):\n count=0\n for i in range(A,B+1):\n if str(i)[0]==str(i)[-1] and str(i)[1]==str(i)[-2]:\n count+=1\n return count\n\nprint(ans090(A,B))", "passed": true, "time": 0.16, "memory": 14168.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nans=0\nfor i in range(a,b+1):\n i=str(i)\n if i==i[::-1]:\n ans+=1\nprint(ans)", "passed": true, "time": 0.16, "memory": 14124.0, "status": "done"}, {"code": "a,b = list(map(int, input().split()))\n\nans = 0\nfor i in range(a, b+1):\n s = str(i)\n ok = True\n for j in range(2):\n ok = ok and s[j] == s[4-j]\n if ok:\n ans += 1\n\nprint(ans)\n", "passed": true, "time": 0.16, "memory": 14096.0, "status": "done"}, {"code": "def isPal(s):\n s = str(s)\n n = len(s)\n f = 1\n for i in range(n//2):\n f &= s[i] == s[n-i-1]\n return f\n\na, b = list(map(int, input().split()))\n\nans = 0\nfor i in range(a, b+1):\n if(isPal(i)):\n ans += 1\n\nprint(ans)\n\n", "passed": true, "time": 0.32, "memory": 14080.0, "status": "done"}, {"code": "A,B=map(int,input().split())\nresult=0\nfor i in range(A,B+1):\n i=str(i)\n for j in range(int(((len(i))-1)/2)+1):\n if not i[j]==i[-j-1]:\n break\n else:\n result+=1\nprint(result)", "passed": true, "time": 0.17, "memory": 14196.0, "status": "done"}, {"code": "A, B = list(map(int, input().split()))\n\nans = 0\n\nfor i in range(A, B+1, 1):\n x = list(str(i))\n if x[0] == x[4] and x[1] == x[3]:\n ans += 1\nelse:\n print(ans)\n", "passed": true, "time": 0.18, "memory": 14288.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\ncnt = 0\nfor i in range(a, b+1, 1):\n i = str(i)\n if i[0] == i[4] and i[1] == i[3]:\n cnt += 1\n else:\n continue\n\nprint(cnt)", "passed": true, "time": 0.16, "memory": 14304.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\nres = 0\nfor i in range(a, b + 1):\n str_i = str(i)\n if str_i[0] == str_i[-1] and str_i[1] == str_i[-2]:\n res += 1\n\nprint(res)\n", "passed": true, "time": 0.16, "memory": 14096.0, "status": "done"}, {"code": "def reverse(num):\n test_num = 0\n while (num > 0):\n remainder = num % 10\n test_num = (test_num * 10) + remainder\n num = num // 10\n return test_num\n\na,b = list(map(int,input().split()))\nc = 0\nfor i in range(a,b+1):\n if i == reverse(i):\n c+=1\nprint(c)", "passed": true, "time": 0.28, "memory": 14108.0, "status": "done"}, {"code": "a,b=map(int,input().split())\ncount = 0\nfor i in range(a,b+1):\n if str(i)[0]==str(i)[4] and str(i)[1]==str(i)[3]:\n count+=1\nprint(count)", "passed": true, "time": 0.24, "memory": 14088.0, "status": "done"}, {"code": "a, b = map(int, input().split())\ncnt = 0\nfor i in range(a, b+1):\n i = str(i)\n if i[0] == i[-1] and i[1] == i[-2]:\n cnt += 1\nprint(cnt)", "passed": true, "time": 0.16, "memory": 14276.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nans = 0\n\nfor i in range(a//10000, b//10000+1):\n for j in range(0,10):\n for k in range(0,10):\n x = i*10001 + j*1010 + k*100\n if a<=x<=b:\n ans+=1\nprint(ans, flush=True)\n\n", "passed": true, "time": 0.22, "memory": 14204.0, "status": "done"}, {"code": "A, B = list(map(int, input().split()))\ncnt = 0\nfor num in range(A, B+1):\n num = list(str(num))\n for i in range(len(num)//2):\n if num[i] != num[len(num)-i-1]:\n break\n else:\n cnt += 1\nprint(cnt)\n", "passed": true, "time": 0.19, "memory": 14196.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint(sum(num == num[::-1] for num in map(str,range(a, b+1))))", "passed": true, "time": 0.25, "memory": 14080.0, "status": "done"}, {"code": "A,B= map(int,input().split())\n\nans=0\n\nfor i in range(A,B+1):\n for j in range(len(str(i))):\n zen = j\n kou = len(str(i))-1-j\n if zen >= kou:\n ans+=1\n break\n if str(i)[zen] != str(i)[kou]:\n break\n \nprint(ans)", "passed": true, "time": 0.23, "memory": 14084.0, "status": "done"}, {"code": "A, B = map(int,input().split())\nans_cou = 0\nfor i in range(A, B + 1):\n str_i = str(i)\n reverse_str_i = ''.join(list(reversed(str_i)))\n reverse_int_i = int(reverse_str_i)\n if i == reverse_int_i:\n ans_cou += 1\nprint(ans_cou)", "passed": true, "time": 0.2, "memory": 14324.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nans = []\nfor i in range(a, b + 1):\n c = [j for j in str(i)]\n if c[0] == c[-1] and c[1] == c[-2]:\n ans.append(i)\nprint(len(ans))", "passed": true, "time": 0.17, "memory": 14100.0, "status": "done"}, {"code": "A,B=map(int,input().split())\ncount=0\nfor i in range(A,B+1):\n if str(i)[0:2] == str(i)[::-1][:2]: count += 1\nprint(count)", "passed": true, "time": 0.19, "memory": 14084.0, "status": "done"}, {"code": "def kaibun(n):\n if str(n)[0]==str(n)[-1] and str(n)[1]==str(n)[-2]:\n return True\n else:\n return False\n\na,b=map(int,input().split())\nans=0\nfor i in range(a,b+1):\n if kaibun(i):\n ans+=1\nprint(ans)", "passed": true, "time": 0.26, "memory": 14072.0, "status": "done"}, {"code": "def answer(a: int, b: int) -> int:\n count = 0\n for i in range(a, b + 1):\n i_str = str(i)\n if i_str[0] == i_str[-1] and i_str[1] == i_str[-2]:\n count += 1\n\n return count\n\n\ndef main():\n a, b = list(map(int, input().split()))\n print((answer(a, b)))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.16, "memory": 14092.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nans = 0\nfor i in range(a, b+1):\n s = str(i)\n if s == s[::-1]:\n ans += 1\nprint(ans)", "passed": true, "time": 0.18, "memory": 14052.0, "status": "done"}, {"code": "a,b=map(int,input().split())\n\ncnt=0\nfor i in range(1,10):\n for j in range(0,10):\n for k in range(0,10):\n num=int(str(i)+str(j)+str(k)+str(j)+str(i))\n if a<=num<=b:\n cnt+=1\n \nprint(cnt)", "passed": true, "time": 0.16, "memory": 14204.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\nans = 0\nfor i in range(a,b+1):\n key = str(i)\n #print(key)\n if key[:2] == key[4]+key[3]:\n ans += 1\nprint(ans)\n", "passed": true, "time": 0.17, "memory": 14076.0, "status": "done"}, {"code": "a, b = map(int, input().split())\ncnt = 0\nfor i in range(a, b+1):\n\ts = str(i)\n\tif s[0] == s[4] and s[1] == s[3]:\n\t\tcnt += 1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14260.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\nk = 0\n\nfor i in range(a,b+1):\n if str(i) == ''.join(list(reversed(str(i)))):\n k += 1\n\nprint(k)\n", "passed": true, "time": 0.18, "memory": 14088.0, "status": "done"}, {"code": "a,b=map(int,input().split())\ntotal=0\nfor i in range(a,b+1):\n x=str(i)\n y=int(x[::-1])\n if i==y:\n total+=1\nprint(total)", "passed": true, "time": 0.16, "memory": 14084.0, "status": "done"}, {"code": "a,b=map(int,input().split())\ncnt = 0\nfor i in range(a,b+1):\n i = str(i)\n if i == i[::-1]:\n cnt +=1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14356.0, "status": "done"}, {"code": "a,b = map(int, input().split())\ncnt = 0\nfor i in range(a, b+1):\n l,r = list(str(i))[:3], list(str(i))[2:][::-1]\n if l == r: cnt += 1\nprint(cnt)", "passed": true, "time": 0.19, "memory": 14228.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nc = 0\nfor i in range(a,b+1):\n if str(i)[0] == str(i)[-1] and str(i)[1] == str(i)[-2]:\n c += 1\nprint(c)", "passed": true, "time": 0.16, "memory": 14112.0, "status": "done"}, {"code": "N = {} #10000\u4ee5\u4e0akey\u4ee5\u4e0b\u306e\u56de\u6587\u6570\u306e\u500b\u6570\ncnt = 0\nfor i in range(10000, 100000):\n L = list(str(i))\n if L == list(reversed(L)):\n cnt += 1\n N[i] = cnt\nA, B = map(int, input().split())\nprint(N[B]-N[A-1] if A > 10000 else N[B])", "passed": true, "time": 0.29, "memory": 25404.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nans = 0\nfor i in range(a,b+1):\n x = str(i)\n y = x[::-1]\n if x == y:\n ans += 1\nprint(ans)", "passed": true, "time": 0.16, "memory": 14300.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nc = 0\nfor i in range(a, b+1):\n s = str(i)\n if s == s[::-1]:\n c += 1\nprint(c)", "passed": true, "time": 0.16, "memory": 14276.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\ncount = 0\nfor i in range(a,b+1):\n s = str(i)\n if s == s[::-1]:\n count += 1\nprint(count)\n", "passed": true, "time": 0.29, "memory": 14192.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\ndef judege_palindromic(val_str):\n length = len(val_str)\n match = True\n for i in range(length//2):\n if val_str[i] != val_str[length-i-1]:\n match = False\n break\n\n return match \n\n\nA, B = map(int, input().split())\n\ncnt = 0\nfor i in range(A, B+1, 1):\n if judege_palindromic(str(i)):\n cnt += 1\n\nprint(cnt)", "passed": true, "time": 0.4, "memory": 14192.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\ncnt = 0\nfor i in range(A, B + 1):\n if str(i) == str(i)[::-1]:\n cnt += 1\nprint(cnt)", "passed": true, "time": 0.33, "memory": 14064.0, "status": "done"}, {"code": "a,b = [int(x) for x in input().split()]\n\ndef check(p):\n p = str(p)\n if p[0] == p[4] and p[1] == p[3]:\n return True\n return False\n\nres = 0\nfor i in range(a,b+1):\n if check(i):\n res += 1\nprint(res)", "passed": true, "time": 0.23, "memory": 14304.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\ncnt = 0\nl = []\nnewl = []\n\nfor i in range(a, b+1):\n l = []\n while (i > 0):\n l.append(i%10)\n i//=10\n newl = l[::-1]\n if (l == newl):\n cnt+=1\nprint(cnt)\n", "passed": true, "time": 0.35, "memory": 14088.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nans=0\nfor i in range(a,b+1):\n if str(i)==str(i)[::-1]:\n ans += 1\nprint(ans)", "passed": true, "time": 0.46, "memory": 14264.0, "status": "done"}, {"code": "#-*-coding:utf-8-*-\nimport sys\ninput=sys.stdin.readline\n\ndef main():\n numbers=[]\n a,b = map(int,input().split())\n numbers=list(range(a,b+1))\n count=0\n\n for number in numbers:\n if str(number)[0]==str(number)[-1] and str(number)[1]== str(number)[3]:\n count+=1\n print(count)\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.17, "memory": 15460.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\ncnt = 0\n\nfor i in range(A, B+1):\n l = list(str(i))\n if l[0] == l[4] and l[1] == l[3]:\n cnt += 1\n\nprint(cnt)", "passed": true, "time": 0.16, "memory": 14068.0, "status": "done"}, {"code": "a,b=input().split()\na=int(a)\nb=int(b)\nc=0\nfor i in range(a,b+1):\n if (i//10000)==(i-(i//10)*10) and (i//1000-(i//10000)*10) ==(i//10-(i//100)*10):\n c=c+1\nprint(c)", "passed": true, "time": 0.15, "memory": 14076.0, "status": "done"}, {"code": "A,B = map(int, input().split())\ncount = 0\nfor i in range(A,B+1):\n i = str(i)\n if i == i[::-1]:\n count += 1\nprint(count)", "passed": true, "time": 0.15, "memory": 14140.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nres = 0\nfor n in range(a, b+1):\n s = str(n)\n if(s == s[::-1]): res += 1\n\nprint(res)", "passed": true, "time": 0.16, "memory": 14212.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\n\ncnt = 0\n\nfor i in range(a, b + 1):\n if str(i) == str(i)[::-1]:\n cnt += 1\n\nprint(cnt)\n", "passed": true, "time": 0.16, "memory": 14320.0, "status": "done"}, {"code": "A, B = map(int,input().split())\nans = 0\n\nfor i in range(A, B+1):\n num = str(i)\n #print(i,num[0:2],num[::-1][0:2])\n if num[0:2] == num[::-1][0:2]:\n ans += 1\nprint(ans)", "passed": true, "time": 0.17, "memory": 14248.0, "status": "done"}, {"code": "a, b = map(int, input().split())\ncount = 0\nfor i in range(a,b+1):\n if list(map(int, list(str(i)))) == list(reversed(list(map(int, list(str(i)))))):\n count += 1\nprint(count)", "passed": true, "time": 0.29, "memory": 14224.0, "status": "done"}, {"code": "a, b = map(int,input().split())\ncount = 0\nfor i in range(1,10):\n for j in range(10):\n for k in range(10):\n if a <= 10000*i+1000*j+100*k+10*j+i <= b:\n count += 1\nprint(count)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nres = 0\nfor i in range(A, B+1):\n if str(i) == str(i)[::-1]:\n res += 1\n \nprint(res)", "passed": true, "time": 0.17, "memory": 14104.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\ncnt = 0\nfor i in range(a, b+1):\n str_i = str(i)\n if str_i[0] == str_i[4] and str_i[1] == str_i[3]:\n cnt += 1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14104.0, "status": "done"}, {"code": "a,b = map(int, input().split())\ncnt = 0\n\nfor i in range(a,b+1):\n if str(i) == str(i)[::-1]:\n cnt += 1\nprint(cnt)", "passed": true, "time": 0.17, "memory": 14176.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\ncnt = 0\nfor i in range(a, b+1):\n s = str(i)\n if s[0] == s[4] and s[1] == s[3]:\n cnt += 1\n\nprint(cnt)\n", "passed": true, "time": 0.16, "memory": 14232.0, "status": "done"}]
[{"input": "11009 11332\n", "output": "4\n"}, {"input": "31415 92653\n", "output": "612\n"}]
4,715
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. -----Constraints----- - 1≦a,b,c≦100 -----Input----- The input is given from Standard Input in the following format: a b c -----Output----- Print the number of different kinds of colors of the paint cans. -----Sample Input----- 3 1 4 -----Sample Output----- 3 Three different colors: 1, 3, and 4.
introductory
[{"code": "a=list(map(int,input().split()))\nprint(len(set(a)))", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "s = list(map(int,input().split()))\nprint(len(set(s)))", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "lst = input().split()\nif len(lst) == len(set(lst)):\n\tprint('3')\nif len(lst)-1 == len(set(lst)):\n\tprint('2')\nif len(lst)-2 == len(set(lst)):\n\tprint('1')\n", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "l = input().split()\nprint((len(set(l))))\n", "passed": true, "time": 0.16, "memory": 14052.0, "status": "done"}, {"code": "print(len(set(input().split())))", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "L=set(list(map(int,input().split())))\nprint(len(L))", "passed": true, "time": 0.17, "memory": 14180.0, "status": "done"}, {"code": "paint_list = set(map(int,input().split()))\nprint(len(paint_list))", "passed": true, "time": 0.98, "memory": 14272.0, "status": "done"}, {"code": "paint_list = map(int,input().split())\nprint(len(set(paint_list)))", "passed": true, "time": 1.06, "memory": 14064.0, "status": "done"}, {"code": "print(len(set(input().split())))", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "a,b,c=input().split()\nls=[a,b,c]\nls.sort()\nif ls[0]==ls[1]==ls[2]:\n print(\"1\")\nelse:\n if ls[0]==ls[1]:\n print(\"2\")\n else:\n if ls[1]==ls[2]:\n print(\"2\")\n else:\n print(\"3\")", "passed": true, "time": 0.27, "memory": 14332.0, "status": "done"}, {"code": "print(len(set(input().split())))", "passed": true, "time": 0.26, "memory": 14260.0, "status": "done"}, {"code": "print(len(set(map(int, input().split()))))", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "abc =list(input().split())\n\nprint(len(set(abc)))", "passed": true, "time": 0.15, "memory": 14252.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nl = list(map(int, input().split()))\nl = set(l)\nprint((len(l)))\n", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nif a == b == c: print(1)\nelif a == b or b == c or c == a: print(2)\nelse: print(3)", "passed": true, "time": 0.22, "memory": 14056.0, "status": "done"}, {"code": "s = set()\nl = list(input().split())\nfor e in l:\n s.add(e)\nprint(len(s))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "a, b, c = list(map(int, input().split()))\ndata = [a]\nif not b in data:\n data.append(b)\nif not c in data:\n data.append(c)\nprint(len(data))", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "print(len(set(input().split())))", "passed": true, "time": 0.21, "memory": 14148.0, "status": "done"}, {"code": "print(len(set(map(int, input().split()))))", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "#\n# abc046 a\n#\n\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"3 1 4\"\"\"\n output = \"\"\"3\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"3 3 33\"\"\"\n output = \"\"\"2\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n a, b, c = list(map(int, input().split()))\n\n ans = 0\n if a == b == c:\n print(\"1\")\n elif a == b or b == c or c == a:\n print(\"2\")\n else:\n print(\"3\")\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "print((len(set(input().split()))))\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "abc=list(map(int,input().split()))\nprint(len(set(abc)))", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "a, b, c = map(int, (input().split()))\nprint(len(set([a, b, c])))", "passed": true, "time": 0.15, "memory": 14076.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\n\nif a==b and b==c:\n ans=1\nelif a==b and b!=c:\n ans=2\nelif a!=b and b==c:\n ans=2\nelif a==c and a!=b:\n ans=2\nelse:\n ans=3\nprint(ans)", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "abc=list(map(int , input().split()))\ncount=0\nfor i in range(0,len(abc)-1):\n abc.sort()\n if(abc[i] != abc[i+1]):\n count+=1\n \n \n \n \nprint(count+1)", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "a = list(input().split())\nans = len(set(a))\nprint(ans)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nans=1\nif b!=a:ans+=1\nif a!=c and b!=c:ans+=1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "s=set(map(int,input().split()))\nprint(len(s))", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "A = list(map(int, input().split()))\nNum = [0]*101\ncnt = 0\nfor i in A:\n Num[i] += 1\n if Num[i] == 1:\n cnt +=1\n \nprint(cnt)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "print(len(set([int(i) for i in input().split()])))", "passed": true, "time": 0.23, "memory": 14156.0, "status": "done"}, {"code": "print(len(set(input().split())))", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nm = set([a, b, c])\nprint(len(m))", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "arr = list(map(int, input().split()))\nprint(len(set(arr)))", "passed": true, "time": 0.15, "memory": 14076.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nprint(len(set(l)))", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "abc = list(map(int,input().split()))\nset_abc = set(abc)\nprint(len(set_abc))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "print(len(set(input().split())))", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "def main():\n c = list(map(int, input().split()))\n\n c_set = set(c)\n print((len(c_set)))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14100.0, "status": "done"}, {"code": "print((len(set(map(int, input().split())))))\n", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\n\nif a == b and b == c:\n print(1)\nelif a == b and b != c:\n print(2)\nelif a != b and b == c:\n print(2)\nelif a == c and a != b:\n print(2)\nelif a != b and b != c:\n print(3)", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "a, b, c = map(int,input().split())\nif a == b == c:\n print(1)\nelif a == b or b == c or c == a:\n print(2)\nelse:\n print(3)", "passed": true, "time": 0.15, "memory": 14328.0, "status": "done"}, {"code": "a,b,c = map( int, input().split())\nif a == b == c :\n print(1)\nelif a!=b==c or b!=c==a or c!=a==b :\n print(2)\nelse:\n print(3)", "passed": true, "time": 0.23, "memory": 14360.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nprint(len(set([a,b,c])))", "passed": true, "time": 0.24, "memory": 14072.0, "status": "done"}, {"code": "print(len(set(map(int, input().split()))))", "passed": true, "time": 0.26, "memory": 14192.0, "status": "done"}, {"code": "print(len(set(map(int,input().split()))))", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "a=set(map(int,input().split()))\nprint(len(a))", "passed": true, "time": 0.15, "memory": 14164.0, "status": "done"}, {"code": "a=set(map(int,input().split()))\nprint(len(a))", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "a=list(map(int, input().split())) \nprint(len(set(a)))", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\nprint(len(set(a)))", "passed": true, "time": 0.15, "memory": 14036.0, "status": "done"}, {"code": "print((len(set(map(int, input().split())))))\n", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\n\ns = set(a)\nprint(len(s))", "passed": true, "time": 0.24, "memory": 14124.0, "status": "done"}, {"code": "a = input().split()\nif a[0] == a[1] == a[2]:\n print(1)\nelif a[0] == a[1] or a[1] == a[2] or a[2] == a[0]:\n print(2)\nelse:\n print(3)", "passed": true, "time": 0.24, "memory": 14212.0, "status": "done"}, {"code": "li=a,b,c=list(map(int,input().split()))\nprint(len(set(li)))", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "a, b, c = list(map(int, input().split()))\n\nif a == b == c:\n print((1))\nelif a == b or b == c or a == c:\n print((2))\nelse:\n print((3))\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\na = set(a)\nprint(len(a))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\n\nprint(len(set([a, b, c])))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a = list(map(int,input().split()))\n\nprint(len(set(a)))", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nprint(len(set([a,b,c])))", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "print(len(set(list(map(int,input().split())))))", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "#ABC046\ns = input().split()\nprint(len(set(s)))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nprint(len(set([a,b,c])))", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "al = list(map(int, input().split()))\nprint((len(set(al))))\n\n", "passed": true, "time": 0.15, "memory": 14040.0, "status": "done"}, {"code": "def solve():\n print(len(set(input().split())))\n\n\ndef __starting_point():\n solve()\n__starting_point()", "passed": true, "time": 0.24, "memory": 14008.0, "status": "done"}, {"code": "C=list(map(int,input().split()))\nC=set(C)\nprint(len(C))", "passed": true, "time": 0.15, "memory": 14184.0, "status": "done"}, {"code": "print(len(set(input().split())))", "passed": true, "time": 0.24, "memory": 14296.0, "status": "done"}, {"code": "import collections\n\nn = list(input().split())\n\nc = collections.Counter(n)\n\nprint(len(c))", "passed": true, "time": 0.29, "memory": 14188.0, "status": "done"}, {"code": "a = set(map(int,input().split()))\n\nprint((len(a)))\n\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "\ns = input().split()\ns = set(s)\n\nprint(len(s))", "passed": true, "time": 0.23, "memory": 14308.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\n\nif a==b==c:\n print(\"1\")\nelif a==b or b==c or c==a:\n print(\"2\")\nelse:\n print(\"3\")", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "a=set(input().split())\nprint(len(a))", "passed": true, "time": 0.26, "memory": 14224.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nif a == b and b == c:\n print(1)\nelif a != b and b != c and c != a:\n print(3)\nelse:\n print(2)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\nif a==b==c:\n print(\"1\")\nelif a!=b and a!=c and b!=c:\n print(\"3\")\nelse:\n print(\"2\")", "passed": true, "time": 0.26, "memory": 14100.0, "status": "done"}, {"code": "a = list(input().split())\nif a[0] == a[1] and a[1] == a[2]:\n print(1)\nelif a[0] == a[1] or a[1] == a[2] or a[2] == a[0]:\n print(2)\nelse:\n print(3)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "data=list(input().split())\ns=1\nfor i in range(1,len(data)):\n for j in range(0,i):\n if data[i]==data[j]:\n data[i]=-1\n if data[i]!=-1:\n s=s+1 \nprint(s)\n\n", "passed": true, "time": 0.23, "memory": 14196.0, "status": "done"}, {"code": "a = list(input().split())\nprint(len(set(a)))", "passed": true, "time": 0.23, "memory": 14188.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\nprint(len(set(a)))", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "import collections\ncolor = map(int, input().split())\nprint(len(collections.Counter(color)))", "passed": true, "time": 0.23, "memory": 14048.0, "status": "done"}, {"code": "def iroha():\n a, b, c = list(map(int, input().split()))\n if a == b and b == c and a == c:\n print((1))\n elif a != b and b != c and a != c:\n print((3))\n else:\n print((2))\n\ndef __starting_point():\n iroha()\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "a, b, c=map(int, input().split(\" \"))\nink=[a, b, c]\nprint(len(set(ink)))", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "N = map(int,input().split())\nprint(len(set(N)))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "penki=list(map(int,input().split()))\nans=len(set(penki))\nprint(ans)", "passed": true, "time": 0.15, "memory": 14076.0, "status": "done"}, {"code": "print(len(set(map(int, input().split()))))", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "a = [*map(int,input().split())]\nprint(len(set(a)))", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "paint_list = input().split()\nprint(len(set(paint_list)))", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "ary = list(map(int, input().split()))\nprint(len(set(ary)))", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "paint = map(int,input().split())\nprint(len(set(paint)))", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "print(len(set(map(int,input().split()))))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nif a == b == c:\n print(1)\nelif a == b or b == c or c == a:\n print(2)\nelse:\n print(3)", "passed": true, "time": 0.9, "memory": 14100.0, "status": "done"}, {"code": "l = list(map(int, input().split()))\nprint(len(set(l)))", "passed": true, "time": 0.48, "memory": 14140.0, "status": "done"}, {"code": "a,b,c=map(int,input().split())\ns={a,b,c}\nprint(len(s))", "passed": true, "time": 0.57, "memory": 14072.0, "status": "done"}, {"code": "a = list(map(int, input().split()))\n\nprint(len(set(a)))", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\ncount = 3\n\nif a == b == c:\n print(1)\n return\nif a == b:\n count -=1\nif a == c:\n count -=1\nif b == c:\n count -=1\nprint(count)", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "a = map(int, input().split())\npaint_list = list(a)\n\nif paint_list[0] == paint_list[1] == paint_list[2]:\n print(1)\nelif paint_list[0] == paint_list[1] and paint_list[0] != paint_list[2]:\n print(2)\nelif paint_list[0] == paint_list[2] and paint_list[0] != paint_list[1]:\n print(2)\nelif paint_list[1] == paint_list[2] and paint_list[0] != paint_list[1]:\n print(2)\nelse:\n print(3)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "def si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lint(): return list(map(int, input().split()))\ndef lint_dec(): return list(map(lambda x:int(x) - 1, input().split()))\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef dfs_input(G, m):\n for _ in range(m):\n a, b = lint_dec()\n G[a].append(b)\n G[b].append(a)\n\n\n###################################\nprint(len(set(lint())))", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "str_line = input().split(\" \")\nnum_line = [int(n) for n in str_line]\n\nnum_line.sort()\nnum_list = [num_line[0]]\nfor i in range(1,len(num_line)):\n if num_line[i] != num_line[i-1]:\n num_list.append(num_line[i])\n\n#print(num_list)\nprint(len(num_list))", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "import sys\ninput = lambda: sys.stdin.readline().rstrip()\n\ndef main():\n x = list(map(int, input().split()))\n print(len(set(x)))\n \ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\nst = set()\nst.add(a)\nst.add(b)\nst.add(c)\nprint(len(st))", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "a, b, c = list(map(int, input().split()))\nL = []\nL.append(a)\nL.append(b)\nL.append(c)\n\nL = list(set(L))\n\nprint((len(L)))\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "a, b, c = list(map(int, input().split()))\n\nif a == b:\n if b == c:\n print((1))\n else:\n print((2))\nelif b == c:\n print((2))\nelif a == c:\n print((2))\nelse:\n print((3))\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}]
[{"input": "3 1 4\n", "output": "3\n"}, {"input": "3 3 33\n", "output": "2\n"}]
4,716
Snuke has N sticks. The length of the i-th stick is l_i. Snuke is making a snake toy by joining K of the sticks together. The length of the toy is represented by the sum of the individual sticks that compose it. Find the maximum possible length of the toy. -----Constraints----- - 1 \leq K \leq N \leq 50 - 1 \leq l_i \leq 50 - l_i is an integer. -----Input----- Input is given from Standard Input in the following format: N K l_1 l_2 l_3 ... l_{N} -----Output----- Print the answer. -----Sample Input----- 5 3 1 2 3 4 5 -----Sample Output----- 12 You can make a toy of length 12 by joining the sticks of lengths 3, 4 and 5, which is the maximum possible length.
introductory
[{"code": "N,K=map(int,input().split())\nl=list(map(int,input().split()))\nl.sort(reverse=True)\nsum=0\nfor i in range(K) :\n sum+=l[i]\nprint(sum)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n,k=map(int,input().split())\ndata=list(map(int,input().split()))\ny=sorted(data)\ns=0\nfor i in range(0,k):\n s=s+y[n-1-i]\nprint(s)", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nl=list(map(int,input().split()))\nl.sort()\nal=sum(l)\nfor i in range(n-k):\n al -= l[i]\nprint(al)", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = list(map(int, input().split()))\n\nl = sorted(l, reverse=True)\nprint(sum(l[:k]))", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = [int(s) for s in input().split()]\n\nl.sort(reverse=True)\nlength = 0\nfor i in range(k):\n length += l[i]\nprint(length)", "passed": true, "time": 0.16, "memory": 14180.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\nL=list(map(int,input().split()))\nL.sort()\ns=0\nfor i in range(n-k):\n s+=L[i]\n\nprint((sum(L)-s))\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n,k=map(int, input().split())\nl=list(map(int, input().split()))\nl.sort(reverse=True)\nprint(sum(l[:k]))", "passed": true, "time": 0.16, "memory": 14040.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\nfinal = list(map(int, input().split()))\n\nfinal.sort(reverse = True)\nprint((sum(final[:b])))\n", "passed": true, "time": 0.85, "memory": 14044.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\nl=list(map(int,input().split()))\n\nL=sorted(l)\n\nprint((sum(L[(n-k):])))\n\n", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "# \u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u306e\u6574\u6570\u306e\u5165\u529b\nn, k = map(int, input().split())\n# \u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u306e\u6574\u6570\u306e\u5165\u529b\ndata = list(map(int, input().split()))\nl = sorted(data, reverse=True)\nans = 0\n\nfor i in range(k):\n ans += l[i]\n\nprint(ans)", "passed": true, "time": 0.24, "memory": 14152.0, "status": "done"}, {"code": "a,b=input().split()\na=int(a)\nb=int(b)\nc=list(map(int,input().split()))\nc.sort()\nd=0\nfor i in range(b):\n d=d+c[-i-1]\nprint(d)", "passed": true, "time": 0.18, "memory": 14088.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nl = list(map(int, input().split()))\nl.sort()\nprint(sum(l[-K:]))", "passed": true, "time": 0.24, "memory": 14064.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nl = list(map(int,input().split()))\nl.sort(reverse = True)\nans = 0\nfor i in range(k):\n ans += l[i]\nprint(ans)", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nls = list(map(int, input().split()))\nprint(sum(sorted(ls, reverse=True)[:K]))", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\nprint((sum(sorted(map(int, input().split()), reverse=True)[:K])))\n", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "from typing import List\n\n\ndef answer(n: int, k: int, l: List[int]) -> int:\n l.sort(reverse=True)\n return sum(l[:k])\n\n\ndef main():\n n, k = list(map(int, input().split()))\n l = list(map(int, input().split()))\n print((answer(n, k, l)))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 15204.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\nN, K = map(int, input().split())\nl = list(map(int, input().split()))\n\nl_sorted = sorted(l, reverse=True)\ntotal = 0\nfor i in range(K):\n total += l_sorted[i]\n\nprint(total)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "lst = input().split()\nN = int(lst[0])\nK = int(lst[1])\n\nL = input().split()\nfor i in range(N):\n L[i] = int(L[i])\n\nL.sort(reverse=True)\n\nans = 0\n\nfor i in range(K):\n ans += L[i]\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n,k = map(int,input().split())\ndata = list(map(int,input().split()))\ndata.sort(reverse = True)\nans = 0\nfor i in range(k):\n ans += data[i]\nprint(ans)", "passed": true, "time": 0.23, "memory": 14244.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nL = list(map(int,input().split()))\nprint((sum(sorted(L, reverse=True)[:k])))\n", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nl = [int(l_) for l_ in input().split()]\nl.sort(reverse=True)\nprint(sum(l[0:K]))", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "N,K = map (int, input ().split ())\nl = [int (x) for x in input().split()]\nlist.sort (l)\nx = 0\nfor i in range (K):\n x += l[-i-1]\nprint (x)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "N, K = map(int,input().split())\nl = list(map(int,input().split()))\n\nl.sort(reverse=True)\nl_max3 = l[0 : K]\nprint(sum(l_max3))", "passed": true, "time": 0.14, "memory": 14016.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = sorted(list(map(int, input().split())), reverse=True)\nprint(sum(l[:k]))", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "def abc067b_snake_toy():\n n, k = map(int, input().split())\n l = sorted(list(map(int, input().split())), reverse=True)\n print(sum(l[0:k]))\n\nabc067b_snake_toy()", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "n,k = list(map(int, input().split()))\nli = list(map(int, input().split()))\nli.sort(reverse=True)\nsum = 0\nfor i in range(k):\n sum += li[i]\nprint(sum)\n\n", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = list(map(int, input().split()))\nl.sort()\nprint(sum(l[-k:]))", "passed": true, "time": 0.15, "memory": 14200.0, "status": "done"}, {"code": "n,k = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\nprint(sum(a[-k:]))", "passed": true, "time": 0.15, "memory": 14128.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\nL = sorted(list(map(int, input().split())), reverse=True)\nans = 0\nfor i in range(K):\n ans += L[i]\nprint(ans)\n", "passed": true, "time": 0.53, "memory": 14320.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nl = sorted(list(map(int, input().split())))\nl.reverse()\n\n\nprint(sum(l[:K]))", "passed": true, "time": 0.15, "memory": 14200.0, "status": "done"}, {"code": "n, k = map(int,input().split())\na = list(map(int,input().split()))\na.sort(reverse=True)\n\nans = 0\nfor i in range(k):\n ans += a[i]\nprint(ans)", "passed": true, "time": 0.3, "memory": 14140.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = list(map(int, input().split()))\nl.sort(reverse = True)\ncnt = 0\nfor i in range(k):\n cnt += l[i]\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nL = sorted(list(map(int, input().split())), reverse=True)\n\nprint(sum(L[0:k]))", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "n,k=list(map(int ,input().split()))\nl=list(map(int ,input().split()))\nans=0\nsorted_l=l.sort()\nl.reverse()\nfor i in range(0,k):\n\tans+=l[i]\n\t\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\nL = sorted(list(map(int, input().split())), reverse=True)\n\nprint((sum(L[:K])))\n\n\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n,k=map(int, input().split())\nl=list(map(int,input().split()))\nl.sort()\nl.reverse()\nassert l.__len__()==n\nans=0\nfor i in range(k):\n ans+=l[i]\nprint(ans)", "passed": true, "time": 0.21, "memory": 14356.0, "status": "done"}, {"code": "n,k = map(int, input().split())\nl = list(map(int, input().split()))\nl.sort(reverse=True)\nprint(sum(l[0:k]))", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nl = sorted(map(int, input().split()))[::-1]\nsum = 0\ncount = 0\n\nfor L in l:\n count += 1\n sum += L\n if count == K:\n break\n \nprint(sum)", "passed": true, "time": 0.23, "memory": 14236.0, "status": "done"}, {"code": "N_hon, K_part = map(int, input().split())\nlength = list(map(int, input().split()))\n\nlength.sort()\nans = sum(length[-K_part:])\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nnum_list = list(map(int, input().split()))\n\nprint(sum(sorted(num_list, reverse=True)[:K]))", "passed": true, "time": 0.23, "memory": 14024.0, "status": "done"}, {"code": "import sys\nfrom typing import List\n\nn, k = list(map(int, input().split()))\nll = list(map(int, input().split()))\n\nbar = sorted(ll)[::-1]\n#bar2 = bar[::-1]\nans = sum(bar[0:k])\n\nprint(ans)\n", "passed": true, "time": 0.16, "memory": 15032.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nl = sorted(list(map(int,input().split())),reverse=True)\nprint(sum(l[:k]))", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = list(map(int, input().split()))\nl = sorted(l)\nx = 0\nfor i in range(-1, -1-k, -1):\n x += l[i]\nprint(x)", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nl = list(map(int, input().split()))\nnew_l = sorted(l, reverse=True)\n\nprint(sum(new_l[0:K]))", "passed": true, "time": 0.15, "memory": 14316.0, "status": "done"}, {"code": "N, K = map(int,input().split())\nL = list(map(int,input().split()))\nL.sort(reverse=True)\n\nprint(sum(L[:K]))", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nlst = list(map(int, input().split()))\nlst.sort(reverse = True)\nans = 0\nfor i in range(0, k):\n ans += lst[i]\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "N, K=list(map(int, input().split()))\nl=list(map(int, input().split()))\nl.sort()\nprint((sum(l[-K:])))\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nl = sorted(list(map(int, input().split())), reverse=True)\nres = l[:k]\nprint((sum(res)))\n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nl=list(map(int,input().split()))\n\nl2=sorted(l, reverse=True)\nlength = sum(l2[0:k])\nprint(length)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "n,k = map(int,input().split())\na = sorted(map(int,input().split()))\na.reverse()\nprint(sum(a[:k]))", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\nN,K = list(map(int, input().split()))\nj = list(map(int, input().split()))\nans = 0\n\nj.sort()\nfor i in range(K):\n ans += j.pop()\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14016.0, "status": "done"}, {"code": "#n = int(input())\nn, k = list(map(int, input().split()))\nl = list(map(int, input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\n\nl.sort(reverse=True)\nprint((sum(l[:k])))\n", "passed": true, "time": 0.2, "memory": 14020.0, "status": "done"}, {"code": "n,k=map(int, input().split())\nl=list(map(int,input().split()))\nl.sort()\nprint(sum(l[-k:]))", "passed": true, "time": 0.23, "memory": 14280.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\nl = sorted(map(int, input().split()), reverse=True)\n\nans = 0\nfor i in range(K):\n ans += l[i]\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n,k = map(int,input().split())\na = sorted(map(int,input().split()))[::-1]\nprint(sum(a[:k]))", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nl=[int(x) for x in input().split()]\nl.sort(reverse=True)\nprint(sum(l[0:k]))", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = list(map(int, input().split()))\n\n\nl.sort(reverse=True)\nans = sum(l[:k])\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "n, k = (int(x) for x in input().split())\nL = [int(x) for x in input().split()]\nans = sum(sorted(L, reverse=True)[:k])\nprint(ans)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "N,K=map(int,input().split())\nl=list(map(int,input().split()))\nl.sort(reverse=True)\nprint(sum(l[0:K]))", "passed": true, "time": 0.14, "memory": 14020.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nc=input().split()\nc=[int(i) for i in c]\nx=0\nc.sort()\nfor i in range(b):\n x+=c[len(c)-i-1]\nprint(x)", "passed": true, "time": 0.22, "memory": 14100.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = list(map(int, input().split()))\nprint(sum(sorted(l, reverse=True)[0:k]))", "passed": true, "time": 0.15, "memory": 14204.0, "status": "done"}, {"code": "\nN, K = map(int, input().split())\nl = sorted(list(map(int, input().split())), reverse=True)\nprint(sum(l[:K]))", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nli = list(map(int,input().split()))\nli.sort(reverse=True)\ntol = 0\nfor i in range(k):\n tol += li[i]\nprint(tol)", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nl = [int(x) for x in input().split()]\nl.sort()\nl.reverse()\nans = 0\nfor i in range(K):\n ans += l[i]\nprint(ans)", "passed": true, "time": 0.24, "memory": 14236.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\ni = sorted(list(map(int,input().split())))\n\nprint((sum(i[-b:])))\n\n", "passed": true, "time": 0.27, "memory": 14068.0, "status": "done"}, {"code": "N,K = map(int,input().split())\nl = list(sorted(map(int,input().split())))[::-1]\n\nprint(sum(l[:K]))", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "N,K=map(int,input().split())\nL=list(map(int,input().split()))\nL.sort(reverse=True)\nprint(sum(L[:K]))", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "n, k = map(int, input().split())\ns = list(map(int, input().split()))\ns.sort()\nprint(sum(s[n-k:]))", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = list(map(int, input().split()))\nl_sort = sorted(l)\nprint(sum(l_sort[-k:]))", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "n, k = list(map(int, input().split(' ')))\nlength = list(map(int, input().split(' ')))\nlength.sort(reverse=True)\nmax_length = sum(length[:k])\nprint(max_length)\n\n", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "n, k = map(int, input().split())\na = list(map(int, input().split()))\na.sort(reverse = True)\nsum = 0\nfor i in range(k):\n sum = sum + a[i]\nprint(sum)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "N,K = list(map(int, input().split()))\nS = list(map(int, input().split()))\n\nS = sorted(S,reverse=True)\n\nprint((sum(S[:K])))\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = sorted(list(map(int, input().split())),reverse=True)\nprint(sum(l[:k]))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "n,k = map(int,input().split())\nl = list(map(int,input().split()))\nl.sort(reverse=True)\nprint(sum(l[:k]))", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "N, K = map(int,input().split())\nl = list(map(int,input().split()))\n\nl.sort(reverse=True)\nsnake = []\n\nfor i in range(K):\n snake.append(l[i])\n\nprint(sum(snake))", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\na = [int(i) for i in input().split()]\n\na.sort(reverse=True)\nprint((sum(a[:k])))\n", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nL = list(map(int, input().split()))\n\nL.sort()\nL.reverse()\n\nprint(sum(L[:K]))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "# coding: utf-8\n\nnum, choose_num = map(int, input().split())\ntotal = 0\nstick_length = input().split(\" \")\n\nstr_num = [int(n) for n in stick_length]\nlist.sort(str_num, reverse=True)\n\nfor i in range(choose_num):\n total += str_num[i]\n\nprint(total)", "passed": true, "time": 0.23, "memory": 14072.0, "status": "done"}, {"code": "n,k=map(int,input().split())\na=list(map(int,input().split()))\na.sort(reverse=True)\nans = 0\nfor i in range(k):\n ans += a[i]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "k = list(map(int, input().split()))[1]\nls = list(sorted(list(map(int, input().split()))))\nprint((sum(ls[len(ls) - k:])))\n", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = list(map(int, input().split()))\n\nl_sorted = sorted(l, reverse = True)\nsnake = 0\nfor i in range(k):\n snake += l_sorted[i]\nprint(snake)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\nl = list(map(int, input().split()))\nl.sort()\nSum = 0\n\nfor i in range(K):\n Sum += l[N - i - 1]\n\nprint(Sum)\n", "passed": true, "time": 0.15, "memory": 14212.0, "status": "done"}, {"code": "N,K=list(map(int,input().split()))\nl=list(map(int,input().split()))\nl.sort()\nprint((sum(l[N-K:N])))\n", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "a,b=list(map(int,input().split()))\nN = sorted(list(map(int,input().split())))[::-1]\nprint((sum(N[:b])))\n", "passed": true, "time": 0.17, "memory": 14220.0, "status": "done"}, {"code": "N, K = map(int, input().split())\nL = list(map(int, input().split()))\n\nL = sorted(L, reverse=True)\nprint(sum(L[:K]))", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nle=list(map(int,input().split()))\nle.sort()\ngou=0\nfor i in range(b):\n gou+=le.pop()\nprint(gou)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "N, K = [int(x) for x in input().split()]\nl = [int(x) for x in input().split()]\n\ns = sorted(l)\n\nans = sum(s[N - K:])\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nl = sorted(list(map(int, input().split())))[::-1]\n\nprint(sum(l[:k:]))", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "N,K = list(map(int, input().split()))\nlengths_list = list(map(int, input().split()))\nlengths_list.sort()\nlengths_list.reverse()\nsum_length = 0\nfor i in range(K):\n sum_length += lengths_list[i]\n\nprint(sum_length)\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nlst = list(map(int, input().split()))\n\nlst = sorted(lst)\nprint(sum(lst[(-1) * k:]))", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "_,k=map(int,input().split());print(sum(sorted(map(int,input().split()))[-k:]))", "passed": true, "time": 0.14, "memory": 14012.0, "status": "done"}, {"code": "# B - Snake Toy\ndef main():\n _, k = map(int, input().split())\n l = list(map(int, input().split()))\n cnt = 0\n l.sort(reverse=True)\n\n for i in range(k):\n cnt += l[i]\n else:\n print(cnt)\n\n\n\nif __name__ == \"__main__\":\n main()", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nN, K = list(map(int, input().split()))\nL = sorted(list(map(int, input().split())))\nprint((sum(L[-K:])))\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n, k = [int(x) for x in input().split()]\na = [int(x) for x in input().split()]\na.sort()\nprint(sum(a[n-k:n]))", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "N, K = list(map(int, input().split()))\nL = list(map(int, input().split()))\n\nL.sort()\nprint((sum(L[-K:])))\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n,k=map(int,input().split())\ns=list(map(int,input().split()))\ns.sort(reverse=True)\n\nprint(sum(s[0:k]))", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "n,k = map(int, input().split())\nl = list(map(int, input().split()))\nl.sort(reverse=True)\nprint(sum(l[:k]))", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}]
[{"input": "5 3\n1 2 3 4 5\n", "output": "12\n"}, {"input": "15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n", "output": "386\n"}]
4,717
Snuke lives at position x on a number line. On this line, there are two stores A and B, respectively at position a and b, that offer food for delivery. Snuke decided to get food delivery from the closer of stores A and B. Find out which store is closer to Snuke's residence. Here, the distance between two points s and t on a number line is represented by |s-t|. -----Constraints----- - 1 \leq x \leq 1000 - 1 \leq a \leq 1000 - 1 \leq b \leq 1000 - x, a and b are pairwise distinct. - The distances between Snuke's residence and stores A and B are different. -----Input----- Input is given from Standard Input in the following format: x a b -----Output----- If store A is closer, print A; if store B is closer, print B. -----Sample Input----- 5 2 7 -----Sample Output----- B The distances between Snuke's residence and stores A and B are 3 and 2, respectively. Since store B is closer, print B.
introductory
[{"code": "x, a, b = (int(x) for x in input().split())\nif abs(a-x) < abs(b-x):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.3, "memory": 14088.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif abs(x - a) < abs(x - b): print('A')\nelse: print('B')", "passed": true, "time": 0.3, "memory": 14040.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nprint(\"AB\"[abs(x-a)>abs(x-b)::2])", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\n\nif abs(x-a) < abs(x-b):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.26, "memory": 14052.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nprint(\"A\" if abs(x-a) < abs(x-b) else \"B\")", "passed": true, "time": 0.26, "memory": 14168.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nif abs(a-x)>abs(b-x):\n print(\"B\")\nelse:\n print(\"A\")", "passed": true, "time": 0.17, "memory": 14300.0, "status": "done"}, {"code": "a = [int(x) for x in input().split()]\nif abs(a[1] - a[0]) > abs(a[2] - a[0]):\n print(\"B\")\nelse:\n print(\"A\")", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\n\nprint(\"B\" if abs(x-a) > abs(x-b) else \"A\")", "passed": true, "time": 0.15, "memory": 14316.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nprint(\"BA\"[abs(a - x) < abs(b - x)])", "passed": true, "time": 0.31, "memory": 14204.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif abs(x-a)>abs(x-b):\n print('B')\nelse:\n print('A')", "passed": true, "time": 0.26, "memory": 14152.0, "status": "done"}, {"code": "x,a,b=map(int,input().split(\" \"))\nprint(\"A\") if abs(a-x)<abs(b-x) else print(\"B\")", "passed": true, "time": 0.27, "memory": 14232.0, "status": "done"}, {"code": "x, a, b = list(map(int, input().split()))\nif abs(x-a) > abs(x-b):\n print('B')\nelse:\n print('A')\n\n", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nprint('A' if abs(x-a) < abs(x-b) else 'B')", "passed": true, "time": 0.19, "memory": 14208.0, "status": "done"}, {"code": "def main():\n x, a, b = list(map(int, input().split()))\n print(('A' if abs(x - a) < abs(x - b) else 'B'))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.16, "memory": 14016.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nif abs(x - a) < abs(x - b):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.32, "memory": 14220.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nprint('A' if abs(a-x)<abs(b-x) else 'B')", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nprint('B' if abs(b-x) < abs(a-x) else 'A')", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nif abs(x-a)<abs(x-b):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nprint(\"A\") if abs(x-a)<abs(x-b) else print(\"B\")", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "x,a,b=list(map(int,input().split()))\n\nif abs(x-a) >= abs(x-b):\n print('B')\nelse:\n print('A')", "passed": true, "time": 0.24, "memory": 14152.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif abs(x-a) < abs(x-b):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.15, "memory": 14048.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nif abs(a-x)<abs(b-x):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nprint('A' if abs(x-a) < abs(x-b) else 'B')", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\n\nif abs(x-a)>abs(x-b):\n ans='B'\nelse:\n ans='A'\nprint(ans)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\n\nif abs(a-b) < abs(a-c):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.24, "memory": 14040.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif abs(x-a) < abs(x-b):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "x, a, b = list(map(int, input().split()))\nif abs(x - a) > abs(x - b):\n print(\"B\")\nelse:\n print(\"A\")\n", "passed": true, "time": 0.24, "memory": 14224.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nprint('A' if abs(x-a)<abs(x-b) else 'B')", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nif abs(a-x) < abs(b-x):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\n\nif abs(x-a)>=abs(x-b):\n print('B')\n \nelse:\n print('A')", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "a,b,c = map(int,input().split())\nif abs(a - b) < abs(a - c):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif abs(x - a) > abs(x - b):\n print('B')\nelse:\n print('A')", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "x, a, b = list(map(int, input().split()))\nif abs(x-a) > abs(x-b):\n print(\"B\")\nelse:\n print(\"A\")\n", "passed": true, "time": 0.21, "memory": 14060.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nar = abs(x - a)\nbr = abs(x - b)\n\nif br < ar:\n print(\"B\")\nelif br > ar:\n print(\"A\")", "passed": true, "time": 0.19, "memory": 14144.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nif abs(a - x) > abs(b - x):\n print(\"B\")\nelse:\n print(\"A\")", "passed": true, "time": 1.22, "memory": 14052.0, "status": "done"}, {"code": "x,a,b= map(int,input().split())\nif abs(x-a)>abs(x-b):\n print(\"B\")\nelse:\n print(\"A\")", "passed": true, "time": 0.21, "memory": 14084.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nla = abs(a - x)\nlb = abs(b - x)\nprint(\"A\" if la < lb else \"B\")", "passed": true, "time": 0.19, "memory": 14184.0, "status": "done"}, {"code": "x,a,b=map(int,input().split());print('AB'[abs(x-a)-abs(x-b)>=0])", "passed": true, "time": 0.2, "memory": 14048.0, "status": "done"}, {"code": "x,a,b=list(map(int,input().split()))\nif abs(x-a)<abs(x-b):\n print('A')\nelse:\n print('B')\n", "passed": true, "time": 0.16, "memory": 14048.0, "status": "done"}, {"code": "a, b, c = map(int, input().split())\n\nd = a-b\nif d < 0:\n d *= -1\ne = a-c\nif e < 0:\n e *= -1\n\nif d >= e:\n print(\"B\")\nelse:\n print(\"A\")", "passed": true, "time": 0.18, "memory": 14240.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\n\nA = abs(a - x)\nB = abs(b - x)\n\nif A < B:\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "x,a,b = map(int, input().split())\n\nprint(\"A\" if abs(x-a) < abs(x-b) else \"B\")", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nif abs(a-x)<abs(b-x):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.16, "memory": 14060.0, "status": "done"}, {"code": "x, a, b = list(map(int, input().split()))\n\nif abs(x - a) < abs(x - b):\n print('A')\nelse:\n print('B')\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "x,a,b = list(map(int,input().split()))\nif abs(x-a) < abs(x-b):\n print(\"A\")\nelif abs(x-a) > abs(x-b):\n print(\"B\")\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "a,b,c=list(map(int,input().split()))\nif abs(a-b)<abs(a-c):\n print(\"A\")\nelse:\n print(\"B\")\n", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "#n = int(input())\nx, a, b = list(map(int, input().split()))\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\nif abs(x-a) < abs(x-b):\n print('A')\nelse:\n print('B')\n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nif abs(x-a)<abs(x-b):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "x, a, b = list(map(int, input().split()))\nprint((\"A\" if max(x, a) - min(x, a) < max(x, b) - min(x, b) else \"B\"))\n", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "def iroha():\n x, a, b = list(map(int, input().split()))\n on = abs(x-a)\n off = abs(x-b)\n print((\"A\" if on < off else \"B\"))\n\n\n\n\n\ndef __starting_point():\n iroha()\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14356.0, "status": "done"}, {"code": "X,A,B=map(int,input().split())\na=abs(X-A)\nb=abs(X-B)\nif a<b:\n ans=\"A\"\nelif b<a:\n ans=\"B\"\nprint(ans)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\n\na = abs(a-x)\nb = abs(b-x)\n\nif a < b:\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nprint('A' if abs(x-a)<abs(x-b) else 'B')", "passed": true, "time": 0.21, "memory": 14180.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif abs(x - b) > abs(x - a):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.23, "memory": 14156.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nprint(\"A\" if abs(x-a) < abs(x-b) else \"B\")", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nif min(abs(x-a),abs(x-b))==abs(x-a):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14364.0, "status": "done"}, {"code": "x, a, b = list(map(int, input().split()))\nprint(('A' if abs(x - a) < abs(x - b) else 'B'))\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nprint(\"A\" if abs(a - x) < abs(b - x) else \"B\")", "passed": true, "time": 0.19, "memory": 14172.0, "status": "done"}, {"code": "x, a, b = list(map(float,input().split()))\n\nif abs(x - a) < abs(x - b):\n print(\"A\")\nelse:\n print(\"B\")\n", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nA = abs(x-a)\nB = abs(x-b)\n\nif A<=B:\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.18, "memory": 14164.0, "status": "done"}, {"code": "x, a, b = list(map(int, input().split()))\nif abs(x - a) > abs(x - b):\n print('B')\nelse:\n print('A')", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "x, a, b = list(map(int, input().split()))\nif abs(x-a)<abs(x-b):\n print(\"A\")\nelse:\n print(\"B\")\n", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\n\nif abs(x - a) < abs(x - b):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif abs(a-x) < abs(b-x):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.17, "memory": 14216.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nA=abs(a-x)\nB=abs(b-x)\nprint('A' if A < B else 'B')", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif abs(x-a) > abs(x-b):\n print(\"B\")\nelse:\n print(\"A\")", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "x,y,z=map(int,input().split())\nif abs(y-x) < abs(z-x):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "lst = input().split()\n\nx = int(lst[0])\na = int(lst[1])\nb = int(lst[2])\n\ndef distance(p):\n return abs(p - x)\n\nif distance(a) < distance(b):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.26, "memory": 14104.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nprint(\"A\" if abs(x-a) < abs(x-b) else \"B\")", "passed": true, "time": 0.17, "memory": 14320.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nif abs(a-x)>abs(x-b):\n print(\"B\")\nelse:\n print(\"A\")", "passed": true, "time": 0.25, "memory": 14048.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\n\nif abs(x-a) <= abs(x-b):\n print('A')\n \nelse:\n print('B')", "passed": true, "time": 0.17, "memory": 14272.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif (x - a) ** 2 < (x - b) ** 2:\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.22, "memory": 14104.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif abs(x-a) > abs(x-b):\n print(\"B\")\nelse:\n print(\"A\")", "passed": true, "time": 0.15, "memory": 14028.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nif abs(a-x)>abs(b-x):print(\"B\")\nelse: print(\"A\")", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nif abs(x-a) < abs(x-b):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "x, a, b = map(int,input().split())\nprint('A') if abs(x-a) < abs(x-b) else print('B')\n", "passed": true, "time": 0.16, "memory": 14228.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nprint(\"A\" if abs(b-x)>abs(a-x) else \"B\")", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "x, a, b = (int(x) for x in input().split())\nif abs(a-x) < abs(b-x):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nprint('A' if abs(x-a) < abs(x-b) else 'B')", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "#ABC071A\nx,a,b = map(int,input().split())\nprint(\"A\" if abs(x-a) <= abs(x-b) else \"B\")", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nif abs(x-a)>abs(x-b):print('B')\nelse:print('A')", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nif abs(x-a)<abs(x-b) :\n print(\"A\")\nelse :\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "x,a,b=list(map(int,input().split()))\nif abs(x-a)<abs(x-b):\n print(\"A\")\nelse:\n print(\"B\")\n", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "a, b, c = [int(x) for x in input().split()] \n\nif abs(a - b) > abs(a - c):\n print(\"B\")\nelse:\n print(\"A\")\n", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nif abs(a-x)>=abs(b-x):\n print(\"B\")\nelse:\n print(\"A\")", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "x,a,b = map(int, input().split())\nif abs(x-a) < abs(x-b):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nif abs(x-a) > abs(x-b):\n print('B')\nelse:\n print('A')", "passed": true, "time": 0.21, "memory": 14052.0, "status": "done"}, {"code": "x,a,b = map(int,input().split())\nA = abs(x-a)\nB = abs(x-b)\n\nif A < B:\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.21, "memory": 14300.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nif abs(x-a)<abs(x-b):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "x, a, b = list(map(int, input().split()))\n\na_x = abs(a - x)\nb_x = abs(b - x)\n\nif a_x < b_x:\n print('A')\nelse:\n print('B')\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "x, a, b, = list(map(int, input().split()))\nprint((\"A\" if(abs(x-a) < abs(x-b)) else \"B\"))\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif abs(x-a) < abs(x-b):\n\tprint('A')\nelse:\n\tprint('B')", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "#\n# abc071 a\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"5 2 7\"\"\"\n output = \"\"\"B\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"1 999 1000\"\"\"\n output = \"\"\"A\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n x, a, b = list(map(int, input().split()))\n if abs(x-a) > abs(x-b):\n print(\"B\")\n else:\n print(\"A\")\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14444.0, "status": "done"}, {"code": "s_position, a_store, b_store = list(map(int, input().split()))\n\ndis_a_s = abs(a_store - s_position)\ndis_b_s = abs(b_store - s_position)\n\nif dis_b_s > dis_a_s:\n print('A')\nelif dis_a_s > dis_b_s:\n print('B')\n", "passed": true, "time": 0.13, "memory": 14072.0, "status": "done"}, {"code": "a,b,c=input().split()\na=int(a)\nb=int(b)\nc=int(c)\nif abs(b-a)>abs(c-a):\n print(\"B\")\nelse:\n print(\"A\")", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nif abs(x-a) <abs(x-b):\n print(\"A\")\nelse:\n print(\"B\")", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "x, a, b = map(int, input().split())\nif abs(x-a)<abs(x-b):\n print('A')\nelse:\n print('B')", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "x, a, b= map(int, input().split())\n\nprint('A' if abs(x - a) < abs(x - b) else 'B')", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "x,a,b=map(int,input().split())\nif abs(x-a)>abs(x-b):\n print(\"B\")\nelse:\n print(\"A\")", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}]
[{"input": "5 2 7\n", "output": "B\n"}, {"input": "1 999 1000\n", "output": "A\n"}]
4,718
On some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23, 2018 should be written as 2018/01/23. After finishing the document, she noticed that she had mistakenly wrote 2017 at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to 2018 and prints it. -----Constraints----- - S is a string of length 10. - The first eight characters in S are 2017/01/. - The last two characters in S are digits and represent an integer between 1 and 31 (inclusive). -----Input----- Input is given from Standard Input in the following format: S -----Output----- Replace the first four characters in S with 2018 and print it. -----Sample Input----- 2017/01/07 -----Sample Output----- 2018/01/07
introductory
[{"code": "s=input()\nprint(\"2018\"+s[4:])", "passed": true, "time": 0.38, "memory": 13976.0, "status": "done"}, {"code": "def main():\n s = input()\n print(f\"2018{s[4:]}\")\n\n\nmain()", "passed": true, "time": 0.28, "memory": 14132.0, "status": "done"}, {"code": "print(input().replace('2017','2018'))", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "y, m, d = list(map(str, input().split('/')))\nprint(('2018' + '/' + m + '/' + d))\n", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "S = input()\nprint(S.replace('7', '8', 1))", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "s = input()\nprint(s.replace('7', '8', 1))", "passed": true, "time": 0.2, "memory": 14248.0, "status": "done"}, {"code": "date_str = input()\n\nnew_data = date_str.replace('2017', '2018')\nprint(new_data)\n", "passed": true, "time": 0.27, "memory": 14208.0, "status": "done"}, {"code": "print((input().replace(\"2017\", \"2018\")))\n", "passed": true, "time": 0.21, "memory": 14084.0, "status": "done"}, {"code": "s = input()\nprint((s.replace('2017', '2018')))\n", "passed": true, "time": 0.28, "memory": 14048.0, "status": "done"}, {"code": "S = input()\nans = S[:3] + '8' + S[4:]\nprint(ans)", "passed": true, "time": 0.22, "memory": 14268.0, "status": "done"}, {"code": "S = input()\nprint(S.replace('2017', '2018'))", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "s = input()\na = int(s[0])*1000+int(s[1])*100+int(s[2])*10+int(s[3])+1\nb = s[4]+s[5]+s[6]+s[7]+s[8]+s[9] \nprint((str(a)+b))\n\n", "passed": true, "time": 0.21, "memory": 14220.0, "status": "done"}, {"code": "s=input()\nprint(s[:3]+'8'+s[4:])", "passed": true, "time": 0.47, "memory": 14296.0, "status": "done"}, {"code": "s = input()\ns = s.replace(\"2017\",\"2018\")\nprint(s)", "passed": true, "time": 0.3, "memory": 14156.0, "status": "done"}, {"code": "s = list(input())\ns[3] = '8'\n\nprint((''.join([str(i) for i in s])))\n", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\n\ndef main():\n S = input()\n print((S[:3] + \"8\" + S[4:]))\n\n\nmain()\n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "print(input().replace('2017', '2018'))", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "#ABC085A\ns = input()\nprint(\"2018\"+s[4:])", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "S=input()\nprint(S.replace(\"2017\",\"2018\"))", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "S=input()\nprint(\"2018\"+S[4:])", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "S = input()\n\nprint(S.replace('2017', '2018'))", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "s = input()\nprint(\"2018\"+s[4:])", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "print('2018'+input()[4:])", "passed": true, "time": 0.21, "memory": 14260.0, "status": "done"}, {"code": "S = input()\n\nprint(S.replace(S[:4], \"2018\"))", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}, {"code": "s=input()\nprint(\"2018\"+s[4:])", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "print(input().replace('2017', '2018'))", "passed": true, "time": 0.98, "memory": 14040.0, "status": "done"}, {"code": "S = input()\nprint((\"2018\" + S[4:]))\n", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "print((\"2018\"+input()[4:]))\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "s=input()\nprint(s.replace(\"2017\",\"2018\"))", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "s = list(input())\ns[3] = \"8\"\nprint(\"\".join(s))", "passed": true, "time": 0.24, "memory": 14228.0, "status": "done"}, {"code": "print(\"2018\"+input()[4:])", "passed": true, "time": 0.17, "memory": 14272.0, "status": "done"}, {"code": "print(f\"{2018}{input()[4:]}\")", "passed": true, "time": 0.15, "memory": 14268.0, "status": "done"}, {"code": "print('2018' + input()[4:])", "passed": true, "time": 0.15, "memory": 14048.0, "status": "done"}, {"code": "a=input()\nprint(a.replace(\"2017\",\"2018\"))", "passed": true, "time": 0.15, "memory": 14156.0, "status": "done"}, {"code": "s = input()\nprint(s[:3] + \"8\" + s[4:])", "passed": true, "time": 0.17, "memory": 14212.0, "status": "done"}, {"code": "s = list(input())\ns[3] = '8'\nprint((''.join(s)))\n", "passed": true, "time": 0.16, "memory": 14180.0, "status": "done"}, {"code": "print(\"2018\"+input()[4:])", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "date = input()\n\ndate_list = list(date)\ndate_list[3] = '8'\noutput = ''.join(date_list)\n\nprint(output)", "passed": true, "time": 0.18, "memory": 14272.0, "status": "done"}, {"code": "s = str(input())\nprint(s[0:3] + \"8\" + s[4:])", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "import sys\n \nS = sys.stdin.readline().strip()\nprint(\"2018\" + S[4:])", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "date = list(input())\ndate[3] = \"8\"\nprint(\"\".join(map(str, date)))", "passed": true, "time": 0.15, "memory": 14280.0, "status": "done"}, {"code": "print(input().replace(\"2017\",\"2018\"))", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "s=input()\nprint(\"2018\"+s[4:])", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "print(input().replace(\"2017\",\"2018\"))", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "S = input()\nprint(\"2018/01/\" + S[8:10])", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "s=input()\nprint(s.replace(\"2017\",\"2018\"))", "passed": true, "time": 0.22, "memory": 14052.0, "status": "done"}, {"code": "S = input()\nprint(S.replace(\"2017\",\"2018\"))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "s = list(input())\ns[3] = \"8\"\nprint(\"\".join(s))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nsys.setrecursionlimit(10**6)\n\ns = list(str(input()))\ns[:4] = list(\"2018\")\n\nprint((\"\".join(s)))\n", "passed": true, "time": 0.23, "memory": 14112.0, "status": "done"}, {"code": "s = str(input())\nans = \"2018\" + s[4:]\nprint(ans)", "passed": true, "time": 0.15, "memory": 14028.0, "status": "done"}, {"code": "S = input()\nans = '2018/01/' + S[8:]\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14280.0, "status": "done"}, {"code": "s=input()\nprint(s.replace(\"2017\",\"2018\"))", "passed": true, "time": 0.15, "memory": 14272.0, "status": "done"}, {"code": "S = input()\n\nprint(S.replace('2017', '2018'))", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "S=input()\na=S.split('/')\nb='2018/'+a[1]+'/'+a[2]\nprint(b)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "S = str(input())\n\nif S[3] == \"7\":\n S = S[:3] + \"8\" + S[4:]\nprint(S)\n", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "s = input()\nprint((\"2018/01/\"+s[8:]))\n", "passed": true, "time": 0.15, "memory": 14272.0, "status": "done"}, {"code": "a = input()\nprint(a.replace('2017','2018'))", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "s = input()\nprint(s[:3] + \"8\" + s[4:])", "passed": true, "time": 0.17, "memory": 14176.0, "status": "done"}, {"code": "S = str(input())\n\nprint(S.replace(S[0:4],\"2018\"))", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "print(input().replace('2017', '2018'))", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "S = input()\nS = list(S)\nS[3] = \"8\"\nprint((\"\".join(S)))\n\n", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}, {"code": "moji = str(input())\nprint(moji.replace(\"2017\",\"2018\"))", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "S = input()\nprint((S[:3]+\"8\"+S[4:]))\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "s=str(input())\ns=s[4:]\nprint('2018'+s)", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "# \u6587\u5b57\u5217\u306e\u5165\u529b\ns = input()\nprint(s.replace(\"2017\",\"2018\"))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "#85A\ns=list(input())\ns[3]='8'\nprint(''.join(s))", "passed": true, "time": 0.15, "memory": 14292.0, "status": "done"}, {"code": "s = list(input())\ns[3]=\"8\"\nprint(*s,sep=\"\")", "passed": true, "time": 0.15, "memory": 14252.0, "status": "done"}, {"code": "print(input().replace('017','018'))", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "S = input()\n\n# count=1 \u306b\u3059\u308b\nprint((S.replace('7', '8', 1)))\n", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "s = str(input())\n\nprint((\"2018\"+s[4:]))\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "s = str(input())\nans = '2018' + s[4:]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "a=input().replace(\"2017\",\"2018\")\nprint(a)", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "print(\"2018\"+input()[4:])", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "S = str(input())\ns = \"2\"\nfor i in range(1,10):\n if i == 3:\n s+=\"8\"\n else:\n s+=S[i]\nprint(s)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "n = list(input())\n\nn[3] = \"8\"\n\nprint(\"\".join(n))", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "s = input()\ns = s.replace('2017','2018')\nprint(s)", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "S = input()\nanswer = S.replace(\"2017\", \"2018\")\nprint(answer)", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "S = input()\nprint((\"2018\"+S[4:]))\n", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "S=input()\nprint((S.replace(\"2017\",\"2018\")))\n", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "S = input()\n \n# Python\u3067\u306f S[3]='8' \u306e\u3088\u3046\u306a\u64cd\u4f5c\u306f\u8a31\u3055\u308c\u306a\u3044\u306e\u3067\u9593\u63a5\u7684\u306a\u65b9\u6cd5\u3092\u7528\u3044\u308b\nprint(S[:3] + '8' + S[-6:])", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "s = input()\nprint(s.replace('7','8',1))", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "print(\"2018\"+input()[4:])", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "y, m, d = input().split(\"/\")\ns = \"2018\" + \"/\" + m + \"/\" + d\nprint(s)\n", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "date = str(input())\nprint((date.replace('2017', '2018')))\n", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "s = input()\nprint('2018'+s[4:])", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "s = input()\nprint(\"2018\" + s[4:])", "passed": true, "time": 0.21, "memory": 14028.0, "status": "done"}, {"code": "S = input()\nprint('2018' + S[4:])", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\nS = list(input())\n\nS[3] = '8'\nS = \"\".join(S)\n\nprint(S)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "print(input().replace('2017', '2018'))", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "S = input()\nprint(S.replace(\"2017\",\"2018\"))", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "s = input()\nif s[0:4] == '2017':\n print(s.replace('2017', '2018'))", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "a=input()\nprint('2018'+a[4:])", "passed": true, "time": 0.15, "memory": 14044.0, "status": "done"}, {"code": "year,month,day = map(str,input().split('/'))\n\nprint('2018/'+month+'/'+day)", "passed": true, "time": 0.15, "memory": 14100.0, "status": "done"}, {"code": "s=str(input())\nans='2018'+s[4:]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "s = input()\nprint(\"2018\",end='')\nprint(s[4:])", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "N = list(input())\nN[3] = '8'\nN = \"\".join(N)\nprint(N)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "print(input().replace(\"017\",\"018\"))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "a = input()\nprint('2018' + a[4:])", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}]
[{"input": "2017/01/07\n", "output": "2018/01/07\n"}, {"input": "2017/01/31\n", "output": "2018/01/31\n"}]
4,719
Snuke loves "paper cutting": he cuts out characters from a newspaper headline and rearranges them to form another string. He will receive a headline which contains one of the strings S_1,...,S_n tomorrow. He is excited and already thinking of what string he will create. Since he does not know the string on the headline yet, he is interested in strings that can be created regardless of which string the headline contains. Find the longest string that can be created regardless of which string among S_1,...,S_n the headline contains. If there are multiple such strings, find the lexicographically smallest one among them. -----Constraints----- - 1 \leq n \leq 50 - 1 \leq |S_i| \leq 50 for every i = 1, ..., n. - S_i consists of lowercase English letters (a - z) for every i = 1, ..., n. -----Input----- Input is given from Standard Input in the following format: n S_1 ... S_n -----Output----- Print the lexicographically smallest string among the longest strings that satisfy the condition. If the answer is an empty string, print an empty line. -----Sample Input----- 3 cbaa daacc acacac -----Sample Output----- aac The strings that can be created from each of cbaa, daacc and acacac, are aa, aac, aca, caa and so forth. Among them, aac, aca and caa are the longest, and the lexicographically smallest of these three is aac.
introductory
[{"code": "# \u3072\u3063\u304f\u308a\u304b\u3048\u3059\u306e\u304b\u3068\u304a\u4fdd\u3063\u305f\u3089180\u5ea6\u53cd\u8ee2\u3060\u3063\u305f\nn = int(input())\nd = []\nfor _ in range(n):\n s = list(input())\n d.append(s)\n\nd = sorted(d, key=lambda dd: len(dd), reverse=True)\nbase = {}\nfor c in d[0]:\n if c not in base:\n base[c] = 1\n else:\n base[c] += 1\n\nfor s in d[1:]:\n tmp = {}\n for c in s:\n if c not in tmp:\n tmp[c] = 1\n else:\n tmp[c] += 1\n for k, v in base.items():\n if k in tmp and base[k] >= 1:\n base[k] = min(base[k], tmp[k])\n else:\n base[k] = -1\nans = []\nfor k, v in base.items():\n if v > 0:\n ans.append(k * v)\nans = sorted(ans)\nans = \"\".join(ans)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\n# from numba import njit\nfrom collections import Counter\n# input = stdin.readline\n\n# @njit\ndef solve(n,a):\n alphabetLst = {}\n for i in range(n):\n # i\u756a\u76ee\u306e\u6587\u5b57\u5217\u306e\u4e2d\u306e\u6587\u5b57\u3092\u6570\u3048\u308b\n d = Counter(a[i])\n for c in (chr(ord(\"a\") + i) for i in range(26)):\n if not c in d.keys():\n alphabetLst[c] = 0\n elif not c in alphabetLst.keys():\n alphabetLst[c] = d[c]\n elif d[c] < alphabetLst[c]:\n alphabetLst[c] = d[c]\n\n\n res = []\n for k,v in alphabetLst.items():\n res += [k]*v\n\n return \"\".join(res)\n\ndef main():\n N = int(input())\n a = [input() for _ in range(N)]\n print(solve(N,a))\n return\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n=int(input())\nl = [input() for i in range(n)]\nL = [[0]*26 for i in range(n)]\ns = ''\n\nfor i in range(n):\n for j in l[i]:\n L[i][ord(j)-97] += 1\n\nM = L[0]\nfor k in range(1,n):\n for g in range(26):\n M[g] = min(L[k][g],M[g])\n\nfor a in range(26):\n for b in range(M[a]):\n s += chr(a+97)\nprint(s)", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "alphabet = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n\nkey = dict()\nfor a in alphabet:\n key[a] = 50\n\nn = int(input())\nfor i in range(n):\n x = input()\n for a in alphabet:\n key[a] = min(key[a], x.count(a))\n\nfor k, v in key.items():\n for _ in range(v):\n print(k, end=\"\") \nprint()", "passed": true, "time": 0.16, "memory": 14248.0, "status": "done"}, {"code": "n=int(input())\nL = [50]*26\nfor i in range(n):\n S = input()\n for i in range(26):\n L[i] = min(L[i],S.count(chr(97+i)))\nans = \"\"\nfor i in range(26):\n ans += chr(97+i)*L[i]\nprint(ans)", "passed": true, "time": 0.26, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\nS = []\nans = ''\n\nfor i in range(n):\n S.append(str(input()))\n\ndata1 = []\ndata2 = []\n\nfor i in range(len(S[0])):\n if not S[0][i] in data1:\n data1.append(S[0][i])\n data2.append(1)\n else:\n data2[data1.index(S[0][i])] += 1\n\nfor i in range(1, n):\n for j in range(len(data1)):\n data2[j] = min(data2[j], S[i].count(data1[j]))\n\nfor i in range(len(data1)):\n ans += data1[i] * data2[i]\n\nprint((''.join(sorted(ans))))\n\n", "passed": true, "time": 0.17, "memory": 14116.0, "status": "done"}, {"code": "from collections import defaultdict\nfrom collections import deque\nfrom collections import Counter\nimport itertools\nimport math\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\n\nn = readInt()\nsn = [list(input()) for i in range(n)]\n\nans = \"\"\nfor i in range(97,123):\n\tm = float(\"inf\")\n\tfor j in sn:\n\t\tm = min(m,j.count(chr(i)))\n\tans+=chr(i)*m\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "n = int(input())\nS = [input() for _ in range(n)]\n\nalp = 'abcdefghijklmnopqrstuvwxyz'\ncount = [float('inf') for _ in range(len(alp))]\n\nfor s in S:\n for i in range(len(alp)):\n count[i] = min(count[i], s.count(alp[i]))\n\nans = ''\nfor i in range(len(alp)):\n ans += alp[i] * count[i]\nprint(ans)", "passed": true, "time": 0.26, "memory": 14320.0, "status": "done"}, {"code": "from collections import defaultdict\nimport string\nn = int(input())\n\nal = defaultdict(int)\nold = defaultdict(int)\n\ns = input()\nfor j in s:\n old[j] += 1\n al[j] += 1\n\nfor i in range(n-1):\n s = input()\n d = defaultdict(int)\n for j in s:\n d[j] += 1\n for k in string.ascii_lowercase:\n al[k] = min(old[k], d[k], al[k])\n old = d\nans = \"\"\nfor k in string.ascii_lowercase:\n ans += k * al[k]\nprint(ans)", "passed": true, "time": 0.23, "memory": 14324.0, "status": "done"}, {"code": "n=int(input())\ntable=[100]*26\nfor i in range(n):\n k=[0]*26\n s=input()\n for j in s:\n k[ord(j)-97]+=1\n for j in range(26):\n table[j]=min(table[j],k[j])\nans=\"\"\nfor i in range(26):\n ans+=chr(i+97)*table[i]\nprint(ans)", "passed": true, "time": 0.18, "memory": 14348.0, "status": "done"}, {"code": "n = int(input())\nA = list(\"abcdefghijklmnopqrstuvwxyz\")\nB = [50]*26\nfor i in range(n):\n C = [0]*26\n s = input()\n s = sorted(s)\n for j in range(len(s)):\n for k in range(26):\n if s[j] == A[k]:\n C[k] += 1\n break\n for m in range(26):\n B[m] = min(B[m],C[m])\n\nD = [] \nfor i in range(26):\n D.append(A[i]*B[i])\nD.sort()\nprint(*D, sep = \"\")", "passed": true, "time": 0.27, "memory": 14196.0, "status": "done"}, {"code": "from collections import Counter\nn=int(input())\ns=[input() for _ in range(n)]\n\nls=[chr(i) for i in range(ord(\"a\"),ord(\"z\")+1)]\nli=[9999 for _ in range(ord(\"a\"),ord(\"z\")+1)]\n\nc=[]\nfor x in s:\n c.append(Counter(x))\n\nfor x in c:\n for i,y in enumerate(ls):\n li[i]=min(x[y],li[i])\n\nres=\"\"\nfor i,x in enumerate(li):\n res+=ls[i]*x\nprint(res)", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "import string\nn = int(input())\n#a, b = map(int,input().split())\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\nsl = [list(input()) for i in range(n)]\n\nalpha = list(string.ascii_lowercase)\n\ndic = {si: sl[0].count(si) for si in alpha}\n\nfor s in sl:\n for ch in alpha:\n dic[ch] = min(dic[ch], s.count(ch))\nans = ''\nfor ch in alpha:\n for i in range(dic[ch]):\n ans += ch\nprint(ans)\n", "passed": true, "time": 0.26, "memory": 14056.0, "status": "done"}, {"code": "N = int(input())\nlet = [0]*26\nS = input()\nfor a in range(len(S)):\n let[ord(S[a])-ord(\"a\")] += 1\n \nfor i in range(N-1):\n S = input()\n let_S = [0]*26\n for j in range(len(S)):\n let_S[ord(S[j])-ord(\"a\")] += 1\n for k in range(26):\n if let[k] > let_S[k]:\n let[k] = let_S[k]\n\nans = \"\"\nfor l in range(26):\n ans += chr(ord(\"a\")+l)*let[l]\n\nprint(ans)", "passed": true, "time": 0.18, "memory": 14320.0, "status": "done"}, {"code": "n = int(input())\ns = [input() for _ in range(n)]\nans = set(s[0])\nfor i in range(1,n): ans = ans & set(s[i])\ncnt = [0] * len(ans)\nans = sorted(list(ans))\nfor i in range(n):\n for j in range(len(ans)):\n if cnt[j] == 0: cnt[j] = s[i].count(ans[j])\n else:cnt[j] = min(cnt[j], s[i].count(ans[j]))\n\nA = \"\"\nfor x,y in zip(ans,cnt):\n A += x*y\nprint(A)", "passed": true, "time": 0.19, "memory": 14196.0, "status": "done"}, {"code": "n = int(input())\n\ndic = {chr(97 + i): 50 for i in range(26)}\n\nfor _ in range(n):\n s = list(map(str, input()))\n for key in dic:\n dic[key] = min(dic[key], s.count(key))\n\n\nres = \"\"\nfor key in dic:\n if dic[key] != 0:\n res += key * dic[key]\n\nprint(res)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "from collections import Counter\nn = int(input())\ns = [''] * n\nfor i in range(n):\n\ts[i] = input()\n\nr = s[0]\nfor i in range(1, n):\n\tset_c = set(r) & set(s[i])\n\tif len(set_c) == 0:\n\t\tprint('')\n\t\treturn\n\tnext_r = ''\n\tcnt_r = Counter(r)\n\tcnt_s = Counter(s[i])\n\tfor c in set_c:\n\t\tnext_r += c * min(cnt_r[c], cnt_s[c])\n\tr = next_r\nprint(''.join(sorted(r)))", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "n = int(input())\nS = [input() for _ in range(n)]\nC = [ [0]*26 for _ in range(n)]\nfor i in range(n):\n for x in S[i]:\n k = ord(x) - ord('a')\n C[i][k] += 1\n\ncount = C[0]\nfor i in range(1, n):\n for k in range(26):\n count[k] = min(count[k], C[i][k])\n\nans = []\nfor k in range(26):\n if count[k]:\n\t ans.append(chr(ord('a') + k) * count[k])\nprint(*ans, sep='') ", "passed": true, "time": 0.15, "memory": 14100.0, "status": "done"}, {"code": "n=int(input())\nabc='abcdefghijklmnopqrstuvwxyz'\ns=[]\nt=[51]*len(abc)\n#print(t)\nfor i in range(n):\n u=input()\n for j in range(len(abc)):\n v=u.count(abc[j])\n t[j]=min(t[j],v)\nans=''\nfor j in range(len(abc)):\n ans+=t[j]*abc[j]\nprint(ans)", "passed": true, "time": 0.15, "memory": 14108.0, "status": "done"}, {"code": "N=int(input())\nS=[input() for _ in range(N)]\n\nF = [[0]*N for _ in range(26)]\n\nf1=lambda c: ord(c) - ord('a')\nf2=lambda c: chr(c+97)\n\n\nfor i in range(N):\n for s in S[i]:\n F[f1(s)][i]+=1\n \nans=''\nfor i in range(26):\n t=min(F[i])\n if t!=0:\n ans+=t*f2(i)\nprint(ans)", "passed": true, "time": 0.18, "memory": 14048.0, "status": "done"}, {"code": "n = int(input())\nalp = [input() for _ in range(n)]\nans = ''\n\nfor i in range(97, 123):\n cnt = 1001001001\n for s in alp:\n cnt = min(cnt, s.count(chr(i)))\n ans += chr(i)*cnt\n\nprint(ans)", "passed": true, "time": 0.39, "memory": 14060.0, "status": "done"}, {"code": "from collections import Counter\nn = int(input())\ns = [input() for i in range(n)]\nsc = [Counter(list(_s)) for _s in s]\n\nans = ''\nfor i in range(26):\n cnt = float('inf')\n for _sc in sc:\n cnt = min(cnt, _sc[chr(ord('a')+i)])\n ans+=chr(ord('a')+i)*cnt\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "from collections import Counter\n\nn = int(input())\na2z='abcdefghijklmnopqrstuvwxyz'\nC = Counter(input())\nfor _ in range(1, n):\n c = Counter(input())\n for i in a2z:\n C[i] = min(C[i], c[i])\n\nans = \"\"\nfor k, v in sorted(C.items()):\n ans += k*v\nprint(ans)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "from collections import Counter\nn = int(input())\ncl = {chr(i):0 for i in range(97,123)}\ns = input()\nfor k in Counter(s).keys():\n cl[k] = Counter(s)[k]\nfor i in range(n-1):\n s = input()\n for k in cl.keys():\n if cl[k]!=0:\n cl[k] = min(cl[k],Counter(s).get(k,0))\nans = []\nfor k,v in cl.items():\n if v!=0:\n for i in range(v):\n ans.append(k)\nprint(''.join(sorted(ans)))", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "import collections\nn = int(input())\ns = list(input())\ns_cnt = collections.Counter(s)\n\nfor i in range(n-1):\n tmp = input()\n for k in s_cnt:\n s_cnt[k] = min(s_cnt[k],tmp.count(k))\n\ns_cnt=dict(sorted(s_cnt.items(), key=lambda x:x[0]))\nans = \"\" \nfor k in s_cnt:\n ans += k*s_cnt[k]\nprint(ans)", "passed": true, "time": 0.23, "memory": 14076.0, "status": "done"}, {"code": "n=int(input())\nc=list(input())\nfor i in range(n-1):\n t=[]\n s=list(input())\n for j in c:\n if j in s:\n t.append(j)\n s.remove(j)\n c=t\nc.sort()\nprint(\"\".join(c))", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "import collections as c\nn=[c.Counter(input()) for _ in range(int(input()))];r=n[0]\nfor i in range(1,len(n)): r=r&n[i]\nprint(*sorted([i*j for i,j in r.items()]),sep='')", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "from collections import defaultdict\nn = int(input())\nnew_d = {}\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n new_d[chr(i)] = 50\nfor _ in range(n):\n old_d = new_d\n s = input()\n d = defaultdict(int)\n for c in s:\n if c not in old_d:\n continue\n d[c] += 1\n new_d = {}\n for c in d.keys():\n new_d[c] = min(old_d[c], d[c])\nans = \"\"\nfor c, v in sorted(new_d.items()):\n ans += c * v\nprint(ans)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n = int(input())\n\na = [99] * 26\nfor i in range(n):\n s = input()\n tmp = [0] * 26\n for c in s:\n x = ord(c) - ord('a')\n tmp[x] += 1\n for j in range(26):\n a[j] = min(a[j], tmp[j])\n\nfor i in range(26):\n c = chr(i + ord('a'))\n print(c * a[i], end='')\nprint()\n", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "n = int(input())\nli = []\nfor i in range(n):\n li.append(input())\n\nfor i in [chr(ord(\"a\") + j) for j in range(26)]:\n print(i*min([li[k].count(i) for k in range(n)]), end = \"\")\n\nprint(\"\")\n", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "N = int(input())\nfrom collections import Counter\nS = [Counter(input()) for _ in range(N)]\n\nx = S[0]\nfor i in range(1, N):\n x = x & S[i]\n\nans = []\nfor k, v in x.items():\n for i in range(v):\n ans.append(k)\nans = sorted(ans)\nprint(\"\".join(ans))", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "from collections import Counter\nn = int(input())\nS = [input() for _ in range(n)]\n\ncount = Counter(S[0])\nfor s in S[1:]:\n c = Counter(s)\n count = count & c\n \nls = sorted(count.items())\n\nans = \"\"\nfor i, j in ls:\n ans += i * j\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\nl = []\nfor i in range(n):\n l.append(sorted(input()))\nl.sort(key=len)\nans = []\nfor i in l[0]:\n for j in range(1, n):\n if i not in l[j]:\n break\n else:\n l[j].remove(i)\n else:\n ans.append(i)\nprint(*ans, sep=\"\")", "passed": true, "time": 0.25, "memory": 14300.0, "status": "done"}, {"code": "n = int(input())\na = input()\nalphabet = {}\nfor i in a:\n alphabet.update({i: a.count(i)})\nfor i in range(n-1):\n b = input()\n for j in alphabet:\n alphabet[j] = min(alphabet[j], b.count(j))\nans = []\nfor i in alphabet:\n ans += [i]*alphabet[i]\nprint((''.join(sorted(ans))))\n \n \n \n", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "# C - \u602a\u6587\u66f8\ndef main():\n n = int(input())\n ans = list(input())\n\n \n for _ in range(n-1):\n s = list(input())\n temp = []\n for j in ans:\n if j in s:\n s.remove(j)\n temp.append(j)\n else:\n ans = temp\n else:\n ans.sort()\n print((''.join(ans)))\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.2, "memory": 14240.0, "status": "done"}, {"code": "n = int(input())\ns = sorted([list(input()) for _ in range(n)], key=len)\n\nans = []\nfor i in s[0]:\n t = float(\"inf\")\n for j in s:\n t = min(t, j.count(i))\n ans.append(i*t)\nans = sorted(list(set(ans)))\nprint(\"\".join(ans))", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "from collections import Counter\nn=int(input())\ns=Counter(input())\nfor i in range(n-1):\n s&=Counter(input())\nprint(\"\".join(sorted(s.elements())))", "passed": true, "time": 0.48, "memory": 14084.0, "status": "done"}, {"code": "n=int(input())\ns=[100]*26\nfor i in range(n):\n a=[0]*26\n for j in list(input()):\n a[ord(j)-97]+=1\n for j in range(26):\n s[j]=min(s[j],a[j])\nans=''\nfor i in range(26):\n for j in range(s[i]):\n ans=ans+chr(i+97)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "a = ord('a')\nn = int(input())\nmemory = [[0] * 26 for _ in range(n)]\n\nfor i in range(n):\n for s in input():\n memory[i][ord(s) - a] += 1\n\nans = ''\nfor i in range(26):\n ans += min(memory[j][i] for j in range(n)) * chr(a + i)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "import string\n\nn = int(input())\n\nd = dict()\nfor c in string.ascii_lowercase:\n d[c] = []\n\nfor _ in range(n):\n s = input()\n for c in string.ascii_lowercase:\n if s.count(c) != 0:\n d[c].append(s.count(c))\n\nans = \"\"\nfor k, v in d.items():\n if len(v) == n:\n ans += k * min(v)\n\nprint(ans)", "passed": true, "time": 0.19, "memory": 14216.0, "status": "done"}, {"code": "n = int(input())\ncnt = [[0] * n for i in range(26)]\n\nfor i in range(n):\n s = input()\n for j in range(len(s)):\n x = ord(s[j]) - 97\n cnt[x][i] += 1\n\nans = ''\nfor i in range(26):\n ans += min(cnt[i]) * chr(i+97)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "def main():\n n = int(input())\n s_lst = [str(input()) for _ in range(n)]\n alp = list('abcdefghijklmnopqrstuvwxyz')\n\n lst = []\n for i in range(n):\n count_lst = [0] * 26\n s = s_lst[i]\n for j in range(len(s)):\n s_alp = s[j]\n count_lst[alp.index(s_alp)] += 1\n\n lst.append(count_lst)\n\n minimum_lst = [0] * 26\n for i in range(26):\n minimum_count = lst[0][i]\n for j in range(n):\n minimum_count = min(minimum_count, lst[j][i])\n\n minimum_lst[i] = minimum_count\n\n answer = ''\n for i in range(26):\n alphabet = alp[i] * minimum_lst[i]\n answer += alphabet\n print(answer)\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "n = int(input())\nS = [input().strip() for _ in range(n)]\nC = {chr(i):0 for i in range(97,123)}\nfor i in range(len(S[0])):\n C[S[0][i]] += 1\nfor j in range(1,n):\n C1 = {chr(i):0 for i in range(97,123)}\n for i in range(len(S[j])):\n C1[S[j][i]] += 1\n for i in range(97,123):\n C[chr(i)] = min(C[chr(i)],C1[chr(i)])\n \nA = []\nfor i in range(97,123):\n A.append(chr(i)*C[chr(i)])\nprint(\"\".join(sorted(A)))", "passed": true, "time": 0.22, "memory": 14116.0, "status": "done"}, {"code": "n=int(input())\nS=list(input() for _ in range(n))\n\nT=\"abcdefghijklmnopqrstuvwxyz\"\nfor c in T:\n x=50\n for s in S:\n x=min(x,s.count(c))\n print(c*x,end='')\nprint()\n", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "N = int(input())\ns = [[0 for i in range(N)] for j in range(26)]\nfor i in range(N):\n t = input()\n for j in range(len(t)):\n s[ord(t[j])-ord('a')][i] += 1\nans = ''\nfor j in range(26):\n ans += chr(j+ord('a')) * min(s[j])\nprint(ans)", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "from collections import Counter\nN = int(input())\n\ns = Counter(input())\nfor i in range(N-1):\n s &= Counter(input())\nprint((''.join(sorted(s.elements()))))\n", "passed": true, "time": 0.19, "memory": 14144.0, "status": "done"}, {"code": "n = int(input())\njisho = 'abcdefghijklmnopqrstuvwxyz'\nmoji = []\n#print(moji)\nfor i in range(n):\n dic = {}\n for i in range(len(jisho)):\n dic.setdefault(jisho[i],0)\n s = str(input())\n for j in range(len(s)):\n dic.setdefault(s[j],0)\n dic[s[j]] += 1\n moji.append(dic)\ndic = {}\nfor j in range(len(jisho)):\n tmp = 50\n for i in range(n):\n tmp = min(tmp,moji[i][jisho[j]])\n if tmp != 0:\n dic.setdefault(jisho[j],tmp)\n#print(dic)\nans = ''\nfor item in dic.items():\n while dic[item[0]]>0:\n ans += item[0]\n dic[item[0]] -= 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "n = int(input())\ns = list(input() for _ in range(n))\n\nalphabet = [[0] * n for _ in range(26)]\n\nfor i in range(n):\n for x in s[i]:\n alphabet[ord(x) % 97][i] += 1\n\nans = ''\nfor i in range(26):\n m = min(alphabet[i])\n if m != 0:\n for _ in range(m):\n ans += chr(i + 97)\n\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "from collections import Counter\n\nn=int(input())\n\nabc='abcdefghijklmnopqrstuvwxyz'\n\nfor i in range(n):\n if i==0:\n c=Counter(input())\n else:\n c2=Counter(input())\n for k in abc:\n c[k]=min(c[k],c2[k])\n\nans=''\nfor k,v in sorted(c.items()):\n ans+=k*v\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "from collections import Counter\n\nn=int(input())\nINF = 10**20\n\nd={}\nfor i in range(97,123):\n d[chr(i)] = INF\n\nfor i in range(n):\n s = input()\n c = Counter(s)\n for k in d.keys():\n if c.get(k):\n d[k] = min(c[k],d[k])\n else:\n d[k] = 0\n \nkeys=list(d.keys())\nfor k in keys:\n if d[k] == INF:\n del d[k]\n \nans = []\nfor k in d.keys():\n ans.extend([k]*d[k])\n \nif len(ans)==0:\n print('')\n return\n \nans = sorted(ans)\nprint(''.join(ans))", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "from collections import Counter\n\nn = int(input())\nS = [input() for _ in range(n)]\n\nans = Counter(S[0])\n\nfor s in S[1:]:\n ans = ans & Counter(s)\n\nprint(\"\".join(sorted([k * v for k, v in ans.items()])))", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "import copy\nn = int(input())\ns = list(input())\n\nif n == 1:\n s.sort()\n print(*s, sep='')\nelse:\n for _ in range(n-1):\n tmp = ''\n si = list(input())\n if len(si) >= len(s):\n for i in range(len(si)):\n if si[i] in s:\n tmp += si[i]\n s[s.index(si[i])], si[i] = '', ''\n else:\n for i in range(len(s)):\n if s[i] in si:\n tmp += s[i]\n si[si.index(s[i])], s[i] = '', ''\n s = list(copy.deepcopy(tmp))\n s.sort()\n print(*s, sep='')", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "n=int(input())\nd = {}\nfor i in range(26):\n d[chr(ord(\"a\")+i)]=10**9\nfor i in range(n):\n s=input()\n for j in range(26):\n d[chr(ord(\"a\")+j)]=min(d[chr(ord(\"a\")+j)], s.count(chr(ord(\"a\")+j)))\n\nans = \"\"\nfor e in list(d.items()):\n ans+=e[0]*e[1]\nprint(ans)\n \n \n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "N = int(input())\nChrL = [[] for T in range(0,26)]\nfor NT in range(0,N):\n S = input()\n for ST in range(0,26):\n ChrL[ST].append(S.count(chr(97+ST)))\nDisp = ['']*26\nfor ST in range(0,26):\n Disp[ST] = chr(97+ST)*min(ChrL[ST])\nprint(''.join(Disp))", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "alf=[\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"]\nn=int(input())\nli=[]\nans=[]\nSTR=\"\"\nfor h in range(n):\n li.append([0]*26)\n\nfor i in range(n):\n S=input()\n for j in range(len(S)):\n li[i][alf.index(S[j])]+=1\n\n\nfor k in range(26):\n temp=1000000000000000000000000000000000000000000\n for l in range(n):\n if temp>li[l][k]:\n temp=li[l][k]\n \n if temp!=1000000000000000000000000000000000000000000:\n ans.append(temp)\n\nfor m in range(26):\n STR=STR+alf[m]*ans[m]\nprint(STR)\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "m=10**9\nn=int(input())\na='abcdefghijklmnopqrstuvwxyz'\npue=[]\nfor i in range(len(a)):\n pue.append([a[i],m])\nfor i in range(n):\n s=input()\n for j in range(26):\n pue[j][1]=min(s.count(a[j]),pue[j][1])\n\nans=''\nfor i in range(26):\n for j in range(pue[i][1]):\n ans+=a[i]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "N = int(input())\nINF = 10**12\nans = [INF] * 26\n\nfor _ in range(N):\n S = input()\n tmp = [0] * 26\n for s in S:\n tmp[ord(s)-ord('a')] += 1\n \n for i in range(26):\n ans[i] = min(ans[i],tmp[i])\n\nansS = ''\nfor i in range(26):\n ansS += chr(i+97) * ans[i]\n\nprint(ansS)", "passed": true, "time": 0.15, "memory": 14328.0, "status": "done"}, {"code": "N = int(input())\nfrom collections import Counter\nS = [Counter(list(input())) for _ in range(N)]\n\ndef intersection(X):\n Res = X[0]\n if len(X) == 1:\n return Res\n for x in X[1:]:\n Res = {k:min(Res[k],x[k]) for k in Res if k in x}\n return Counter(Res)\n\nprint((''.join(sorted(intersection(S).elements()))))\n", "passed": true, "time": 0.16, "memory": 14204.0, "status": "done"}, {"code": "import collections\nn = int(input())\nss = sorted([input() for i in range(n)], key=lambda x:len(x))\ns = ss[0]\npoplist = []\ncc = collections.Counter(s)\n\nfor i in range(1, n):\n for c in cc:\n if c in ss[i]:\n cc[c] = min(cc[c], ss[i].count(c))\n else:\n if c not in poplist:\n poplist.append(c)\n\nfor p in poplist:\n dd = cc.pop(p)\n\nans = [x[0]*x[1] for x in cc.items()]\nans = ''.join(sorted(ans))\nprint(ans)", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "import collections\nn = int(input())\nS = list(input())\ncounterA = collections.Counter(S)\nfor i in range(1,n):\n counterB = collections.Counter()\n S = list(input())\n counterS = collections.Counter(S)\n for j in counterA.keys():\n if j in counterS:\n counterB[j] = min(counterA[j],counterS[j])\n else:\n counterB[j] = 0\n counterA = counterB\nls = []\nfor i in counterA.keys():\n for j in range(counterA[i]):\n ls.append(i)\nls.sort()\nans = ''.join(ls)\nprint(ans)", "passed": true, "time": 0.19, "memory": 14056.0, "status": "done"}, {"code": "#!/usr/bin/env python\n\nn = int(input())\ns = [input() for _ in range(n)]\n\nd = {}\nfor i in range(len(s[0])):\n if s[0][i] not in d:\n d[s[0][i]] = 1 \n else:\n d[s[0][i]] += 1\n\nfor i in range(n):\n for key in list(d.keys()):\n tmp = 0 \n for k in range(len(s[i])):\n if s[i][k] == key:\n tmp += 1\n if tmp <= d[key]:\n d[key] = tmp \n\n# print('d =', d)\nd = sorted(list(d.items()), key=lambda x:x[0])\nans = ''\nfor i in range(len(d)):\n for _ in range(d[i][1]):\n ans += d[i][0]\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "n = int(input())\nlst = []\nfor i in range(n):\n lst.append(input())\nabc = [chr(ord('a') + i) for i in range(26)]\n#print(abc)###\ncnt = []\nfor s in abc:\n temp = 100\n for i in range(n):\n temp = min(temp, lst[i].count(s))\n cnt.append(temp)\n#print(cnt)###\nres = []\nfor i in range(26):\n for j in range(cnt[i]):\n res.append(abc[i])\nprint(''.join(res))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "n = int(input())\nd = {}\nfor i in range(n):\n s = input()\n for w in d:\n if s.count(w)==0:\n d[w]=0\n for c in s:\n if i==0:\n d[c] = d.get(c, 0) + 1\n else:\n d[c] = min(d.get(c, 0), s.count(c))\n\nli = []\nfor w in d:\n for i in range(d[w]):\n li.append(w)\nli.sort()\nprint(\"\".join(li))", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "from collections import Counter\n\nN = int(input())\nC = [Counter(input()) for _ in range(N)]\n# print(f'{C=}')\n\nword_set = set(C[0].keys())\nfor c in C:\n word_set &= set(list(c.keys()))\n# print(f'{word_set=}')\n\nW = {key: 10**8 for key in word_set}\nfor c in C:\n for word in word_set:\n W[word] = min(W.get(word, 0), c.get(word, 0))\n# print(f'{W=}')\n\nans = ''\nfor key, value in list(W.items()):\n ans += key * value\n# print(f'{ans=}')\nprint((''.join(sorted(ans))))\n", "passed": true, "time": 0.17, "memory": 14060.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Sep 29 14:54:30 2020\n\n@author: liang\n\"\"\"\n\nn = int(input())\nS = [input() for _ in range(n)]\n\nans = [100]*26\n\nfor i in range(n):\n tmp = [0]*26\n for s in S[i]:\n key = ord(s)-ord('a')\n if tmp[key] < ans[key]:\n tmp[key] += 1\n ans = tmp.copy()\n\nres = \"\"\nfor i in range(26):\n res += chr(ord('a') + i)*tmp[i]\nprint(res)", "passed": true, "time": 0.14, "memory": 14356.0, "status": "done"}, {"code": "n=int(input())\nd={}\nfor i in range(n):\n s=input()\n d[i]={}\n for c in s:\n if c in d[i]:\n d[i][c]+=1\n else:\n d[i][c]=1\n# print(d)\nk={chr(i)for i in range(97,123)}\nfor e in d:\n k&=set(d[e].keys())\n# print(k)\nfor t in sorted(k):\n m=float('inf')\n for e in d:\n m=min(m,d[e][t])\n print(t*m,end='')\nprint('')\n", "passed": true, "time": 0.19, "memory": 14120.0, "status": "done"}, {"code": "from collections import Counter\nn = int(input())\nX = input()\npreC = Counter(X)\npreS = set(X)\nfor _ in range(n - 1):\n X = input()\n C = Counter(X)\n preS = set(X) & preS\n d = {}\n for s in preS:\n d[s] = min(C[s], preC[s])\n preC = d\nans = []\nfor s in preS:\n for _ in range(preC[s]):\n ans.append(s)\nprint(\"\".join(sorted(ans)))", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "from collections import Counter\n\n\ndef __starting_point():\n C = Counter()\n N = int(input())\n for c in [chr(n) for n in range(ord(\"a\"), ord(\"z\")+1)]:\n C[c] = 10**8\n for _ in range(N):\n cs = Counter(input())\n C &= cs\n for k, v in C.items():\n print(k*v, end=\"\")\n print()\n\n__starting_point()", "passed": true, "time": 0.23, "memory": 14164.0, "status": "done"}, {"code": "from collections import Counter\nfrom string import ascii_lowercase\nn = int(input())\ns = {ai:float(\"INF\") for ai in ascii_lowercase}\n\nfor i in range(n):\n si = input()\n c = Counter(si)\n for k in ascii_lowercase:\n s[k] = min(s[k],c[k])\n\nans = \"\"\nfor key in ascii_lowercase:\n ans += key*s[key]\nprint(ans)", "passed": true, "time": 0.19, "memory": 14064.0, "status": "done"}, {"code": "from collections import defaultdict\n\nN = int(input())\nS = [input() for _ in range(N)]\n\nd = defaultdict(lambda: 50+1)\n\nfor i in range(N):\n for c in range(ord(\"a\"), ord(\"z\")+1):\n d[chr(c)] = min(d[chr(c)], S[i].count(chr(c)))\n\nans = \"\"\nfor key, value in d.items():\n ans += key * value\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "#75 C - \u602a\u6587\u66f8\nimport collections\nn = int(input())\nS = [input() for _ in range(n)]\n\ncnt = collections.Counter(S[0])\nfor s in S[1:]:#O (50)\n for a in cnt.keys():# O(26)\n if a in s:# O(50)\n cnt[a] = min(cnt[a],s.count(a))# O(50)\n else:\n cnt[a] = 0\n \nans = [key*value for key,value in cnt.items() if value > 0]\nans = sorted(ans,reverse = False)\nprint(''.join(ans))", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n=int(input())\nwords=[]\nfor i in range(n):\n words.append(input())\n \ns=words.pop()\nfor i in words:\n ns=\"\"\n l=list(i)\n for j in s:\n if j in l:\n ns+=j\n l.remove(j)\n s=ns\ns=sorted(list(s))\nout=\"\"\nfor i in s:\n out+=i\nprint(out)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "from collections import Counter\n\nn = int(input())\nl = []\nfor i in range(n):\n l.append(dict(Counter(input())))\n\nl.sort(key=len)\n\nans = []\nfor ki, vi in l[0].items():\n tmp = vi\n for j in range(1, n):\n if ki in l[j]:\n tmp = min(tmp, l[j][ki])\n else:\n break\n else:\n ans.append(ki * tmp)\nans.sort()\nprint(*ans, sep=\"\")", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "n = int(input())\ns1 = input()\nd = {}\n\nfor i in range(len(s1)):\n if s1[i] in d:\n d[s1[i]] += 1\n else:\n d[s1[i]] = 1\n\nfor i in range(n-1):\n di = {}\n s = input()\n for i in range(len(s)):\n if s[i] in di:\n di[s[i]] += 1\n else:\n di[s[i]] = 1\n\n delete = []\n for key, value in d.items():\n if key in di:\n d[key] = min(value, di[key])\n else:\n delete.append(key)\n\n for key in delete:\n del d[key]\n\nans = \"\"\n\nfor key, value in sorted(d.items()):\n ans += key*value\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "n = int(input())\ns_l = [ input() for _ in range(n) ]\n\nd = {}\nfor i in list(s_l[0]):\n if i in d.keys():\n d[i] += 1\n else:\n d[i] = 1\nc_l = set(list(s_l[0]))\n\n\nfor s in s_l[1:]:\n for c in list(c_l):\n count = list(s).count(c)\n if d[c] > count:\n d[c] = count\n\nans = []\nfor k in list(c_l):\n for _ in range(d[k]):\n ans.append(k)\nans = sorted(ans)\nans2 = ''\nfor a in ans:\n ans2 += a\nprint(ans2)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n = int(input())\nd = {}\ns = input()\nfor c in set(s):\n d[c] = s.count(c)\nfor _ in range(n-1):\n s = input()\n for c in d.keys():\n d[c] = min(d[c], s.count(c))\nd_sorted = sorted(d.items(), key=lambda x:x[0])\nans = ''\nfor item in d_sorted:\n ans += item[0]*item[1]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "n=int(input())\n\n\nalphabet_count={}\n\nalphabet=\"abcdefghijklmnopqrstuvwxyz\"\n\nfor alpha in alphabet:\n alphabet_count[alpha]= 1000000000\n\nmojis=[]\nfor i in range(n):\n mojis.append(input())\n\ndef get_count(moji):\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n alphabet_count = {}\n for alpha in alphabet:\n alphabet_count[alpha] = 0\n for m in moji:\n alphabet_count[m]+=1\n return alphabet_count\n\n\n\n\nfor moji in mojis:\n each_count=get_count(moji)\n for alpha in alphabet:\n alphabet_count[alpha]=min(alphabet_count[alpha],each_count[alpha])\n\nans=\"\"\n\nfor alpha in alphabet:\n for i in range(alphabet_count[alpha]):\n ans=ans+alpha\nprint(ans)\n\n\n\n\n", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "import operator\nfrom collections import defaultdict\nfrom functools import reduce\n\nn = int(input())\narr = [input() for _ in range(n)]\nl = list(reduce(operator.and_, [set(i) for i in arr]))\nd = defaultdict(lambda: 1<<60)\nl.sort()\n\nfor s in arr:\n for c in l:\n cnt = s.count(c)\n d[c] = min(d[c], cnt)\n\nres = []\nfor k, v in d.items():\n res.append(k*v)\nans = \"\".join(res)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "from collections import defaultdict\nfrom collections import deque\nfrom collections import Counter\nimport itertools\nimport math\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\n\nn = readInt()\nsn = [list(input()) for i in range(n)]\nsnc = [Counter(sn[i]) for i in range(n)]\n\ns = set(sn[0])\nfor i in range(n):\n\ts = s & set(sn[i])\n\ns = sorted(list(s))\nans = \"\"\nfor c in s:\n\tm = float(\"inf\")\n\tfor i in range(n):\n\t\tm = min(m, snc[i][c])\n\tans+=c*m\n\nprint(ans)", "passed": true, "time": 0.23, "memory": 14216.0, "status": "done"}, {"code": "from collections import Counter\nn=int(input())\ns=Counter(input())\nfor i in range(n-1):\n s&=Counter(input())\nprint(\"\".join(sorted(s.elements())))", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "n=int(input())\ndata=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\ndict={}\nfor i in range(n):\n a=input()\n for j in data:\n if j not in dict:\n dict[j]=a.count(j)\n else:\n dict[j]=min(dict[j],a.count(j))\nans=[]\nfor i in dict:\n ans.append(i*dict[i])\nprint(*ans,sep='')", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "def main():\n n = int(input())\n s = [input() for i in range(n)]\n nums = [1000 for i in range(26)]\n for i in range(26):\n for j in range(n):\n nums[i] = min(nums[i],s[j].count((chr)(97 + i)))\n\n for i in range(26):\n while nums[i] > 0:\n print((chr)(97 + i),end = \"\")\n nums[i] -= 1\n print(\"\")\n\nmain()", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "from collections import Counter\n\nalph = 'abcdefghijklmnopqrstuvwxyz'\nn = int(input())\nS = [input() for _ in range(n)]\ncntS = [None] * n\nfor i in range(n):\n cntS[i] = Counter(S[i])\n\nans = []\nfor c in alph:\n ans += [c * min(cntS[i][c] for i in range(n))]\n\nprint(''.join(ans))", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "n = int(input())\n\nalphabet_cnt = [[0] * n for i in range(26)]\n# [listA, listB, listC, ..., listZ]\n# listA = [0, 1, 3, 2, 1, 4, ...] -> the number of A in Si (only min val is needed)\nalphabet = list(\"abcdefghijklmnopqrstuvwxyz\")\nalphabet_map = dict(zip(alphabet, list(range(26))))\n\nfor i in range(n):\n si = input()\n for j in range(len(si)):\n alphabet_cnt[alphabet_map[si[j]]][i] += 1\n\nalphabet_intersect = [min(alp) for alp in alphabet_cnt]\nprint(\"\".join([alphabet[idx] * cnt for idx, cnt in enumerate(alphabet_intersect)]))", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "from collections import Counter\nn = int(input())\n\nD = Counter(list(input()))\nfor i in range(n-1):\n d = Counter(list(input()))\n key = D.keys()\n for k in key:\n D[k] = min(D[k], d[k])\n\nans = []\nkey = D.keys()\nfor k in key:\n for i in range(D[k]):\n ans.append(k)\nans.sort()\nprint(\"\".join(ans))", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "ma = lambda :map(int,input().split())\nlma = lambda :list(map(int,input().split()))\ntma = lambda :tuple(map(int,input().split()))\nni = lambda:int(input())\nyn = lambda fl:print(\"Yes\") if fl else print(\"No\")\nimport collections\nimport math\nimport itertools\nimport heapq as hq\nimport sys\n\nn = ni()\ncnts = []\nfor i in range(n):\n cnts.append(collections.Counter(list(input())))\nans=\"\"\nalp = list(\"abcdefghijklmnopqrstuvwxyz\")\nfor w in alp:\n tmp=10**10\n for i in range(n):\n tmp = min(tmp,cnts[i][w])\n ans+= w*tmp\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "# \u8981\u7d20\u304c\u5165\u3063\u3066\u306a\u3044\u5834\u5408\u306e list.index \u306e\u5b9a\u7fa9\ndef myindex(l:list, element, default=-1):\n if element in set(l):\n return l.index(element)\n else:\n return default\n\ndef main():\n n = int(input())\n S = []\n ans = ''\n for _ in range(n):\n S.append(list(input()))\n \n S.sort()\n t = S.pop()\n for i, u in enumerate(t):\n okflag = True\n for s in S:\n if myindex(s, u) == -1:\n okflag = False\n break\n if okflag:\n for s in S:\n s.pop(s.index(u))\n ans += u\n ans = sorted(ans)\n print((''.join(ans)))\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "from copy import deepcopy\nn = int(input())\ns = [input() for _ in range(n)]\ncnt = []\n\nfor si in s:\n tmp = [0] * 26\n for i in range(len(si)):\n tmp[ord(si[i])-97] += 1\n if cnt == []:\n cnt = deepcopy(tmp)\n else:\n for j in range(26):\n cnt[j] = min(cnt[j], tmp[j])\n\nans = ''\nfor i in range(26):\n for j in range(cnt[i]):\n ans += chr(i+97)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "from collections import Counter\n\nn = int(input())\ns = Counter(input())\n\nfor i in range(n-1):\n s &= Counter(input())\n\nres = \"\"\nfor char, count in s.items():\n res += char*count\nprint(*sorted(res), sep=\"\")\n", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "import collections\nn=int(input())\na=collections.Counter(input())\nfor i in range(n-1):\n s=collections.Counter(input())\n a=a&s\nans=\"\"\nk=list(a.keys())\nv=list(a.values())\nfor i,j in zip(k,v):\n ans+=i*j\nprint((\"\".join(sorted(ans))))\n", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "n = int(input())\nres_map = dict()\ns = input()\ntmp_map = dict()\nfor j in s:\n if j not in tmp_map:\n tmp_map[j] = 1\n else:\n tmp_map[j] += 1\nfor j in list(tmp_map.keys()):\n res_map[j] = tmp_map[j]\n\nfor i in range(n - 1):\n s = input()\n tmp_map = dict()\n for j in s:\n if j not in tmp_map:\n tmp_map[j] = 1\n else:\n tmp_map[j] += 1\n for j in list(res_map.keys()):\n if j in tmp_map:\n res_map[j] = min(res_map[j], tmp_map[j])\n else:\n res_map[j] = 0\n\nres = \"\"\nfor i in list(res_map.keys()):\n res += i * res_map[i]\n\nres = sorted(res)\nprint((\"\".join(res)))\n", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n=int(input())\nabc='abcdefghijklmnopqrstuvwxyz'\ns=[]\nt=[51]*len(abc)\n#print(t)\nfor i in range(n):\n u=input()\n for j in range(len(abc)):\n v=u.count(abc[j])\n t[j]=min(t[j],v)\nans=''\nfor j in range(len(abc)):\n ans+=t[j]*abc[j]\nprint(ans)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "n = int(input())\nans = list(input())\nfor i in range(n-1):\n s = list(input())\n t = []\n for j in ans:\n if j in s:\n s.remove(j)\n t.append(j)\n ans = t\nans.sort()\nprint(\"\".join(ans))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}]
[{"input": "3\ncbaa\ndaacc\nacacac\n", "output": "aac\n"}, {"input": "3\na\naa\nb\n", "output": "\n"}]
4,720
Joisino is working as a receptionist at a theater. The theater has 100000 seats, numbered from 1 to 100000. According to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive). How many people are sitting at the theater now? -----Constraints----- - 1≤N≤1000 - 1≤l_i≤r_i≤100000 - No seat is occupied by more than one person. - All input values are integers. -----Input----- Input is given from Standard Input in the following format: N l_1 r_1 : l_N r_N -----Output----- Print the number of people sitting at the theater. -----Sample Input----- 1 24 30 -----Sample Output----- 7 There are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.
introductory
[{"code": "N = int(input())\nans = 0\nfor _ in range(N):\n a, b = map(int, input().split())\n ans += b - a + 1\nprint(ans)", "passed": true, "time": 1.8, "memory": 14164.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor _ in range(N):\n l, r = map(int, input().split())\n ans += r-l+1\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "a=int(input())\nb=[input().split() for i in range(a)]\nc=0\nfor i in range(a):\n c=c+(int(b[i][1])-int(b[i][0]))\nprint(c+a)", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "N = int(input())\nseat = 0\nfor i in range(N):\n l, r = map(int, input().split())\n seat += r - l + 1\nprint(seat)", "passed": true, "time": 0.3, "memory": 13956.0, "status": "done"}, {"code": "N = int(input())\nres = 0\n\nfor i in range(N):\n l, r = map(int,input().split())\n res += r - l + 1\n \nprint(res)", "passed": true, "time": 0.3, "memory": 14004.0, "status": "done"}, {"code": "n = int(input())\nseat = [0] * (10 ** 5 + 1)\nfor i in range(n):\n l, r = list(map(int, input().split()))\n seat[l - 1] += 1\n seat[r] -= 1\n\nfor i in range(1, 10 ** 5):\n seat[i] += seat[i - 1]\n\nres = 0\nfor i in range(10 ** 5):\n if seat[i] == 1:\n res += 1\nprint(res)\n", "passed": true, "time": 0.18, "memory": 14152.0, "status": "done"}, {"code": "print(sum([r-l+1 for l,r in [list(map(int,input().split())) for _ in range(int(input()))]]))", "passed": true, "time": 0.24, "memory": 14340.0, "status": "done"}, {"code": "N = int(input())\nppl = 0\nfor i in range(N):\n tmp = input().split(\" \")\n ppl += int(tmp[1]) - int(tmp[0]) + 1\n\nprint(ppl)", "passed": true, "time": 0.3, "memory": 14216.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n a,b = map(int,input().split())\n ans += b-a+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14024.0, "status": "done"}, {"code": "n=int(input())\nans = 0\nfor i in range(n):\n a,b=(int(x) for x in input().split())\n c = b-a+1\n ans += c\n\nprint(ans)", "passed": true, "time": 0.16, "memory": 14320.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n l, r = map(int, input().split())\n ans += r-l+1\n\nprint(ans)", "passed": true, "time": 0.3, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\n\ncnt = 0\n\nfor _ in range(N):\n l, r = map(int,input().split())\n cnt += r - l + 1\n \nprint(cnt)", "passed": true, "time": 0.15, "memory": 14156.0, "status": "done"}, {"code": "n = int(input())\nsum = 0\nfor _ in range(n):\n a, b = map(int, input().split())\n sum += b-a+1\nprint(sum)", "passed": true, "time": 0.23, "memory": 14188.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor i in range(N):\n l,r=map(int,input().split())\n ans += r-l+1\nprint(ans)", "passed": true, "time": 0.23, "memory": 14152.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor _ in range(n):\n l,r = list(map(int, input().split()))\n ans += r - l + 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "def main():\n n = int(input())\n ans = 0\n for _ in range(n):\n a, b = list(map(int, input().split()))\n ans += b - a + 1\n print(ans)\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n = int(input())\nli = [list(map(int,input().split())) for i in range(n)]\ncnt = 0\nfor i in li:\n cnt += i[1] - i[0] +1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "n=int(input())\nkei=0\nfor i in range(n):\n l,r=map(int,input().split())\n kei += r-l+1\nprint(kei)", "passed": true, "time": 0.24, "memory": 14060.0, "status": "done"}, {"code": "ans=0\nN=int(input())\nfor i in range(N):\n a,b=map(int,input().split())\n ans+=b-a+1\nprint(ans)", "passed": true, "time": 0.23, "memory": 14024.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor i in range(N):\n l,r = map(int,input().split())\n ans += r - l + 1\nprint(str(ans))", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "a=int(input())\nans=0\nfor i in range(a):\n x,y=map(int,input().split())\n ans+=y-x+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "N=int(input())\npeople=0\nfor i in range(N):\n l,r=list(map(int,input().split()))\n people+=r-l+1\nprint(people)\n", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\nres = 0\nfor i in range(n):\n r, l = list(map(int, input().split()))\n res += l - r + 1\nprint(res)\n", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n a, b = list(map(int, input().split()))\n ans += b - a + 1\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n l, r = map(int, input().split())\n ans += (r - l + 1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\nlr = [list(map(int, input().split())) for i in range(n)]\nans = 0\nfor i in range(n):\n ans += (lr[i][1]-lr[i][0]+1)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "N = int(input())\np = 0\nfor i in range(N):\n l, r = map(int,input().split())\n p += r-l+1\nprint(p)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n=int(input())\nans=0\nfor i in range(n):\n l,r=list(map(int,input().split()))\n ans+=r-l+1\n\nprint(ans)\n", "passed": true, "time": 0.23, "memory": 14164.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\nn = int(input())\na = [0]*n\nb = [0]*n\nans = 0\n\nfor i in range(n):\n a[i],b[i] = list(map(int, input().split()))\n\nfor i in range(n):\n ans += b[i] - a[i] + 1\n\nprint(ans)\n\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "n=int(input())\n\ncnt=0\n\nfor i in range(n):\n l,r = map(int, input().split())\n cnt += r-l+1\n\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n = int(input())\nl = [tuple(map(int, input().split())) for i in range(n)]\n\ncnt = 0\nfor i in l:\n cnt += (i[1] - i[0] + 1)\nprint(cnt)\n", "passed": true, "time": 0.27, "memory": 14288.0, "status": "done"}, {"code": "n=int(input())\nans=0\nfor i in range(n):\n l,r=list(map(int,input().split()))\n ans+=r-l+1\nprint(ans)\n", "passed": true, "time": 0.25, "memory": 14216.0, "status": "done"}, {"code": "N = int(input())\nlr = [list(map(int,input().split())) for i in range(N)]\nans = 0\nfor i in lr:\n ans += i[1] -i[0] + 1\nprint(ans)", "passed": true, "time": 0.28, "memory": 14068.0, "status": "done"}, {"code": "N = int(input())\nans = 0\n\nfor _ in range(N):\n l, r = map(int, input().split())\n ans += r - l + 1\n\nprint(ans)", "passed": true, "time": 0.25, "memory": 14264.0, "status": "done"}, {"code": "n=int(input())\nhito=0\nfor i in range(n):\n l,r=map(int, input().split())\n hito+=r-l+1\nprint(hito)", "passed": true, "time": 0.23, "memory": 14088.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\ndef main():\n n = int(input())\n ans = 0\n for i in range(n):\n l, r = list(map(int, input().split()))\n ans += r - l + 1\n print(ans)\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.16, "memory": 14116.0, "status": "done"}, {"code": "N=int(input())\nl=[0]*N\nr=[0]*N\nsum=0\nfor i in range(N) :\n l[i],r[i]=map(int,input().split())\n sum+=r[i]-l[i]+1\nprint(sum)", "passed": true, "time": 0.24, "memory": 14172.0, "status": "done"}, {"code": "# coding = SJIS\n\nn = int(input())\nmen = []\nfor i in range(n):\n l, r = map(int, input().split())\n men.append([l, r])\nans = 0\n\nfor i in range(n):\n ans += men[i][1] - men[i][0] + 1\n\nprint(ans)", "passed": true, "time": 0.16, "memory": 14072.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n l,r = map(int,input().split())\n ans += (r-l+1)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\nsum = 0\nfor i in range(N):\n l, r = map(int, input().split())\n sum += (r-l) + 1\n \nprint(sum)", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "# \u5165\u529b\nN=int(input())\n\nsm=0\n\nfor i in range(N):\n l,r=map(int,input().split())\n sm+=r-l+1\n\n# \u51fa\u529b\nprint(sm)", "passed": true, "time": 0.16, "memory": 14296.0, "status": "done"}, {"code": "n = int(input())\np = 0\nfor i in range(n):\n l, r = map(int, input().split())\n p += r-l+1\n \nprint(p)", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "#https://atcoder.jp/contests/abc073/tasks/abc073_b\nN = int(input())\nans = 0\nfor i in range(N):\n st,sp = map(int,input().split())\n ans += abs(sp-st+1)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14164.0, "status": "done"}, {"code": "N = int(input())\ns = 0\nfor _ in range(N):\n a, b = map(int, input().split())\n s += b - a + 1\nprint(s)", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor _ in range(N):\n l,r = map(int,input().split())\n ans += r - l + 1\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "n = int(input())\ntotal = 0\nfor i in range(n):\n l, r = map(int,input().split())\n total += r - l + 1\nprint(total)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\nans = 0\n\nfor i in range(N):\n l,r = list(map(int, input().split()))\n ans += r - l + 1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "#k = int(input())\n#s = input()\n#a, b = map(int, input().split())\n#s, t = map(str, input().split())\n#l = list(map(int, input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\n#a = [list(input()) for _ in range(n)]\n#a = [int(input()) for _ in range(n)]\n\n\nn = int(input())\n\nans = 0\n\nfor i in range(n):\n l, r = list(map(int, input().split()))\n ans += r - l + 1\nprint(ans)\n", "passed": true, "time": 0.13, "memory": 14176.0, "status": "done"}, {"code": "n = int(input())\nA = [tuple(map(int, input().split())) for _ in range(n)]\n\nans = 0\nfor l, r in A:\n ans += r - l + 1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "# ABC073\nN = int(input())\nL_R = [list(map(int, input().split())) for _ in range(N)]\nans = 0\nfor l, r in L_R:\n ans += r - l + 1\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\n\nnum = 0\n\nfor i in range(n):\n l,r = map(int,input().split())\n num += (r - l + 1)\n \nprint(num)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "IS = lambda: int(input())\nIA = lambda: [int(x) for x in input().split()]\nIM = lambda N: [IA() for _ in range(N)]\n\nans = 0\nfor l,r in IM(IS()):\n ans += r - l + 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "def mapt(fn, *args):\n return tuple(map(fn, *args))\n\n\ndef Input():\n return mapt(int, input().split(\" \"))\n\n\ndef main():\n n = int(input())\n data =[Input() for _ in range(n)]\n ans = 0\n for start, end in data:\n for _ in range(start, end+1):\n ans += 1\n print(ans)\n\n\nmain()", "passed": true, "time": 0.31, "memory": 13968.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n l,r = map(int,input().split())\n ans += r+1-l\nprint(ans)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor i in range(N):\n l, r = list(map(int, input().split()))\n ans += r-l+1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "n = int(input())\ndata = [input().split() for i in range(n)]\nans = 0\nfor i in range(n):\n ans += int(data[i][1]) - int(data[i][0]) + 1\nprint(ans)", "passed": true, "time": 0.3, "memory": 13980.0, "status": "done"}, {"code": "n=int(input())\nans=0\nfor i in range(n):\n l,r=list(map(int,input().split()))\n ans+=r-l+1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "n = int(input())\nnum = 0\nfor i in range(n):\n l, r = map(int, input().split())\n num += (r - l) + 1\nprint(num)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n = int(input())\nflg = [0]*100000\nfor _ in range(n):\n l,r = list(map(int,input().split()))\n for i in range(l,r+1):\n flg[i-1] = 1\nprint((flg.count(1)))\n", "passed": true, "time": 0.24, "memory": 14104.0, "status": "done"}, {"code": "N = int(input())\n\nans = 0\n\nfor i in range(N):\n L = input().split()\n ans += int(L[1]) - int(L[0]) + 1\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14028.0, "status": "done"}, {"code": "n = int(input())\ntmp = 0\nnum_person = []\nfor _ in range(n):\n l, r = map(int, input().split())\n tmp = r-l+1\n num_person.append(tmp)\n\nans = 0\nfor i in num_person:\n ans += i\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n l, r = map(int, input().split())\n ans += r - l + 1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n l, r = map(int, input().split())\n ans += r - l + 1\nprint(ans)", "passed": true, "time": 0.24, "memory": 13996.0, "status": "done"}, {"code": "n = int(input())\nseat = [0] * 10 ** 6\nfor i in range(n):\n l, r = list(map(int, input().split()))\n for j in range(l, r + 1):\n seat[j - 1] = 1\n\nres = 0\nfor i in range(10 ** 6):\n if seat[i] == 1:\n res += 1\nprint(res)\n", "passed": true, "time": 0.4, "memory": 21180.0, "status": "done"}, {"code": "N = int(input())\nres = 0\nfor _ in range(N):\n l, r = list(map(int, input().split()))\n res += r - l + 1\n\nprint(res)\n", "passed": true, "time": 0.15, "memory": 14276.0, "status": "done"}, {"code": "n=int(input())\ncount=0\nfor _ in range(n):\n l,r=map(int,input().split())\n count+=r-l+1\nprint(count)", "passed": true, "time": 0.16, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\na = 0\nfor i in range(N):\n line = list(map(int,input().split()))\n a +=(line[-1]-line[0]+1)\nprint(a)", "passed": true, "time": 0.15, "memory": 14032.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor _ in range(N):\n l,r = map(int,input().split())\n ans += (r-l)+1\nprint(ans)", "passed": true, "time": 0.24, "memory": 14292.0, "status": "done"}, {"code": "n = int(input())\na = 0\nfor _ in range(n):\n l, r = map(int, input().split())\n a += r - l + 1\nprint(a)", "passed": true, "time": 0.24, "memory": 14080.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor i in range(N):\n l,r=map(int,input().split())\n ans += r-l+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "n =int(input())\n\ntotal = 0\nfor i in range(n):\n a = list(map(int, input().split()))\n total += a[1] - a[0] + 1\n\nprint(total)", "passed": true, "time": 0.23, "memory": 14048.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor i in range(N):\n L,R=map(int,input().split())\n ans+=R-L+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "n = int(input())\nres = 0\nfor i in range(n):\n l, r = map(int, input().split())\n res += r - l + 1\nprint(res)", "passed": true, "time": 0.15, "memory": 14296.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor _ in range(N):\n l, r=map(int, input().split())\n ans+=r-l+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "N = int (input ())\nx = 0\nfor i in range (N):\n s,g = map (int, input ().split ())\n le = g-s+1\n x += le\nprint (x)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\ncnt = 0\nfor i in range(n):\n l, r = [int(x) for x in input().split()]\n cnt+=r-l+1\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor _ in range(n):\n l,r = map(int,input().split())\n ans += r-l\nprint(ans+n)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\nl = [0] * n\nr = [0] * n\nfor i in range(n):\n l[i],r[i] = map(int, input().split())\nres = 0\n\nfor i in range(n):\n res += r[i]-l[i]+1\n\nprint(res)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "N = int(input())\nans = 0\nfor _ in range(N):\n l, r = (int(x) for x in input().split())\n ans += r-l+1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "a=int(input())\nx = \"\"\ny = 0\nfor i in range(a):\n x=input().split()\n y+=abs(int(x[0])-int(x[1]))+1\nprint(y)", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "N=int(input())\nprint(sum(r-l+1 for l,r in (map(int,input().split()) for _ in range(N))))", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "from typing import List\n\n\ndef answer(n: int, lrs: List[List[int]]) -> int:\n number_of_people_sitting = 0\n for lr in lrs:\n l, r = lr\n number_of_people_sitting += r - l + 1\n\n return number_of_people_sitting\n\n\ndef main():\n n = int(input())\n lrs = [map(int, input().split()) for _ in range(n)]\n print(answer(n, lrs))\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 15156.0, "status": "done"}, {"code": "n = int(input())\nc = 0\nfor i in range(n):\n l,r = map(int, input().split())\n c += r-l+1\nprint(c)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "N=int(input())\nans=0\nfor _ in range(N):\n l,r=list(map(int,input().split()))\n ans+=r-l+1\nprint(ans)\n", "passed": true, "time": 0.23, "memory": 14264.0, "status": "done"}, {"code": "N = int(input())\n\nans = 0\n\nfor _ in range(N):\n l,r = map(int, input().split())\n ans += r - l + 1\n\nprint(ans)", "passed": true, "time": 0.57, "memory": 14244.0, "status": "done"}, {"code": "n = int(input())\nnum = 0\nfor i in range(n):\n l,r = map(int, input().split())\n num += (r-l+1)\nprint(num)", "passed": true, "time": 0.22, "memory": 14152.0, "status": "done"}, {"code": "N = int(input())\nl = [0] * N\nr = [0] * N\nfor i in range(N):\n l[i], r[i] = list(map(int, input().split()))\n\nans = 0\nfor i in range(N):\n ans += r[i] - (l[i] - 1)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n=int(input())\nlr=[list(map(int,input().split())) for i in range(n)]\nans=0\nfor i in range(n):\n ans+=(lr[i][1]-lr[i][0]+1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "#\n# abc073 b\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"1\n24 30\"\"\"\n output = \"\"\"7\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"2\n6 8\n3 3\"\"\"\n output = \"\"\"4\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n N = int(input())\n LR = [list(map(int, input().split())) for _ in range(N)]\n\n ans = 0\n for lr in LR:\n l, r = lr\n ans += r - l + 1\n\n print(ans)\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14388.0, "status": "done"}, {"code": "n = int(input())\n# seat = [0] * 10 ** 6\nseat = [0] * 10 ** 5\nfor i in range(n):\n l, r = list(map(int, input().split()))\n for j in range(l, r + 1):\n seat[j - 1] = 1\n\nres = 0\n# for i in range(10 ** 6):\nfor i in range(10 ** 5):\n if seat[i] == 1:\n res += 1\nprint(res)\n", "passed": true, "time": 0.16, "memory": 14280.0, "status": "done"}, {"code": "N = int(input())\ncnt = 0\nfor _ in range(N):\n l, r = map(int, input().split())\n cnt += r - l + 1\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "n = int(input())\nans = 0\nfor i in range(n):\n a, b = map(int, input().split())\n ans += (b - a + 1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "n = int(input())\n#a, b = map(int,input().split())\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\nans = 0\nfor i in range(n):\n l, r = list(map(int, input().split()))\n ans += r-l+1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "N = int(input())\nsum = 0\nfor i in range(N):\n l, r = map(int, input().split())\n sum += r - l + 1\nprint(sum)", "passed": true, "time": 0.14, "memory": 14020.0, "status": "done"}, {"code": "n = int(input())\nres = 0\nfor i in range(n):\n a = [int(x) for x in input().split()]\n res += a[1] - a[0] + 1\nprint(res)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}]
[{"input": "1\n24 30\n", "output": "7\n"}, {"input": "2\n6 8\n3 3\n", "output": "4\n"}]
4,721
In K-city, there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city? -----Constraints----- - 2 ≤ n, m ≤ 100 -----Input----- Input is given from Standard Input in the following format: n m -----Output----- Print the number of blocks in K-city. -----Sample Input----- 3 4 -----Sample Output----- 6 There are six blocks, as shown below:
introductory
[{"code": "a, b = map(int, input().split())\nprint((a - 1) * (b - 1))", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "n,m = map(int,input().split())\n\nprint((n-1)*(m-1))", "passed": true, "time": 0.15, "memory": 14224.0, "status": "done"}, {"code": "m, n = map(int, input().split())\nprint((m - 1) * (n - 1))", "passed": true, "time": 0.24, "memory": 14180.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "x,y=map(int,input().split())\n\nprint((x-1)*(y-1))", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nprint(((n-1)*(m-1)))\n", "passed": true, "time": 0.23, "memory": 14232.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.27, "memory": 14216.0, "status": "done"}, {"code": "#\n# abc069 a\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"3 4\"\"\"\n output = \"\"\"6\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"2 2\"\"\"\n output = \"\"\"1\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n n, m = list(map(int, input().split()))\n print(((n-1)*(m-1)))\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.24, "memory": 14592.0, "status": "done"}, {"code": "nums = list(map(int, input().split()))\nprint((nums[0] - 1) * (nums[1] - 1))", "passed": true, "time": 0.19, "memory": 14080.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nprint((n-1) * (m-1))", "passed": true, "time": 0.15, "memory": 14228.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nprint((N-1)*(M-1))", "passed": true, "time": 1.71, "memory": 14072.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nprint(((n - 1) * (m - 1)))\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.21, "memory": 14080.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nprint((n - 1)*(m - 1))", "passed": true, "time": 0.25, "memory": 14176.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nans = (n-1)*(m-1)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "n,m = map(int,input().split())\n \nprint((n-1)*(m-1)) ", "passed": true, "time": 0.15, "memory": 14176.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.23, "memory": 14112.0, "status": "done"}, {"code": "n, m = map(int,input().split())\n\nprint((n - 1) * (m - 1))", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.21, "memory": 14216.0, "status": "done"}, {"code": "n,m = list(map(int, input().split()))\nprint(( (n-1)*(m-1) ))\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.16, "memory": 14176.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nans = (n - 1) * (m - 1)\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14224.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nprint(~-n * ~-m)", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "a,b = map(int, input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "n, m = map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.15, "memory": 14272.0, "status": "done"}, {"code": "n,m = map(int,input().split())\n\nprint((n+1)*(m+1)-2*(n+1)-(m+1-2)*2)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.35, "memory": 14068.0, "status": "done"}, {"code": "a,b=map(int,input().split(\" \"))\nprint((a-1)*(b-1))", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "n,m=map(int, input().split()) \nprint((n-1)*(m-1))", "passed": true, "time": 0.36, "memory": 14180.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "a,b=list(map(int,input().split()))\nprint(((a-1)*(b-1)))\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "n,m = map(int, input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.15, "memory": 14292.0, "status": "done"}, {"code": "a, b = map(int, input().split())\na -= 1\nb -= 1\nprint(a * b)", "passed": true, "time": 0.34, "memory": 14276.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nprint((n - 1) * (m - 1))", "passed": true, "time": 0.21, "memory": 14320.0, "status": "done"}, {"code": "N,M=list(map(int,input().split()))\nprint(((N-1)*(M-1)))\n", "passed": true, "time": 0.22, "memory": 14208.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nprint((N-1)*(M-1))", "passed": true, "time": 0.2, "memory": 14068.0, "status": "done"}, {"code": "x,y=map(int,input().split())\nprint((x-1)*(y-1))", "passed": true, "time": 0.15, "memory": 14112.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nprint((a - 1) * (b - 1))", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nprint((n - 1) * (m - 1))", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "n, m = list(map(int,input().split(\" \")))\nprint(((n - 1) * (m - 1)))\n", "passed": true, "time": 0.18, "memory": 14288.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.18, "memory": 14200.0, "status": "done"}, {"code": "n, m = map(int, input().split())\n\nprint((n-1) * (m-1))", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "a, b = map(int, input().split())\na = a-1\nb = b-1\nprint(a*b)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint((a-1) * (b-1))", "passed": true, "time": 0.23, "memory": 14080.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.22, "memory": 14320.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nprint(((n - 1) * (m - 1)))\n", "passed": true, "time": 0.22, "memory": 14172.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint((a-1) * (b-1))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "n,m =map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nprint((N-1)*(M-1))", "passed": true, "time": 0.23, "memory": 14080.0, "status": "done"}, {"code": "#n = int(input())\nn,m = map(int,input().split())\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\nprint((m-1)*(n-1))", "passed": true, "time": 0.22, "memory": 14168.0, "status": "done"}, {"code": "m,n = map(int,input().split())\nprint((m-1)*(n-1))", "passed": true, "time": 0.24, "memory": 14028.0, "status": "done"}, {"code": "n, m= map(int, input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.24, "memory": 14016.0, "status": "done"}, {"code": "n,m = list(map(int,input().split()))\nprint(((n-1)*(m-1)))\n", "passed": true, "time": 0.16, "memory": 14040.0, "status": "done"}, {"code": "a = input().split()\nb,c = int(a[0]),int(a[1])\nprint((b-1)*(c-1))", "passed": true, "time": 0.27, "memory": 14168.0, "status": "done"}, {"code": "a, b = input().split()\n\nprint((int(a) - 1) * (int(b) - 1))", "passed": true, "time": 0.26, "memory": 14268.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "W, H = map(int, input().split())\nprint((W-1)*(H-1))", "passed": true, "time": 0.16, "memory": 14304.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nprint((N-1)*(M-1))", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "n,m=map(int,input().split());print((n-1)*(m-1))", "passed": true, "time": 0.23, "memory": 14104.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.21, "memory": 14188.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\n\nprint(((n - 1) * (m - 1)))\n", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nprint(((n - 1) * (m - 1)))\n", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "def iroha():\n a, b = list(map(int, input().split()))\n print(((a-1)*(b-1)))\n\ndef __starting_point():\n iroha()\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "n, m = map(int, input().split())\n\narea = (n - 1) * (m - 1)\nprint(area)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "a,b = map(int, input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nprint((a-1) * (b-1))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "a,b=input().split()\na=int(a)\nb=int(b)\nprint((a-1)*(b-1))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "n,m = [int(x) for x in input().split()]\nprint((n-1)*(m-1))", "passed": true, "time": 0.21, "memory": 14044.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nprint((a-1) * (b-1))", "passed": true, "time": 0.19, "memory": 14288.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\ndef main():\n n, m = list(map(int, input().split()))\n print(((n - 1) * (m - 1)))\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nprint(((n-1)*(m-1)))\n", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n, m = map(int, input().split())\n\nif n == 1 or m == 1:\n print(0)\nelse:\n print((n - 1) * (m - 1))", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "lst = input().split()\nprint((int(lst[0]) - 1) * (int(lst[1]) - 1))", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "x,y =map(int,input().split())\nprint((x-1)*(y-1))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "'''\nABC069 A - K-City\nhttps://atcoder.jp/contests/abc069/tasks/abc069_a\n'''\nn, m = list(map(int, input().split()))\nans = (n-1)*(m-1)\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "n, m = map(int, input().split())\n\nans = (n-1) * (m-1)\nprint(ans)", "passed": true, "time": 0.31, "memory": 14164.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nprint((n - 1) * (m - 1))", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nprint((N-1)*(M-1))", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "a,b=map(int,input().split())\n\nprint((a-1)*(b-1))", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nprint((n-1)*(m-1))", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\n# D = list(map(int,input().split()))\n# S = input()\n# X1_list = [int(input()) for i in range(N)]\n# X2_list = [list(map(int,input().split())) for i in range(N)]\n\nprint(((n - 1) * (m - 1)))\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint((a-1)*(b-1))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}]
[{"input": "3 4\n", "output": "6\n"}, {"input": "2 2\n", "output": "1\n"}]
4,722
Snuke is giving cookies to his three goats. He has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins). Your task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies. -----Constraints----- - 1 \leq A,B \leq 100 - Both A and B are integers. -----Input----- Input is given from Standard Input in the following format: A B -----Output----- If it is possible to give cookies so that each of the three goats can have the same number of cookies, print Possible; otherwise, print Impossible. -----Sample Input----- 4 5 -----Sample Output----- Possible If Snuke gives nine cookies, each of the three goats can have three cookies.
introductory
[{"code": "A, B = map(int, input().split())\nC = A + B\n\nprint(\"Possible\" if A%3==0 or B%3==0 or C%3==0 else \"Impossible\")", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\nif A%3 and B%3 and (A+B)%3:\n print(\"Impossible\")\nelse:\n print(\"Possible\")", "passed": true, "time": 0.24, "memory": 14316.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\n# A, B, A+B \u306e\u3044\u305a\u308c\u304b\u306e\u679a\u6570\u306e\u30af\u30c3\u30ad\u30fc\u3092\u30e4\u30ae\u305f\u3061\u306b\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u308b\n# 3\u5339\u306e\u30e4\u30ae \u304c\u540c\u3058\u679a\u6570\u305a\u3064\u98df\u3079\u3089\u308c\u308b\u3088\u3046\u306b\u30af\u30c3\u30ad\u30fc\u3092\u6e21\u3059\u3053\u3068\u304c\u53ef\u80fd\u306a\u3089\u3070 'Possible' \u3068\u3001\u305d\u3046\u3067\u306a\u3051\u308c\u3070 'Impossible' \u3068\u51fa\u529b\n\nif A % 3 == 0:\n print('Possible')\nelif B % 3 == 0:\n print('Possible')\nelif (A + B) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.15, "memory": 14072.0, "status": "done"}, {"code": "a=list(map(int,input().split()))\nb=sum(a)\n \nif (b%3 ==0 or a[0]%3 ==0 or a[1]%3==0) :\n print('Possible')\nelse :\n print('Impossible')", "passed": true, "time": 0.82, "memory": 14264.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif a % 3 == 0:\n print(\"Possible\")\nelif b % 3 == 0:\n print(\"Possible\")\nelif (a + b) % 3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 1.58, "memory": 14316.0, "status": "done"}, {"code": "# \u5165\u529b\nA, B = map(int,input().split())\n\n# \u51e6\u7406\nif (A + B) % 3 == 0 or A % 3 == 0 or B % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.15, "memory": 14184.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nprint((\"Impossible\", \"Possible\")[a % 3 * b % 3 * (a + b) % 3 == 0])", "passed": true, "time": 0.15, "memory": 14184.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.22, "memory": 14212.0, "status": "done"}, {"code": "# A - Sharing Cookies\n\n# A,B,A+B\u306e\u3044\u305a\u308c\u304b\u304c3\u306e\u500d\u6570\u304b\u3069\u3046\u304b\u5224\u5b9a\u3059\u308b\n\n\nA,B = list(map(int,input().split()))\n\nif A % 3 == 0\\\nor B % 3 == 0\\\nor (A+B) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')\n", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "a,b=list(map(int,input().split()))\nprint((\"Possible\" if any([x % 3 == 0 for x in [a,b,a+b]]) else \"Impossible\"))\n", "passed": true, "time": 0.24, "memory": 14096.0, "status": "done"}, {"code": "A, B = list(map(int, input().split()))\n\nif A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a,b = map(int,input().split())\n\nif a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif a%3 == 0 or b%3 == 0 or (a+b)%3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.23, "memory": 14212.0, "status": "done"}, {"code": "a, b = (int(x) for x in input().split())\nif a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0: ans = 'Possible'\nelse: ans = 'Impossible'\nprint(ans)", "passed": true, "time": 0.24, "memory": 14272.0, "status": "done"}, {"code": "A,B = map(int,input().split())\nif A%3==0 or B%3==0 or (A+B)%3==0:print(\"Possible\")\nelse : print(\"Impossible\")", "passed": true, "time": 0.24, "memory": 14224.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nprint(\"Possible\" if A * B * (A + B) % 3 == 0 else \"Impossible\")", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "a,b=list(map(int ,input().split()))\nif(a%3==0 or b%3==0 or (a+b)%3==0):\n\tprint(\"Possible\")\nelse:\n\tprint(\"Impossible\")\n", "passed": true, "time": 0.23, "memory": 14208.0, "status": "done"}, {"code": "A,B = map(int,input().split())\n\nif A % 3 == 0 or B % 3 == 0 or (A + B) % 3 ==0: # 3\u3067\u5272\u3063\u3066\u4f59\u308a\u304c\u51fa\u306a\u3051\u308c\u3070\u30013\u5339\u5e73\u7b49\u306b\u6e21\u305b\u308b\n print('Possible')\n\nelse:\n print('Impossible')", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "a,b=map(int, input().split())\nif a%3==0 or b%3==0 or a%3!=b%3:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "A,B=list(map(int,input().split()))\nC=A+B\nif ((A>=3)&(A%3==0)) | ((B>=3)&(B%3==0)) | ((C>=3)&(C%3==0)):\n print(\"Possible\")\nelse:\n print(\"Impossible\")\n", "passed": true, "time": 0.24, "memory": 14184.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif (a + b) % 3 == 0 or b % 3 == 0 or a % 3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "S_list = list(map(int,input().split()))\n\nA, B = S_list[0], S_list[1]\nif (A * B * (A + B)) % 3 == 0 :\n result = \"Possible\"\nelse:\n result = \"Impossible\"\nprint(result)\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "a,s=map(int,input().split())\nprint(\"Impossible\"if a%3 and s%3 and a%3==s%3 else \"Possible\")", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "a, b =map(int, input().split())\n\nif a%3 == 0 or b%3 == 0 or (a+b)%3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "A,B=map(int,input().split())\nif A%3==0 or B%3==0 or (A+B)%3==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a,b=map(int,input().split())\n\nif a%3==0 or b%3==0 or (a+b)%3==0:\n ans=\"Possible\"\nelse:\n ans=\"Impossible\"\nprint(ans)", "passed": true, "time": 0.15, "memory": 14004.0, "status": "done"}, {"code": "a, b = map(int, input().split())\nif a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "#n = int(input())\na, b = list(map(int, input().split()))\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\n\nif a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')\n", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "# 067_a\nA,B=map(int,input().split())\nif (1<=A and A<=100)and(1<=B and B<=100):\n sum=A+B\n if A%3==0 or B%3==0 or sum%3==0:\n print('Possible')\n else:\n print('Impossible')", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "a, b = (int(x) for x in input().split())\nif a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a%3 == 0:\n print(\"Possible\")\nelif b%3 == 0:\n print(\"Possible\")\nelif (a+b)%3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a%3==0 or b%3==0 or (a+b)%3==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.27, "memory": 14244.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif (a + b) % 3 == 0 or b % 3 == 0 or a % 3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.49, "memory": 14052.0, "status": "done"}, {"code": "# A,B,A+B\u306e\u3044\u305a\u308c\u304b\u304c3\u306e\u500d\u6570\u306b\u306a\u308b\u304b\n\nA, B = list(map(int, input().split()))\n\nif A % 3 == 0 or B % 3 == 0 or (A + B) % 3 ==0:\n print('Possible')\nelse:\n print('Impossible')\n", "passed": true, "time": 0.26, "memory": 14284.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible') ", "passed": true, "time": 0.27, "memory": 14076.0, "status": "done"}, {"code": "A_mai, B_mai = map(int, input().split())\nsumm = A_mai + B_mai\n\nif (A_mai % 3 == 0 or B_mai % 3 == 0 or summ % 3 == 0):\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.26, "memory": 14300.0, "status": "done"}, {"code": "A,B = map(int,input().split())\n\nif A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.22, "memory": 14052.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\nif a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")\n", "passed": true, "time": 0.2, "memory": 14316.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a%3==0 or b%3==0 or (a+b)%3==0:print(\"Possible\")\nelse:print(\"Impossible\")", "passed": true, "time": 0.2, "memory": 14212.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\nif a % 3 == 0 or b % 3 == 0:\n print(\"Possible\")\nelif a % 3 == 1 and b % 3 == 2:\n print(\"Possible\")\nelif a % 3 == 2 and b % 3 == 1:\n print(\"Possible\")\nelse:\n print(\"Impossible\")\n", "passed": true, "time": 0.26, "memory": 14152.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\nif A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a%3==0 or b%3==0 or (a+b)%3==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nprint('Possible' if (A*B%3==0) or ((A+B)%3==0) else 'Impossible')", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif a%3 == 0 or b % 3 == 0 or (a+b)%3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "a,b=map(int,input().split());print(['Imp','P'][a%3==0 or b%3==0 or (a+b)%3==0]+'ossible')", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n# int\u306f\u5165\u529b\u306b\u5bfe\u3057\u3066\u306e\u95a2\u6570\u3001\u51fa\u529b\u3067\u306f\u306a\u3044\n\nif (a+b)%3 == 0:\n print(\"Possible\")\nelif a%3 == 0:\n print(\"Possible\")\nelif b%3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.24, "memory": 14256.0, "status": "done"}, {"code": "# \u30af\u30c3\u30ad\u30fc\u679a\u6570\uff08A,B\uff09\u3092\u6574\u6570\u3067\u5165\u529b\nA,B = map(int,input().split())\n# A\u304bB\u304bA+B\u306e\u3069\u308c\u304b\u30923\u5339\u306b\u5206\u3051\u308c\u308c\u3070Possible\u3001\u3067\u304d\u306a\u3051\u308c\u3070Impossible\nif A%3==0 or B%3==0 or (A+B)%3==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.21, "memory": 14272.0, "status": "done"}, {"code": "A,B=list(map(int,input().split()))\nif A%3==0 or B%3==0 or (A+B)%3==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")\n", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "# AtCoder abc067 a\n# \u30b9\u30c8\u30ec\u30c3\u30c1\u8ab2\u984c\n\n# \u5165\u529b\na, b = list(map(int, input().split()))\n\n# \u5224\u5b9a\nif (a % 3 == 0) or (b % 3 == 0) or ((a + b) % 3 == 0):\n print(\"Possible\")\nelse:\n print(\"Impossible\")\n", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\nprint((\"Possible\" if a%3==0 or b%3==0 or (a+b)%3==0 else \"Impossible\"))\n", "passed": true, "time": 0.17, "memory": 14296.0, "status": "done"}, {"code": "a,b=input().split()\na=int(a)\nb=int(b)\nif ((a+b)%3)==0:\n print(\"Possible\")\nelse:\n if (a%3)==0:\n print(\"Possible\")\n else:\n if (b%3)==0:\n print(\"Possible\")\n else:\n print(\"Impossible\")", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "A,B = map(int, input().split())\nprint('Possible' if A%3 == 0 or B%3 == 0 or (A+B)%3 == 0 else 'Impossible')", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "a, b = map(int,input().split())\nif a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0: \n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "a, b = list(map(int, input().split()))\nif a%3==0 or b%3==0 or (a+b)%3==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")\n", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "a,b = [int(x) for x in input().split()]\nif a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "lst = input().split()\n\nA = int(lst[0])\nB = int(lst[1])\n\nif (A % 3 == 0) or (B % 3 == 0) or ((A + B) % 3 == 0):\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.29, "memory": 14120.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nprint('Possible' if (A*B%3==0) or ((A+B)%3==0) else 'Impossible')", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "A, B = map(int,input().split())\n\nif A % 3 == 0 or B % 3 ==0 or (A + B) % 3 ==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nprint('Possible' if A%3==0 or B%3==0 or (A+B)%3==0 else 'Impossible')", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "# \u5165\u529b\nA, B = map(int, input().split())\n\n# \u51fa\u529b\nif A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.18, "memory": 14084.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\nif A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nprint('Possible' if (A*B%3==0) or ((A+B)%3==0) else 'Impossible')", "passed": true, "time": 0.17, "memory": 14288.0, "status": "done"}, {"code": "a, b=map(int, input().split())\nif a%3==0 or b%3==0 or (a+b)%3==0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.21, "memory": 14288.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.15, "memory": 14104.0, "status": "done"}, {"code": "a,b = list(map(int,input().split()))\nprint((\"Possible\" if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0 else \"Impossible\"))\n", "passed": true, "time": 0.15, "memory": 14176.0, "status": "done"}, {"code": "a,b = map(int,input().split())\n\nif a%3 == 0 or b%3 == 0 or (a+b)%3 ==0:\n print('Possible')\n \nelse:\n print('Impossible')", "passed": true, "time": 0.19, "memory": 14336.0, "status": "done"}, {"code": "a,b=map(int, input().split())\nprint(\"Possible\" if a*b*(a+b)%3==0 else \"Impossible\")", "passed": true, "time": 0.19, "memory": 14256.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nif A%3==0 or B%3==0 or (A+B)%3==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "a, b = input().split()\n\nif int(a) % 3 == 0 or int(b) % 3 == 0 or (int(a) + int(b)) % 3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.15, "memory": 14212.0, "status": "done"}, {"code": "x,y=map(int,input().split())\nif x%3==0 or y%3==0 or (x+y)%3==0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.17, "memory": 14080.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\ntotal = A + B\n\nif total % 3 == 0 or A % 3 ==0 or B % 3 ==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "a,b=list(map(int,input().split()))\nif a%3==0 or b%3==0 or (a+b)%3==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "def iroha():\n a,b = map(int, input().split())\n aa = a % 3\n bb = b % 3\n cc = (a+b) % 3\n\n print(\"Possible\") if aa == 0 or bb == 0 or cc == 0 else print(\"Impossible\")\n\n\ndef __starting_point():\n iroha()\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "# \u5165\u529b\nA, B = map(int, input().split())\n\n# A,B,A+B\u306e\u3046\u3061\u3069\u308c\u304b1\u3064\u3067\u30823\u3067\u5272\u308a\u5207\u308c\u308c\u3070Possible\nif A % 3 == 0:\n print('Possible')\nelif B % 3 == 0:\n print('Possible')\nelif (A + B) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.18, "memory": 14308.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nprint(\"Possible\" if a%3==0 or b%3==0 or (a+b)%3==0 else \"Impossible\")", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif a%3==0 or b%3==0 or (a+b)%3==0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "# A - Sharing Cookies\n\n# 3\u5339\u306e\u30e4\u30ae\u306b\u30af\u30c3\u30ad\u30fc\u3092\u6e21\u3057\u305f\u3044\n# A \u679a\u5165\u3063\u305f\u30af\u30c3\u30ad\u30fc\u304c\u5165\u3063\u305f\u7f36\n# B \u679a\u5165\u3063\u305f\u30af\u30c3\u30ad\u30fc\u304c\u5165\u3063\u305f\u7f36\n# A B \u7f36\u3092\u6301\u3063\u3066\u3044\u308b\u3002\n\n# A, B, A + B \u306e\u3044\u305a\u308c\u304b\u306e\u679a\u6570\u3092\u30e4\u30ae\u306b\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u308b\n\n# 3\u5339\u306e\u30e4\u30ae\u304c\u540c\u3058\u679a\u6570\u98df\u3079\u308c\u308b\u3088\u3046\u306b\u6e21\u305b\u308b\u304b\u5224\u5b9a\u3059\u308b\n# \u53ef\u80fd\u306a\u3089 Possible \u4e0d\u53ef\u80fd\u306a\u3089 Impossible\n\n# A B \u3092\u6a19\u6e96\u5165\u529b\u3067\u53d6\u5f97\nA, B = list(map(int, input().split()))\n# print(A, B)\n\n# A \u306e\u5834\u5408 B\u306e\u5834\u5408 A + B \u306e\u5834\u5408\u3067\u5206\u3051\u308b\n# \u305d\u308c\u305e\u308c\u306e\u4f59\u308a\u304c 0 \u306e\u6642 Possible\n# \u305d\u308c\u4ee5\u5916\u306f Impossible\n\nif A % 3 == 0:\n answer = \"Possible\"\nelif B % 3 == 0:\n answer = \"Possible\"\nelif (A + B) % 3 ==0:\n answer = \"Possible\"\nelse:\n answer = \"Impossible\"\n\n# \u7d50\u679c\u3092\u51fa\u529b\nprint(answer)\n", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "a,b=map(int, input().split())\nif a%3==0 or b%3==0 or (a+b)%3==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nif A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "A, B = map(int, input().split())\n\nprint(\"Possible\" if (A * B * (A+B)) % 3 == 0 else \"Impossible\")", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "'''\nABC067 A - Sharing Cookies\nhttps://atcoder.jp/contests/abc067/tasks/abc067_a\n'''\n\na, b = list(map(int, input().split()))\nif a%3 == 0 or b%3 == 0 or (a+b)%3 == 0:\n ans = \"Possible\"\nelse:\n ans = \"Impossible\"\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "# A - Sharing Cookies\n# https://atcoder.jp/contests/abc067/tasks/abc067_a\n\nA, B = list(map(int, input().split()))\n\nresult = 'Impossible'\n\nif A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:\n result = 'Possible'\n\nprint(result)\n", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "A, B = list(map(int, input().split()))\n\nfor i in [A, B, A + B]:\n if i % 3 == 0:\n print(\"Possible\")\n return\nprint(\"Impossible\")\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "# \u679a\u6570\u3092\u53d6\u5f97\nA,B = map(int,input().split())\nTotal = A + B\n\n# \u3044\u305a\u308c\u304b\u306e\u30d1\u30bf\u30fc\u30f3\u30673\u5206\u5272\u5747\u7b49\u306b\u3067\u304d\u308b\u304b\u3092\u5224\u5b9a\u5f8c\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\nif A % 3 == 0 \\\nor B % 3 == 0 \\\nor Total % 3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "A,B=map(int,input().split())\nif A%3==0 or B%3==0 or (A+B)%3==0 :\n print(\"Possible\")\nelse :\n print(\"Impossible\")", "passed": true, "time": 0.22, "memory": 14072.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\nif a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.22, "memory": 14080.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a%3==0 or b%3==0 or (a+b)%3==0:print('Possible')\nelse:print('Impossible')", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "A, B = map(int,input().split())\n\nif A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0 :\n print( \"Possible\" )\nelse:\n print( \"Impossible\" )", "passed": true, "time": 0.2, "memory": 14088.0, "status": "done"}, {"code": "A, B = map(int, input().split())\nprint('Possible' if (A*B%3==0) or ((A+B)%3==0) else 'Impossible')", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "#\n# abc067 a\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_\u5165\u529b\u4f8b_1(self):\n input = \"\"\"4 5\"\"\"\n output = \"\"\"Possible\"\"\"\n self.assertIO(input, output)\n\n def test_\u5165\u529b\u4f8b_2(self):\n input = \"\"\"1 1\"\"\"\n output = \"\"\"Impossible\"\"\"\n self.assertIO(input, output)\n\n\ndef resolve():\n A, B = list(map(int, input().split()))\n if A % 3 == 0 or B % 3 == 0 or (A+B) % 3 == 0:\n print(\"Possible\")\n else:\n print(\"Impossible\")\n\n\ndef __starting_point():\n # unittest.main()\n resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14464.0, "status": "done"}, {"code": "a,b = map(int,input().split())\nif a%3 == 0 or b%3 == 0 or (a+b)%3 == 0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "# 067a\n\nA, B = list(map(int, input().split()))\n\nif A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a, b = map(int, input().split())\n\ntotal = a + b\nif total % 3 == 0:\n print('Possible')\nelif a % 3 == 0:\n print('Possible')\nelif b % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "# \u3059\u306c\u3051\u304f\u3093\u306f 3\u5339\u306e\u30e4\u30ae\u306b\u30af\u30c3\u30ad\u30fc\u3092\u6e21\u3057\u305f\u3044\u3067\u3059\u3002\n# \u3059\u306c\u3051\u304f\u3093\u306f A\u679a\u306e\u30af\u30c3\u30ad\u30fc\u304c\u5165\u3063\u305f\u7f36\u3068\u3001\n# B\u679a\u306e\u30af\u30c3\u30ad\u30fc\u304c\u5165\u3063\u305f\u7f36\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\n# \u3059\u306c\u3051\u304f\u3093\u306f A, B, A + B \u306e\u3044\u305a\u308c\u304b\u306e\u679a\u6570\u306e\u30af\u30c3\u30ad\u30fc\u3092\n# \u30e4\u30ae\u305f\u3061\u306b\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\n# 3\u5339\u306e\u30e4\u30ae\u304c\u540c\u3058\u679a\u6570\u305a\u3064\u98df\u3079\u3089\u308c\u308b\u3088\u3046\u306b\n# \u30af\u30c3\u30ad\u30fc\u3092\u6e21\u3059\u3053\u3068\u304c\u53ef\u80fd\u304b\u3069\u3046\u304b\u5224\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\n# \u5236\u7d04\n# 1 \u2266 A, B \u2266 100\n# A, B \u306f\u3044\u305a\u308c\u3082\u6574\u6570\n\n# \u6a19\u6e96\u5165\u529b\u304b\u3089 A, B \u3092\u53d6\u5f97\u3059\u308b\na, b = list(map(int, input().split()))\n\n\nresult = \"ret\"\n\n# \u4ee5\u4e0b\u3001\u5224\u5b9a\u51e6\u7406\nif a % 3 == 0: # A\u306e\u7f36\u3060\u3051\u3092\u6e21\u3057\u3066\u30013\u7b49\u5206\u3067\u304d\u308b\n result = \"Possible\"\nelif b % 3 == 0: # B\u306e\u7f36\u3060\u3051\u3092\u6e21\u3057\u3066\u30013\u7b49\u5206\u3067\u304d\u308b\n result = \"Possible\"\nelif (a + b) % 3 == 0: # A + B \u7f36\u3092\u6e21\u3057\u3066\u30013\u7b49\u5206\u3067\u304d\u308b\n result = \"Possible\"\nelse:\n result = \"Impossible\"\n\nprint(result)\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a%3==0 or b%3==0 or (a+b)%3==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a,b = map(int,input().split())\n\nif a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:\n print('Possible')\nelse:\n print('Impossible')", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "a,b=map(int,input().split())\nif a*b*(a+b)%3==0:\n print(\"Possible\")\nelse:\n print(\"Impossible\")", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}]
[{"input": "4 5\n", "output": "Possible\n"}, {"input": "1 1\n", "output": "Impossible\n"}]
4,723
E869120 found a chest which is likely to contain treasure. However, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters. He also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?. One more thing he found is a sheet of paper with the following facts written on it: - Condition 1: The string S contains a string T as a contiguous substring. - Condition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1. Print the string S. If such a string does not exist, print UNRESTORABLE. -----Constraints----- - 1 \leq |S'|, |T| \leq 50 - S' consists of lowercase English letters and ?. - T consists of lowercase English letters. -----Input----- Input is given from Standard Input in the following format: S T' -----Output----- Print the string S. If such a string does not exist, print UNRESTORABLE instead. -----Sample Input----- ?tc???? coder -----Sample Output----- atcoder There are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder. Among them, the lexicographically smallest is atcoder, so we can say S = atcoder.
introductory
[{"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 28 02:20:36 2020\n\n@author: liang\n\"\"\"\nS = input()\nT = input()\n\nS = S[::-1]\nT = T[::-1]\n\nres = list()\n\nfor i in range(len(S)-len(T)+1):\n flag = True\n for j in range(len(T)):\n if S[i+j] == \"?\" or S[i+j] == T[j]:\n continue\n else:\n flag = False\n if flag == True:\n ans = \"\"\n for k in range(len(S)):\n if i <= k <= i + len(T)-1:\n #print(T[k-i])\n ans += T[k-i]\n elif S[k] != \"?\":\n #print(\"B\")\n ans += S[k]\n else:\n #print(\"C\")\n ans += \"a\"\n ans = ans[::-1]\n res.append(ans)\n\nif res:\n res.sort()\n print((res[0]))\nelse:\n print(\"UNRESTORABLE\")\n#print(S)\n#print(T)\n", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "s = input()\nt = input()\n\nls = len(s)\nlt = len(t)\ncheck = False\nans = 'z'*60\nfor i in range(ls-lt+1):\n u = list(s)\n flag = True\n for j in range(lt):\n if u[i+j] == '?':\n u[i+j] = t[j]\n elif u[i+j] != t[j]:\n flag = False\n break\n if flag:\n check = True\n u = ''.join(u).replace('?', 'a')\n ans = sorted([ans, u])[0]\nprint(ans if check else 'UNRESTORABLE')", "passed": true, "time": 0.3, "memory": 14080.0, "status": "done"}, {"code": "S_ = list(input())\nT = input()\n#\u5f8c\u308d\u304b\u3089\u63a2\u7d22\u3059\u308b\n\nn = len(S_)\nm = len(T)\nnonexist = 1\nfor i in range(n-1, m-2, -1):\n flg = True\n for j in range(m):\n if (S_[i-j] != T[-j-1]) and (S_[i-j] != \"?\"):\n flg = False\n break\n if flg:\n nonexist = 0\n index = i\n break\n\nif nonexist:\n print(\"UNRESTORABLE\")\n return\n\nindex -= m-1\nfor i in range(m):\n S_[index+i] = T[i]\n\nfor i in range(n):\n if S_[i] == \"?\":\n S_[i] = \"a\"\nprint((\"\".join(S_)))\n", "passed": true, "time": 0.15, "memory": 14108.0, "status": "done"}, {"code": "s = input()\nt = input()\n\nfor i in range(len(s) - len(t) + 1)[::-1]:\n cnt = 0\n q = 0\n for j in range(len(t))[::-1]:\n if s[i + j] == '?':\n q += 1\n elif s[i + j] == t[j]:\n cnt += 1\n \n if cnt == len(t) - q:\n idx = i\n s = s[:idx] + t + s[idx + len(t):]\n for k in range(len(s)):\n if s[k] == '?':\n s = s[:k] + 'a' + s[k + 1:]\n print(s)\n break\nelse:\n print('UNRESTORABLE')", "passed": true, "time": 0.23, "memory": 14284.0, "status": "done"}, {"code": "s = input()[::-1]\nt = input()[::-1]\n\ndef match(string,substring):\n for a,b in zip(string, substring):\n if a == '?':\n continue\n if a != b:\n return False\n return True\n\n# \u306a\u308b\u3079\u304f\u5f8c\u65b9\u3067\u4e00\u81f4\u3055\u305b\u308b\nLEN_S = len(s)\nLEN_T = len(t)\nans = ''\nfor i in range(LEN_S - LEN_T + 1):\n sub = s[i:i+LEN_S]\n if match(sub, t):\n ans = s[:i] + t + s[i+LEN_T:]\n ans = ans[::-1].replace('?', 'a')\n break\nelse:\n print('UNRESTORABLE')\n return\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\nnum = len(t)\n\nfail = 'UNRESTORABLE'\nflag = False\nans = []\ncount_out = 0\n\nfor i in range(len(s)):\n start = i\n end = i + len(t)\n if (end > len(s)):\n break\n tar = s[start:end]\n # print(tar)\n index = 0\n name_flag = True\n\n for a, b in zip(tar, t):\n # print(tar[index])\n if (a == b):\n pass\n elif (a == '?'):\n tar[index] = str(b)\n else:\n name_flag = False\n break\n\n index += 1\n\n if (name_flag is False):\n ans.append(['z'] * len(s))\n count_out += 1\n else:\n pre_org = s[:start]\n # pre = pre_org.replace('?', 'a')\n post_org = s[end:]\n # post = post_org.replace('?', 'a')\n\n # tar_mod = pre + tar + post\n tar_mod = pre_org + tar + post_org\n ans.append(tar_mod)\n\n# print(ans)\nif (count_out == (len(s) - len(t) + 1)):\n print(fail)\nelse:\n ans_s = sorted(ans)\n aa = ans_s[0]\n a2 = ''.join(aa)\n a3 = a2.replace('?', 'a')\n print(a3)\n", "passed": true, "time": 0.24, "memory": 14120.0, "status": "done"}, {"code": "s = input()\nt = input()\n\ns_streak = 0\ns_streak_ind = -1\n\n\nfor j in range(len(s)-1, -1, -1):\n\tfor i in range(j, -1, -1):\n\t\tif s_streak_ind == -1:\n\t\t\tif s[i] == \"?\" or s[i] == t[len(t)-1-s_streak]:\n\t\t\t\tif s_streak == len(t) - 1:\n\t\t\t\t\ts_streak_ind = i\n\t\t\t\t\ts_streak = 0\n\t\t\t\telse:\n\t\t\t\t\ts_streak += 1\n\t\t\telse:\n\t\t\t\ts_streak = 0\n\ts_streak = 0\n\n#print(s_streak_ind)\n\nif s_streak_ind == -1:\n\tprint(\"UNRESTORABLE\")\nelse:\n\tansl = []\n\tfor i in range(len(s)):\n\t\tif s[i] == \"?\":\n\t\t\tif s_streak_ind <= i < s_streak_ind+len(t):\n\t\t\t\tansl.append(t[i-s_streak_ind])\n\t\t\telse:\n\t\t\t\tansl.append(\"a\")\n\t\telse:\n\t\t\tansl.append(s[i])\n\tprint(\"\".join(ansl))", "passed": true, "time": 0.26, "memory": 14336.0, "status": "done"}, {"code": "S = list(input())\nT = list(input())\ns = len(S)\nt = len(T)\nfor i in range(s-t,-1,-1):\n ss = S[i:i+t]\n for j in range(t):\n if ss[j] != \"?\" and ss[j] != T[j]:\n break\n else:\n for j in range(t):\n if ss[j] == \"?\":\n S[i+j] = T[j]\n break\nelse:\n print(\"UNRESTORABLE\")\n return\nfor i in range(s):\n if S[i] == \"?\":\n S[i] = \"a\"\nprint(\"\".join(S))", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "import copy\nS = list(input())\nT = input()\nlS = len(S)\nlT = len(T)\nans = []\nfor s in range(lS-lT+1):\n temp = copy.copy(S)\n for t in range(lT):\n if temp[s+t] != T[t] and temp[s+t] != '?':\n break\n else:\n temp[s+t] = T[t]\n else:\n temp = [temp[i] if temp[i] != '?' else 'a' for i in range(lS)]\n ans.append(''.join(temp))\nans = sorted(ans)\nif len(ans) == 0:\n print('UNRESTORABLE')\nelse:\n print(ans[0])", "passed": true, "time": 0.26, "memory": 14208.0, "status": "done"}, {"code": "S_ = input()\nT = input()\nlen_T = len(T)\nlen_S = len(S_)\n\nA = []\nfor i in range(len_S - len_T + 1):\n flg = True\n for t, s in zip(T, S_[i:i + len_T]):\n if s != '?' and s != t:\n flg = False\n if flg == True:\n S = ''\n for j in range(len_S):\n if i <= j < i + len_T:\n S += T[j - i]\n elif S_[j] == '?':\n S += 'a'\n else:\n S += S_[j]\n A.append(S)\n\nans = 'z' * (len_S + 1)\nfor S in A:\n if S < ans:\n ans = S\nif ans == 'z' * (len_S + 1):\n print('UNRESTORABLE')\nelse:\n print(ans)", "passed": true, "time": 0.17, "memory": 14352.0, "status": "done"}, {"code": "S=input()\nT=input()\nL,M=len(S),len(T)\na=-1\nfor i in range(L-M,-1,-1):\n if sum([1 for j in range(M) if S[i+j]=='?' or S[i+j]==T[j]])==M:\n a=i\n break\nprint('UNRESTORABLE' if a<0 else ''.join([T[i-a] if a<=i<a+M else 'a' if S[i]=='?' else S[i] for i in range(L)]))", "passed": true, "time": 0.16, "memory": 14104.0, "status": "done"}, {"code": "import sys\n\n\nstdin = sys.stdin\ndef ns(): return stdin.readline().rstrip()\ndef ni(): return int(stdin.readline().rstrip())\ndef nm(): return list(map(int, stdin.readline().split()))\ndef nl(): return list(map(int, stdin.readline().split()))\n\n\ndef can_replace(S, T):\n cnt = 0\n for s, t in zip(S, T):\n if s == t or s == '?':\n cnt += 1\n if cnt == len(S):\n return True\n else:\n return False\n\n\ndef main():\n S = list(ns()[::-1])\n T = list(ns()[::-1])\n for i in range(len(S) - len(T) + 1):\n if can_replace(S[i:i + len(T)], T):\n S[i:i + len(T)] = T\n S = ''.join(S)\n print((S.replace('?', 'a')[::-1]))\n return\n print('UNRESTORABLE')\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.17, "memory": 14272.0, "status": "done"}, {"code": "s = input()\nt = input()\nn, m = len(s), len(t)\n\nfor i in range(n - m, -1, -1):\n match = True\n for j in range(m):\n if s[i + j] != '?' and s[i + j] != t[j]:\n match = False\n break\n if match:\n print((s[:i].replace('?', 'a') + t + s[i + m:].replace('?', 'a')))\n return\nprint(\"UNRESTORABLE\")\n", "passed": true, "time": 0.18, "memory": 14120.0, "status": "done"}, {"code": "s = input()\nt = input()\n\ns_length = len(s)\nt_length = len(t)\n\nans = ''\nkeep = ''\nremind = 0\nchecker = False\nfor i in range(s_length):\n if (i + t_length) <= s_length:\n check = True\n for j in range(t_length):\n if (s[i + j] != t[j]) & (s[i + j] != '?'):\n check = False\n if check:\n checker = True\n ans = keep + t\n remind = i + t_length\n if s[i] == '?':\n keep += 'a'\n else:\n keep += s[i]\nans = ans + keep[remind:]\n\nif checker:\n print(ans)\nelse:\n print('UNRESTORABLE')\n", "passed": true, "time": 0.2, "memory": 14152.0, "status": "done"}, {"code": "Sp = str(input())\nT = list(input())\nans = []\nANS = []\nfor i in range(len(Sp)-len(T)+1):\n S = list(Sp)\n for j in range(len(T)):\n if S[i+j] == T[j] or S[i+j] == \"?\":\n S[i+j] = T[j]\n if j == len(T)-1:\n ans.append(S)\n else:\n break\nif len(ans) == 0:\n print('UNRESTORABLE')\nelse:\n for i in range(len(ans)):\n for j in range(len(Sp)):\n if ans[i][j] == \"?\":\n ans[i][j] = \"a\"\n ANS.append(\"\".join(ans[i]))\n ANS.sort()\n print(ANS[0])", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "import re\n\ns = input().replace('?', '.')\nt = input()\n\nfor i in range(len(s)-len(t), -1, -1):\n if re.match(s[i:i+len(t):], t):\n s = s.replace('.', 'a')\n print(s[:i:]+t+s[i+len(t)::])\n return\nprint('UNRESTORABLE')", "passed": true, "time": 0.16, "memory": 14404.0, "status": "done"}, {"code": "s=list(input())\nls=len(s)\nt=list(input())\nlt=len(t)\ncan=[]\nfor i in range(ls-lt,-1,-1):\n ok=0\n for j in range(lt):\n if s[i+j]==t[j] or s[i+j]=='?':\n ok+=1\n if ok==lt:\n c=[0]*ls\n for k in range(ls):\n if s[k]=='?':\n if k<i or k>=i+lt:\n c[k]='a'\n else:\n c[k]=t[k-i]\n else:\n c[k]=s[k]\n can.append(''.join(c))\nif len(can)==0:\n print('UNRESTORABLE')\nelse:\n print(sorted(list(can))[0])", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "s,t=input(),input()\nans='z'*len(s)\nfor i in range(len(s)-len(t)+1):\n pre=s[:i].replace(\"?\",'a')\n \n for x,y in zip(list(s[i:]),list(t)):\n if x!=\"?\"and x!=y:break\n pre+=y\n else:\n pre+=s[i+len(t):].replace(\"?\",'a')\n ans=min(ans,pre)\nprint(ans if ans!='z'*len(s) else 'UNRESTORABLE')", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "s=input()\nT=input()\n\ns=''.join([x if x!='?' else '1' for x in list(s)])\n\nstart=[]\nfor i in range(len(s)-len(T)+1):\n tmp=0\n for j in range(len(T)):\n if s[i+j]==T[j] or s[i+j]=='1': tmp+=1\n if tmp==len(T): start.append(i)\n\ncandidates=[]\nt=len(T)\nans=''\nif len(start):\n for st in start:\n tmp=s[:st]+T+s[st+t:]\n candidates.append(tmp)\n candidates.sort()\n ans=candidates[0].replace('1','a')\nelse:\n ans='UNRESTORABLE'\n\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14104.0, "status": "done"}, {"code": "S = input()[::-1]\nT = input()[::-1]\n\nflag = False\nfor i in range(len(S) - len(T) + 1):\n matched = True\n\n for j in range(len(T)):\n\n if S[i + j] != \"?\" and S[i + j] != T[j]:\n matched = False\n \n if matched:\n S = S[:i] + T + S[i + len(T):]\n flag = True\n break\n\nif flag:\n print(S.replace(\"?\", \"a\")[::-1])\nelse:\n print(\"UNRESTORABLE\")", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "s = input()\nn = len(s)\nt = input()\nm = len(t)\nans = []\n\nfor i in range(n-m+1):\n for j in range(m):\n if s[i+j] not in [t[j] , \"?\"]:\n break\n elif j == m-1:\n res = s[:i]+t+s[i+m:]\n ans.append(res.replace(\"?\",\"a\"))\n\nif not ans:\n ans.append(\"UNRESTORABLE\")\n\nprint(min(ans))", "passed": true, "time": 0.16, "memory": 14020.0, "status": "done"}, {"code": "S = input()[::-1]\nT = input()[::-1]\n\nflag = False\nfor i in range(len(S) - len(T) + 1):\n matched = True\n\n for j in range(len(T)):\n # \u3046\u30fc\u3093...\n if i == len(S) - len(T) + 1:\n break\n\n if S[i + j] != \"?\" and S[i + j] != T[j]:\n matched = False\n \n if matched:\n S = S[:i] + T + S[i + len(T):]\n flag = True\n break\n\nif flag:\n print(S.replace(\"?\", \"a\")[::-1])\nelse:\n print(\"UNRESTORABLE\")", "passed": true, "time": 0.16, "memory": 14296.0, "status": "done"}, {"code": "s = input()\nt = input()\nans = list(s)\n\nif len(s)>=len(t):\n for i in reversed(list(range(len(s)-len(t)+1))):\n flg=True\n for j in range(len(t)):\n if s[i+j]==\"?\":\n continue\n if s[i+j]!=t[j]:\n flg=False\n break\n if flg:\n for j in range(len(t)):\n ans[i+j]=t[j]\n\n break\nelse:\n flg=False\n\nans = \"\".join(ans)\nans = ans.replace(\"?\",\"a\")\n\nprint((ans if flg else \"UNRESTORABLE\"))\n\n", "passed": true, "time": 0.16, "memory": 14104.0, "status": "done"}, {"code": "s = input()\nt = input()\nmatch_index = 51\nfor i in range(len(s) - len(t) + 1):\n s_tmp = s[i:i + len(t)]\n for j in range(len(t)):\n if s_tmp[j] == t[j] or s_tmp[j] == \"?\":\n pass\n else:\n break\n else:\n match_index = i\n\nif match_index == 51:\n print(\"UNRESTORABLE\")\nelse:\n s_replace = \"\"\n for i in range(match_index):\n s_replace += s[i]\n s_replace += t\n for i in range(match_index + len(t), len(s)):\n s_replace += s[i]\n\n # s[match_index:match_index + len(t)] = t\n res = \"\"\n for i in s_replace:\n if i == \"?\":\n res += \"a\"\n else:\n res += i\n print(res)\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "\ns_o = str(input().strip())\nt_o = str(input().strip())\ndic = []\n\nfor i in range(len(s_o)-len(t_o)+1):\n s = s_o\n t = t_o\n flg = 0\n for j in range(len(t_o)):\n if s[i+j] == t[j] or s[i+j] == \"?\":\n s = s[:i+j] + t[j] + s[i+j+1:]\n else:\n flg = 1\n break\n if flg:\n continue\n s = s.replace(\"?\", \"a\")\n dic.append(s)\n\nif len(dic) == 0:\n print(\"UNRESTORABLE\")\nelse:\n dic.sort()\n print(dic[0])", "passed": true, "time": 0.15, "memory": 14040.0, "status": "done"}, {"code": "#abc076 C\nfrom copy import deepcopy\ns = list(input())\nt = list(input())\nls = len(s)\nlt = len(t)\n\nrev_s = s[::-1]\nrev_t = t[::-1]\n\nfor x in range(ls-lt+1):\n if rev_s[x:x+lt] == [\"?\"] * lt:\n for y in range(lt):\n rev_s[x+y] = rev_t[y]\n ns = rev_s[::-1]\n S = \"\".join(ns)\n ans = S.replace(\"?\", \"a\")\n print(ans)\n return\n\n\nfor i in range(lt):\n for j in range(i, ls):\n if rev_t[i] == rev_s[j]:\n flag = True\n t_temp = deepcopy(rev_t)\n s_temp = deepcopy(rev_s)\n for k in range(-i, lt-i):\n if j+k >= ls or j+k < 0:\n flag = False\n break\n elif t_temp[i+k] == s_temp[j+k]:\n pass\n elif s_temp[j+k] == \"?\":\n s_temp[j+k] = t_temp[i+k]\n elif t_temp[i+k] != s_temp[j+k]:\n flag = False\n break\n if flag:\n ns = s_temp[::-1]\n S = \"\".join(ns)\n ans = S.replace(\"?\", \"a\")\n print(ans)\n return\n\nprint(\"UNRESTORABLE\")", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "sd = input()\nt = input()\n\nn = len(sd)\nm = len(t)\ns = []\n\n# sd \u3092\u5f8c\u308d\u304b\u3089\u898b\u3066\u3044\u304d\u3001 t \u306e\u5165\u308a\u305d\u3046\u306a\u5834\u6240\u3092\u63a2\u3059\nfor i in range(n - m, -1, -1):\n t_kamo = sd[i:i + m]\n for j in range(m + 1):\n # 1\u6587\u5b57\u305a\u3064\u9806\u306b\u5165\u308a\u3046\u308b\u304b\u8abf\u3079\u3001\u6700\u5f8c\u307e\u3067\u5165\u308b\u306a\u3089 \"?\" \u3092 \"a\" \u306b\u7f6e\u304d\u63db\u3048\u3066\u51fa\u529b\n if j == m:\n print((sd[:i] + t + sd[i + len(t):]).replace(\"?\", \"a\"))\n return\n if t_kamo[j] == \"?\":\n continue\n elif t_kamo[j] != t[j]:\n break\n\nprint(\"UNRESTORABLE\")", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "s = input()\nt = input()\nl = []\nfor i in range(len(s)-len(t)+1):\n for j in range(i, i+len(t)):\n if s[j] != \"?\" and s[j] != t[j-i]:\n break\n else:\n l.append(s[:i]+t+s[i+len(t):])\nif len(l) == 0:\n print(\"UNRESTORABLE\")\n return\nl.sort()\nprint(l[0].replace(\"?\", \"a\"))", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "s = input()\nt = input()\nn = len(s)\nm = len(t)\nans = []\nfor i in range(n-m+1):\n c = 0\n for j in range(m):\n if s[i+j] == '?' or s[i+j] == t[j]:\n c += 1\n if c == m:\n s_ = s[0:i] + t + s[i+m:]\n s_ = s_.replace('?', 'a')\n ans.append(s_)\nif len(ans)>0:\n print((sorted(ans)[0]))\nelse:\n print('UNRESTORABLE')\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "s=input()\nt=input()\nls=len(s)\nlt=len(t)\n\nans=0\nfor i in range(ls-lt+1):\n x=s[:i]+t+s[i+lt:ls]\n f=1\n for j in range(ls):\n if s[j]=='?':\n continue\n if s[j]!=x[j]:\n f=0\n break\n if f:\n p=''\n for k in range(ls):\n if x[k]=='?':\n p+='a'\n else:\n p+=x[k]\n ans=p\n \nif ans:\n print(p)\nelse:\n print('UNRESTORABLE')\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "S0 = input()\nT = input()\n\nn, m = len(S0), len(T)\nif n < m:\n print(\"UNRESTORABLE\")\n return\n\nstart, end = -1, -1\nfor i in reversed(range(n - m + 1)):\n ok = True\n for j in range(m):\n ok = ok and (S0[i + j] == T[j] or S0[i + j] == '?')\n if ok:\n start = i\n end = i + m - 1\n break\n\nif start >= 0:\n S = ''\n for i in range(n):\n if start <= i <= end:\n S += T[i - start]\n else:\n if S0[i] == '?':\n S += 'a'\n else:\n S += S0[i]\n print(S)\nelse:\n print(\"UNRESTORABLE\")", "passed": true, "time": 0.21, "memory": 14296.0, "status": "done"}, {"code": "a = input()\nb = input()\n\nlength = len(a) - len(b) + 1\n\nans = []\nfor i in range(length):\n A = list('?'*i+b+'?'*(length-i-1))\n flag = True\n for j in range(len(a)):\n if a[j] == '?' or a[j] == A[j]:\n pass\n elif a[j] != '?' and A[j] == '?':\n A[j] = a[j]\n else:\n flag = False\n if flag:\n ans.append(''.join(A).replace('?','a'))\n\nif ans:\n ans.sort()\n print(ans[0])\nelse:\n print('UNRESTORABLE')", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "Sd = input()\nT = input()\n#Sd\u306e?\u4ee5\u5916\u306e\u6587\u5b57\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\nindexes = []\nfor i in range(len(Sd)):\n if Sd[i] != \"?\":\n indexes.append(i)\n\nt0 = 0#t\u306e\u5148\u982d\u4f4d\u7f6e\nS_list = []\nwhile t0 <= (len(Sd)-len(T)):\n flg = 0\n tmp_S = Sd[:t0] + T + Sd[t0+len(T):]\n\n #\u6761\u4ef61\u3092\u6e80\u305f\u3059\u304b\u3069\u3046\u304b\u306e\u30c1\u30a7\u30c3\u30af\n for index in indexes:\n if Sd[index] != tmp_S[index]:#Sd\u3068\u4e00\u81f4\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u3089\n flg = 1\n if flg:#flg\u304c\u7acb\u3063\u305f\u6587\u5b57\u5217\u306f\u6761\u4ef6\u3092\u6e80\u305f\u3055\u306a\u3044\u305f\u3081\u30b9\u30ad\u30c3\u30d7\n t0 += 1\n continue\n\n #?\u306ba\u3092\u7a4d\u3081\u3066\u30ea\u30b9\u30c8\u306b\u683c\u7d0d\n tmp_S = tmp_S.replace('?', 'a')\n S_list.append(tmp_S)\n t0 += 1\n\nif not S_list:\n print(\"UNRESTORABLE\")\n return\n\nS_list.sort()#\u8f9e\u66f8\u5f0f\u306b\u30bd\u30fc\u30c8\nprint(S_list[0])", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "def main():\n s = input()\n t = input()\n n = len(s)\n m = len(t)\n ans = []\n for i in range(n-m+1):\n c = 0\n for j in range(m):\n if s[i+j] == '?' or s[i+j] == t[j]:\n c += 1\n if c == m:\n s_ = s[0:i] + t + s[i+m:]\n s_ = s_.replace('?', 'a')\n ans.append(s_)\n if len(ans)>0:\n print((sorted(ans)[0]))\n else:\n print('UNRESTORABLE')\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "S = input()\nSa = S.replace(\"?\", \"a\")\nT = input()\nnt = len(T)\nans = list()\nfor i in range(len(S) - nt + 1):\n X = S[i: i + nt]\n for x, t in zip(X, T):\n if x == \"?\":\n continue\n if x != t:\n break\n else:\n ans.append(Sa[:i] + T + Sa[i + nt:])\nans.sort()\nprint((ans[0] if ans else \"UNRESTORABLE\"))\n", "passed": true, "time": 0.16, "memory": 14352.0, "status": "done"}, {"code": "\n# import itertools\n# import math\n# from functools import reduce\n# import sys\n# sys.setrecursionlimit(500*500)\n# import numpy as np\n# import heapq\n# from collections import deque\n\n# N = int(input())\nS_prime = input()\n# n, *a = map(int, open(0))\n# N, M = map(int, input().split())\n# A = list(map(int, input().split()))\n# B = list(map(int, input().split()))\n# tree = [[] for _ in range(N + 1)]\n# B_C = [list(map(int,input().split())) for _ in range(M)]\nT = input()\n\n# B_C = sorted(B_C, reverse=True, key=lambda x:x[1])\n# all_cases = list(itertools.permutations(P))\n# a = list(itertools.combinations_with_replacement(range(1, M + 1), N))\n# itertools.product((0,1), repeat=n)\n\n# A = np.array(A)\n# cum_A = np.cumsum(A)\n# cum_A = np.insert(cum_A, 0, 0)\n\n# def dfs(tree, s):\n# for l in tree[s]:\n# if depth[l[0]] == -1:\n# depth[l[0]] = depth[s] + l[1]\n# dfs(tree, l[0])\n# dfs(tree, 1)\n\n# def factorization(n):\n# arr = []\n# temp = n\n# for i in range(2, int(-(-n**0.5//1))+1):\n# if temp%i==0:\n# cnt=0\n# while temp%i==0:\n# cnt+=1\n# temp //= i\n# arr.append([i, cnt])\n# if temp!=1:\n# arr.append([temp, 1])\n# if arr==[]:\n# arr.append([n, 1])\n# return arr\n\n#def make_divisors(n):\n# lower_divisors , upper_divisors = [], []\n# i = 1\n# while i*i <= n:\n# if n % i == 0:\n# lower_divisors.append(i)\n# if i != n // i:\n# upper_divisors.append(n//i)\n# i += 1\n# return lower_divisors + upper_divisors[::-1]\n\n# def gcd_list(numbers):\n# return reduce(math.gcd, numbers)\n\n# if gcd_list(A) > 1:\n# print(\"not coprime\")\n# return\n\n# \u9ad8\u901f\u7d20\u56e0\u6570\u5206\u89e3\u6e96\u5099\n#MAXN = 10**6+10\n#sieve = [i for i in range(MAXN+1)]\n#p = 2\n#while p*p <= MAXN:\n# if sieve[p] == p:\n# for q in range(2*p, MAXN+1, p):\n# if sieve[q] == q:\n# sieve[q] = p\n# p += 1\n\nstart_ind = -1\nfor i in range(len(S_prime) - len(T) + 1):\n for j, c in enumerate(T):\n if S_prime[i + j] == c or S_prime[i + j] == \"?\":\n pass\n else:\n break\n else:\n start_ind = i\n \nif start_ind == -1:\n print(\"UNRESTORABLE\")\n return\n\nS = S_prime[:start_ind] + T + S_prime[start_ind + len(T):]\nprint(S.replace(\"?\", \"a\"))", "passed": true, "time": 0.16, "memory": 14188.0, "status": "done"}, {"code": "_S = list(input())\nT = list(input())\n\nN = len(_S)\nM = len(T)\n\ncandidates = []\n\nfor i in range(N - M + 1):\n if _S[i] == '?' or _S[i] == T[0]:\n S = _S.copy()\n flg = True\n for j in range(M):\n if S[i + j] == '?':\n S[i + j] = T[j]\n elif S[i + j] != T[j]:\n flg = False\n break\n if flg:\n for k in range(N):\n if S[k] == '?':\n S[k] = 'a'\n candidates.append(''.join(S))\n\nif len(candidates) == 0:\n print('UNRESTORABLE')\nelse:\n print((min(candidates)))\n", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\nls, lt = len(s), len(t)\n#\u30ea\u30b9\u30c8\u3092\u53cd\u8ee2\u3055\u305b\u3066\u30b1\u30c4\u304b\u3089\u8abf\u3079\u308b\u4e8b\u3067\u8f9e\u66f8\u9806\u6700\u5c0f\u3092\u6c42\u3081\u308b\ns.reverse()\nt.reverse()\nfor i in range(ls):\n for j in range(lt): #\u3053\u306efor\u6587\u304c\u5168\u90e8\u56de\u308c\u3070t in s\u3067\u3042\u308b\n if i + j >= ls:\n break\n if s[i+j] != '?' and s[i+j] != t[j]:\n break\n else: \n for j in range(lt):\n s[i+j] = t[j]\n s = [x if x != '?' else 'a' for x in s]\n s.reverse()\n ans = ''.join(s)\n break\nelse:\n ans = 'UNRESTORABLE'\nprint(ans)", "passed": true, "time": 0.19, "memory": 14112.0, "status": "done"}, {"code": "import re\ns = input().replace(\"?\",\".\")\nt = input()\nfor i in range(len(s)-len(t),-1,-1):\n if re.match(s[i:i+len(t)],t):\n s = s.replace(\".\",\"a\")\n print(s[:i]+t+s[i+len(t):])\n return\nprint(\"UNRESTORABLE\")", "passed": true, "time": 0.2, "memory": 14220.0, "status": "done"}, {"code": "ss = input()\nt = input()\n\nls = len(ss)\nlt = len(t)\n\nbefore = []\nafter = []\n\nfor i in range(ls-lt+1):\n for j in range(lt):\n if ss[i+j]!=\"?\":\n if ss[i+j]!=t[j]:\n break\n else:\n before += [ss[:i]+t+ss[i+lt:]]\n \nfor k in before:\n after += [k.replace(\"?\",\"a\")]\n\nif after:\n after = sorted(after)\n print(after[0])\nelse:\n print(\"UNRESTORABLE\")", "passed": true, "time": 0.22, "memory": 14060.0, "status": "done"}, {"code": "S = list(input())\nT = list(input())\nS.reverse()\nT.reverse()\nflag = False\nfor i in range(len(S)-len(T)+1):\n k = 0\n for t in range(i,i+len(T)):\n if S[t] != '?' and S[t] != T[k]:\n break\n k += 1\n if k == len(T):\n flag = True\n w = i\n if flag:\n break\nt = 0\nif flag:\n for i in range(w,w+len(T)):\n S[i] = T[t]\n t += 1\n S.reverse()\n an = ''\n for i in range(len(S)):\n if S[i] == '?':\n an += 'a'\n else:\n an += S[i]\n print(an)\nelse:\n print('UNRESTORABLE')", "passed": true, "time": 0.38, "memory": 14124.0, "status": "done"}, {"code": "s = input()\nt = input()\n\nans = 'z' * len(s)\ntmp = 'z' * len(s)\n\nx = False\nfor i in range(len(s)-len(t)+1):\n ok = True\n for j in range(len(t)):\n if not (s[i+j] == '?' or s[i+j] == t[j]):\n ok = False\n \n if ok:\n x = True\n tmp = s[:i] + t + s[i+len(t):]\n if ans > tmp:\n ans = tmp\n\nif x:\n ans = ans.replace(\"?\", \"a\")\n print(ans)\nelse:\n print('UNRESTORABLE')\n", "passed": true, "time": 0.15, "memory": 14268.0, "status": "done"}, {"code": "S=input()\nT=input()\n\nlt=len(T)\nls=len(S)\nS+='%'*lt\n\nif ls<lt:\n flg=0\nelse:\n for i in range(ls-lt+1,-1,-1):\n # print('***',S[i:i+lt])\n flg=1\n for j in range(i,i+lt):\n s=S[j]\n # print(s,T[j-i])\n if s=='?': continue\n if s=='%' or s!=T[j-i]:\n flg=0\n break\n if flg==1:\n break\nif flg:\n print((S[0:i]+T+S[i+lt:ls]).replace('?','a'))\nelse:\n print('UNRESTORABLE')", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "s = input()\nt = input()\nans = ''\n\n# for i in range(len(s)-len(t)+1):\nfor i in range(len(s)-len(t), -1, -1):\n st = s[i:i+len(t)]\n cnt = 0\n for si, ti in zip(st, t):\n if si == '?' or si == ti:\n cnt += 1\n # print(si, ti, cnt)\n if cnt == len(t):\n ans = s[:i] + t + s[i+len(t):]\n ans = ans.replace('?', 'a')\n print(ans)\n return\nelse:\n print('UNRESTORABLE')\n\n\n", "passed": true, "time": 0.2, "memory": 14284.0, "status": "done"}, {"code": "import math\nfrom math import gcd,pi,sqrt\nINF = float(\"inf\")\n\nimport sys\nsys.setrecursionlimit(10**6)\nimport itertools\nfrom collections import Counter,deque\ndef i_input(): return int(input())\ndef i_map(): return list(map(int, input().split()))\ndef i_list(): return list(i_map())\ndef i_row(N): return [i_input() for _ in range(N)]\ndef i_row_list(N): return [i_list() for _ in range(N)]\ndef s_input(): return input()\ndef s_map(): return input().split()\ndef s_list(): return list(s_map())\ndef s_row(N): return [s_input for _ in range(N)]\ndef s_row_str(N): return [s_list() for _ in range(N)]\ndef s_row_list(N): return [list(s_input()) for _ in range(N)]\n\n\ndef main():\n s = input() # \u6697\u53f7\n t = input() # \u542b\u307e\u308c\u308b\u6587\u5b57\n\n s_len = len(s)\n t_len = len(t)\n flg = False\n\n for i in range(s_len - t_len,-1,-1):\n flg = True\n for j in range(t_len):\n if s[i+j] != t[j] and s[i+j] != \"?\":\n flg = False\n break\n if flg == True:\n trial = i\n break\n\n if flg == False:\n print(\"UNRESTORABLE\")\n return\n\n ans = \"\"\n for i in s[:trial]:\n if i == \"?\":\n ans = ans + \"a\"\n else:\n ans = ans + i\n ans = ans + t\n\n for i in s[(trial+t_len):]:\n if i == \"?\":\n ans = ans + \"a\"\n else:\n ans = ans + i\n\n print(ans)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ndef __starting_point():\n main()\n\n__starting_point()", "passed": true, "time": 0.23, "memory": 14408.0, "status": "done"}, {"code": "s = input()[::-1]\nt = input()[::-1]\nx = \"\"\nfor i in range(0,len(s)-len(t)+1):\n if x == \"\": x = s[i:i+len(t)]\n else:x = x[1:] + s[i+len(t)-1]\n flag = True\n for j in range(len(t)):\n if x[j] == \"?\" or x[j] == t[j]: continue\n else: flag = False\n if flag:\n s = (s[:i] + t + s[i+len(t):])[::-1]\n print(s.replace(\"?\", \"a\"))\n return\nprint(\"UNRESTORABLE\")", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "S=input()\nT=input()\n\nlt=len(T)\nls=len(S)\nif ls<lt:flg=0\nelse:\n for i in range(ls-lt,-1,-1):\n flg=1\n for s,t in zip(S[i:i+lt],T):\n if s=='?' or s==t: continue\n flg=0\n if flg:break\nprint((S[0:i]+T+S[i+lt:ls]).replace('?','a') if flg else 'UNRESTORABLE')", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "#!/bin/python3\ns=list(input())\nt=list(input())\n\nlens=len(s)\nlent=len(t)\n\nfor i in reversed(list(range(lens-lent+1))):\n x=s[i:i+lent]\n ans=s\n flag=True\n #print(\"x\",x,len(x))\n for j in range(lent):\n if x[j]!=t[j] and x[j]!=\"?\":\n flag=False\n break\n #if x[j]==\"?\":\n # #t\u3068\u540c\u3058\u90e8\u5206\n # #print(\"i\",i,\"j\",j)\n # ans[i+j]=t[j]\n if flag:\n #t\u3088\u308a\u524d\u306e\u90e8\u5206\n #ans[:i]=[\"a\" if a==\"?\" else a for a in ans[:i]]\n #t\u3088\u308a\u5f8c\u308d\u306e\u90e8\u5206\n #if i+lent<=lens:\n # ans[i+lent:lens]=[\"a\" if a==\"?\" else a for a in ans[i+lent:lens]]\n ans=[\"a\" if a==\"?\" else a for a in ans[:i]]+\\\n \tt+[\"a\" if a==\"?\" else a for a in ans[i+lent:]]\n print((\"\".join(ans)))\n return\nprint(\"UNRESTORABLE\")\n#print(\"ans\",ans)\n\n", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "import sys\nimport math\nimport re\n\n#https://atcoder.jp/contests/agc008/submissions/15248942\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninm = lambda: map(int, sys.stdin.readline().split())\ninl = lambda: list(inm())\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print(\"\\033[33m\", *a, \"\\033[0m\", **dict(file=sys.stderr, **kw))\n\ns2 = input()\nt = input()\n\n#\u8f9e\u66f8\u9806\u306e\u5c0f\u3055\u3044\u3082\u306e\u3092\u4f5c\u308b\u305f\u3081\u306b\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u306f\u5f8c\u308d\u304b\u3089\u5b9f\u65bd\u3057\u305f\u3044\n#\u306e\u3067\u5165\u529b\u3092\u53cd\u8ee2\u3055\u305b\u308b\ns2_r = s2[::-1]\nt_r = t[::-1]\n\nans_flag = False\n#\u5168\u6587\u5b57\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u8a66\u3059\nfor i in range(len(s2)):\n for j in range(i+1,len(s2)+1):\n #t\u3068\u540c\u3058\u6587\u5b57\u6570\u306e\u6642\u3060\u3051\u90e8\u5206\u4e00\u81f4\u3059\u308b\u304b\u5224\u5b9a\u3059\u308b\n if (j-i) == len(t_r):\n flag = True\n #\u4e00\u6587\u5b57\u3054\u3068\u306b\u5224\u5b9a\u3059\u308b\n for k,l in enumerate(range(i,j)):\n if s2_r[l] != t_r[k] and s2_r[l] != '?':\n flag = False\n if flag == True:\n #\u4e00\u81f4\u3057\u305f\u4f4d\u7f6e\u3092\u7f6e\u63db\n ans = s2_r[:i] + t_r + s2_r[j:]\n #\u6b8b\u308a\u306e?\u3092\u8f9e\u66f8\u9806\u6700\u5c0f\u306ea\u306b\u7f6e\u63db\n ans = ans.replace('?','a')\n #\u5143\u306e\u9806\u756a\u306b\u53cd\u8ee2\n ans = ans[::-1]\n print(ans) \n ans_flag = True\n break\n\n #for\u3092break\u3057\u306a\u3044\u3068continue\u3059\u308b\n else:\n continue\n break\n \nif ans_flag == False:\n print('UNRESTORABLE')", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "S = input()[::-1]\nT = input()[::-1]\n\nflag = False\nfor i in range(len(S) - len(T) + 1):\n matched = True\n\n for j in range(len(T)):\n\n if S[i + j] != \"?\" and S[i + j] != T[j]:\n matched = False\n break\n \n if matched:\n S = S[:i] + T + S[i + len(T):]\n flag = True\n break\n\nif flag:\n print(S.replace(\"?\", \"a\")[::-1])\nelse:\n print(\"UNRESTORABLE\")", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "S=input()\nT=input()\n\nlt=len(T)\nls=len(S)\nif ls<lt:f=0\nelse:\n for i in range(ls-lt,-1,-1):\n f=1\n for s,t in zip(S[i:i+lt],T):\n if s=='?' or s==t: continue\n f=0\n if f:break\nprint((S[0:i]+T+S[i+lt:ls]).replace('?','a') if f else 'UNRESTORABLE')", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nsys.setrecursionlimit(10**6)\n\ns = list(str(input()))\nt = list(str(input()))\n\nans = []\nfor i in range(len(s)-len(t)+1):\n # print(i)\n ans_tmp = \"\"\n for j in range(len(s)):\n if j >= i and i+len(t) > j:\n if s[j] == \"?\" or s[j] == t[j-i]:\n ans_tmp += t[j-i]\n else:\n break\n else:\n if s[j] == \"?\":\n ans_tmp += \"a\"\n else:\n ans_tmp += s[j]\n\n if len(ans_tmp) != len(s):\n continue\n else:\n ans.append(ans_tmp)\nans.sort()\n\nif len(ans) == 0:\n print(\"UNRESTORABLE\")\nelse:\n print((ans[0]))\n", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\n#import\n#import math\n#import numpy as np\n#= int(input())\nS = list(input())\nT = list(input())\n\nls = len(S); lt = len(T)\n\nfor i in range(ls - lt, -1, -1):\n isok = True\n for j in range(lt):\n if S[i + j] == \"?\":\n continue\n if S[i + j] != T[j]:\n isok = False\n break\n if isok:\n S[i:i+lt] = T\n ans = \"\"\n for s in S:\n if s == \"?\":\n ans += \"a\"\n else:\n ans += s\n print(ans)\n return\n\nprint(\"UNRESTORABLE\")\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "S = input()\nT = input()\n\nn = len(S)\nl = len(T)\n\nfor i in range(n-l+1)[::-1]:\n cnt = 0\n for j in range(l):\n if S[i+j] == \"?\" or S[i+j] == T[j]:\n cnt += 1\n \n if cnt == l:\n S = list(S[:i] + T + S[i+l:])\n for k in range(n):\n if S[k] == \"?\":\n S[k] = \"a\"\n print(\"\".join(S))\n break\n \nelse:\n print(\"UNRESTORABLE\")", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "def main():\n s=input()\n t=input()\n ans=[]\n for i in range(len(s)-len(t)+1):\n for j in range(len(t)):\n if len(s) <= i+j or (s[i+j] != t[j] and s[i+j] != \"?\"):\n break\n else:\n ans.append((s[:i]+t+s[i+j+1:]).replace(\"?\", \"a\"))\n ans.sort()\n print(ans[0] if len(ans) > 0 else \"UNRESTORABLE\")\n \ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "S=list(input())[::-1]\nT=list(input())[::-1]\nfor i in range(len(S)-len(T)+1):\n ans = S[:i]\n for j in range(len(T)):\n if S[i+j] != \"?\" and S[i+j] != T[j]:\n break\n else:\n ans.append(T[j])\n else:\n for j in range(i+len(T),len(S)):\n ans.append(S[j])\n print(\"\".join(map(str,ans[::-1])).replace(\"?\",\"a\"))\n break\nelse:\n print(\"UNRESTORABLE\")", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "S = input()\nT = input()\n \nls = len(S)\nlt = len(T)\nleft = -1\n \nfor i in range(ls-lt+1):\n for j in range(lt):\n if S[i+j] != \"?\" and S[i+j] != T[j]:\n break\n else:\n left = i\nif left == -1:\n ans = \"UNRESTORABLE\"\nelse:\n ans = S[:left]+T+S[left+lt:]\n ans = ans.replace(\"?\", \"a\")\nprint(ans)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "s = input()\nt = input()\n\nsoln = \"\"\n\nfor i in range(len(s)-len(t)+1):\n sol = True\n for j in range(len(t)):\n if not (s[i+j] == t[j] or s[i+j] == \"?\"):\n sol = False\n break\n\n if sol:\n soln = s[:i] + t + s[i+len(t):]\n\nprint(soln.replace(\"?\", \"a\") if soln != \"\" else \"UNRESTORABLE\")", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "import copy\ns = list(input())\nt = list(input())\n\nt1, t2 = copy.deepcopy(s), copy.deepcopy(s)\nok = []\nch = True\nif ch:\n for i in range(len(s)-len(t)+1):\n count = 0\n for j in range(len(t)):\n if s[i+j] == t[j] or s[i+j] == '?':\n count += 1\n if count == len(t):\n ok.append(i)\nif len(ok) == 0:\n print(\"UNRESTORABLE\")\n ch = False\nelse:\n for i in range(len(t)):\n t1[ok[0]+i] = t[i]\n for i in range(len(t)):\n t2[ok[-1]+i] = t[i]\nif ch:\n for i in range(len(t1)):\n if t1[i] == '?':\n t1[i] = 'a'\n if t2[i] == '?':\n t2[i] = 'a'\n an1, an2 = \"\", \"\"\n for i in t1:\n an1 += i\n for i in t2:\n an2 += i\n print(min(an1, an2))", "passed": true, "time": 0.39, "memory": 14184.0, "status": "done"}, {"code": "S = input()\nT = input()\n\nif len(S) < len(T):\n print('UNRESTORABLE')\n return\n \n\nind = None\nfor i in range(len(S)-len(T)+1):\n for j in range(len(T)):\n if S[i+j] == \"?\":\n continue\n elif S[i+j] == T[j]:\n continue\n else:\n break\n else:\n ind = i\n\nif ind == None:\n print('UNRESTORABLE')\nelse:\n ans = list(S)\n for i in range(ind,ind+len(T)):\n ans[i] = T[i-ind]\n for i in range(len(ans)):\n if ans[i] == \"?\":\n ans[i] = \"a\"\n print(\"\".join(ans))", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "S = input()\nT = input()\n\nl = len(S)\nk = len(T)\nf = 0\n\n\nif k > l:\n f = 0\nelse:\n for i in reversed(list(range(0,l-k+1))):\n #print(i)\n for j in range(k):\n #print(S[i+j], T[j])\n if S[i + j] != T[j] and S[i + j] != \"?\":\n #print(i+j)\n break\n if j == k-1:\n f = 1\n s = i\n if f == 1:\n break\n\nif f == 0:\n print(\"UNRESTORABLE\")\nelse:\n S = S[:s] + T + S[s+k:]\n for i in range(l):\n if S[i] == \"?\":\n S = S[:i] + \"a\" + S[i+1:]\n print(S)\n", "passed": true, "time": 0.34, "memory": 14052.0, "status": "done"}, {"code": "s = input()\nt = input()\nn = len(s)\nm = len(t)\nans = []\n\nfor i in range(n-m+1):\n \t#t\u3068\u540c\u3058\u6587\u5b57\u6570\u3092s\u304b\u3089\u629c\u304d\u51fa\u3059\n c = 0\n for j in range(m):\n if s[i+j] == '?' or s[i+j] == t[j]:\n \t#s\u306e\u6587\u5b57\u304c\"?\"\u307e\u305f\u306ft[j]\u3068\u540c\u3058\u5834\u5408\n c += 1\n if c == m:\n \t#\u6587\u5b57\u306e\u5909\u63db\n s_ = s[0:i] + t + s[i+m:]\n s_ = s_.replace('?', 'a')\n ans.append(s_)\nif len(ans)>0:\n print(sorted(ans)[0])\nelse:\n print('UNRESTORABLE')", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "import sys\nimport math\nfrom collections import defaultdict\nfrom collections import deque\n\nsys.setrecursionlimit(1000000)\nMOD = 10 ** 9 + 7\ninput = lambda: sys.stdin.readline().strip()\nNI = lambda: int(input())\nNMI = lambda: map(int, input().split())\nNLI = lambda: list(NMI())\nSI = lambda: input()\n\n\ndef main():\n S = SI()\n T = SI()\n ls = len(S)\n lt = len(T)\n R = []\n for i in range(ls-lt+1):\n SS = S[i:i+lt]\n is_ok = True\n for s, t in zip(SS, T):\n if s != \"?\" and s != t:\n is_ok = False\n if not is_ok:\n continue\n r = \"\"\n for j, s in enumerate(S):\n if j == i:\n r += T\n elif i < j < i+lt:\n pass\n elif s == \"?\":\n r += \"a\"\n else:\n r += s\n R.append(r)\n R.sort()\n if R:\n print(R[0])\n else:\n print(\"UNRESTORABLE\")\n\n\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "s = input()\nt = input()\n\nn = len(s)\nm = len(t)\n\nfor i in range(n-m, -1, -1):\n x = s[i:i+m]\n for j in range(m+1):\n if j == m:\n print(((s[:i]+t+s[i+m:]).replace(\"?\",\"a\")))\n return\n if x[j] == \"?\": continue\n elif x[j] != t[j]: break\n \nprint(\"UNRESTORABLE\")\n", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "s = input()\nt: str = input()\nn = len(s)\nm = len(t)\n\nfor i in range(n-m, -1, -1): #-1\u304b\u3089n-m\u56de\u3001\uff11\u305a\u3064\u5f15\u3044\u3066\u3044\u304f\n tlike = s[i: i+m]\n if tlike[0] == t[0] or tlike[0] == \"?\":\n for j in range(m+1):\n if j == m:\n print((s[:i] + t + s[i + m:]).replace(\"?\", \"a\"))\n return\n if tlike[j] == \"?\":\n continue\n elif tlike[j] != t[j]:\n break\n\nprint(\"UNRESTORABLE\")", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "# \u89e3\u8aac\u3092\u8aad\u307f\u306a\u304c\u3089\u81ea\u4f5c\n\nS = input()\nT = input()\n\ns_len = len(S)\nt_len = len(T)\n\nres = []\n\ninit_K = \"?\" * s_len\nfor i in range(s_len - t_len + 1):\n K = list(init_K[:i] + T + init_K[i + t_len:])\n # K\u3092S\u306b\u3057\u305f\u304c\u3063\u3066\u66f8\u304d\u63db\u3048\u3066\u3044\u304f\u3002\u66f8\u304d\u63db\u3048\u3089\u308c\u306a\u3044\u2192\u6b63\u89e3\u3067\u306f\u306a\u3044\n for j in range(s_len):\n if S[j] == \"?\" or S[j] == K[j]: # S\u304c\"?\"\u307e\u305f\u306fS\u3068K\u304c\u4e00\u81f4\u3001\u66f8\u304d\u63db\u3048\u308b\u5fc5\u8981\u306a\u3057\n pass\n elif K[j] == \"?\": # S\u304c\"?\"\u3067\u306f\u306a\u304f\u3066K\u304c\"?\"\u3001\u66f8\u304d\u63db\u3048\u308b\n K[j] = S[j]\n else: # \u305d\u308c\u4ee5\u5916\u3001\u66f8\u304d\u63db\u3048\u3089\u308c\u306a\u3044\n break\n else: # break\u3057\u306a\u304b\u3063\u305f\n # \u8f9e\u66f8\u9806\u3067\u6700\u5c0f\u306b\u306a\u308b\u3088\u3046\u306b\u3001\u6b8b\u3063\u305fK\u306e\"?\"\u3092\"a\"\u306b\u5909\u3048\u308b\n res.append(\"\".join(K).replace(\"?\", \"a\"))\n\nif res:\n res.sort()\n print((res[0]))\nelse:\n print(\"UNRESTORABLE\")\n", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "S=str(input())\nT=str(input())\nls=len(S)\nlt=len(T)\n\nans=''\nloc=None\nfor i in range(ls-lt,-1,-1):\n flag=0\n for j in range(lt):\n if not (S[i+j] == T[j] or S[i+j] == '?'):\n flag=1\n break\n if flag==0:\n loc=i\n break\n\nif loc == None:\n print('UNRESTORABLE')\nelse:\n i=0\n while i<ls:\n if i==loc:\n ans += T\n i += lt\n elif S[i] == '?':\n ans += 'a'\n i += 1\n else:\n ans += S[i]\n i += 1\n print(ans)\n", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "s = input()\nt = input()\n\nn = len(s)\nk = len(t)\nfor i in range(n - k, -1, -1):\n ok = True\n for j in range(k):\n if s[i + j] == '?' or s[i + j] == t[j]:\n continue\n else:\n ok = False\n break\n if ok:\n print((s[:i].replace('?', 'a') + t + s[i + k:].replace('?', 'a')))\n return\nprint('UNRESTORABLE')\n", "passed": true, "time": 0.22, "memory": 14252.0, "status": "done"}, {"code": "S=input()\nT=input()\nN=len(S)\nn=len(T)\nans=[]\nfor i in range(N-n+1):\n for j in range(n):\n if S[i+j]!=T[j] and S[i+j]!='?':\n break\n else:\n s=[]\n for j in range(i):\n if S[j]=='?':\n s.append('a')\n else:\n s.append(S[j])\n for j in range(i,i+n):\n s.append(T[j-i])\n for j in range(i+n,N):\n if S[j]=='?':\n s.append('a')\n else:\n s.append(S[j])\n ans.append(''.join(s))\n\nif len(ans)==0:\n print(\"UNRESTORABLE\")\nelse:\n ans.sort()\n print((ans[0]))\n", "passed": true, "time": 0.27, "memory": 14160.0, "status": "done"}, {"code": "S = input()\nT = input()\n\nfor i in range(len(S) - len(T)+1):\n target = S[len(S) - len(T) - i:len(S) - i]\n\n can_search = True\n for key in range(len(T)):\n if target[key] != '?':\n if target[key] != T[key]:\n can_search = False\n break\n\n if can_search:\n new_key = S[:len(S) - len(T) - i]\n new_key += T\n new_key += S[len(new_key):]\n print((new_key.replace('?', 'a')))\n return\n\nprint('UNRESTORABLE')\n", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "S = list(input())\nT = list(input())\ns = len(S)\nt = len(T)\nfor i in range(s-t,-1,-1):\n ss = S[i:i+t]\n for j in range(t):\n if ss[j] != \"?\" and ss[j] != T[j]:\n break\n else:\n for j in range(t):\n if ss[j] == \"?\":\n S[i+j] = T[j]\n break\nelse:\n print(\"UNRESTORABLE\")\n return\nprint(\"\".join(S).replace(\"?\",\"a\"))", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "S = input()\nT = input()\n\nls = len(S)\nlt = len(T)\nleft = -1\n\nfor i in range(ls-lt+1):\n for j in range(lt):\n if S[i+j] != \"?\" and S[i+j] != T[j]:\n break\n else:\n left = i\nif left == -1:\n ans = \"UNRESTORABLE\"\nelse:\n ans = S[:left]+T+S[left+lt:]\n ans = ans.replace(\"?\", \"a\")\nprint(ans)", "passed": true, "time": 0.23, "memory": 14272.0, "status": "done"}, {"code": "import sys\n\ndef accept_input():\n S = input()\n T = input()\n return S,T\n\nS,T = accept_input()\nfromhere = -1\nfor i in range(len(S)-len(T)+1):\n for j in range(len(T)):\n if S[i+j] == \"?\":\n continue\n elif S[i+j] == T[j]:\n continue\n elif S[i+j] != T[j]:\n break\n else:\n fromhere = i\nif fromhere == -1:\n print(\"UNRESTORABLE\")\n return\nsd = \"\"\nfor i in range(len(S)):\n if i < fromhere:\n if S[i] == \"?\":\n sd += \"a\"\n else:\n sd += S[i]\n elif i >= fromhere+len(T):\n if S[i] == \"?\":\n sd += \"a\"\n else:\n sd += S[i]\n else:\n sd += T[i-fromhere]\nprint(sd)\n", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "s=input()\nt=input()\n\ns_l=len(s)\nt_l=len(t)\n\nans=[]\nfor i in range(s_l-t_l+1):\n judge=True\n\n ts=list(s)\n for j in range(t_l):\n if ts[i+j]==t[j]:\n pass\n elif ts[i+j]=='?':\n ts[i+j]=t[j]\n else:\n judge=False\n break\n\n if judge and j==t_l-1:\n for k in range(s_l):\n if ts[k]=='?':\n ts[k]='a'\n ans.append(ts)\n\nif ans:\n ans.sort()\n print(''.join(ans[0]))\nelse:\n print('UNRESTORABLE')", "passed": true, "time": 0.15, "memory": 14360.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 28 02:20:36 2020\n\n@author: liang\n\"\"\"\nS = input()\nT = input()\n\nS = S[::-1]\nT = T[::-1]\n\nres = list()\n\nfor i in range(len(S)-len(T)+1):\n flag = True\n for j in range(len(T)):\n if S[i+j] == \"?\" or S[i+j] == T[j]:\n continue\n else:\n flag = False\n if flag == True:\n ans = \"\"\n for k in range(len(S)):\n if i <= k <= i + len(T)-1:\n #print(T[k-i])\n ans += T[k-i]\n elif S[k] != \"?\":\n #print(\"B\")\n ans += S[k]\n else:\n #print(\"C\")\n ans += \"a\"\n ans = ans[::-1]\n print(ans)\n break\n #res.append(ans)\nelse:\n print(\"UNRESTORABLE\")\n\"\"\"\nif res:\n res.sort()\n print(res[0])\nelse:\n print(\"UNRESTORABLE\")\n\"\"\"\n#print(S)\n#print(T)\n", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\nls =len(s)\nlt = len(t)\ns.reverse()\nt.reverse()\nfor i in range(ls):\n for j in range(lt):\n if i + j >= ls:\n break\n if s[i+j] != '?' and s[i+j] != t[j]:\n break\n else:\n for j in range(lt):\n s[i+j] = t[j]\n s = [x if x != '?' else 'a' for x in s]\n s.reverse()\n ans = ''.join(s)\n break\nelse:\n ans = 'UNRESTORABLE'\nprint(ans)", "passed": true, "time": 0.15, "memory": 14340.0, "status": "done"}, {"code": "S = input()\nT = input()\nanslist = []\nfor i in range(len(S)-len(T)+1):\n kouho = [0]*len(S)\n ok = 1\n for j in range(len(T)):\n if S[i+j] == T[j] or S[i+j] == \"?\":\n kouho[i+j] = T[j]\n else:\n ok = 0\n break\n if ok == 1:\n for k in range(len(S)):\n if kouho[k] == 0:\n if S[k] != \"?\":\n kouho[k] = S[k]\n else:\n kouho[k] = \"a\"\n kouho = ''.join(kouho)\n anslist.append(kouho)\nif len(anslist) == 0:\n ans = \"UNRESTORABLE\"\nelse:\n anslist.sort()\n ans = anslist[0]\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "import re\nSd = input()\nT = input()\nSdls = list(Sd)\nSdls.reverse()\nSdre = ''.join(Sdls)\nTls = list(T)\nTls.reverse()\nTre = ''.join(Tls)\nst = -1\nfor i in range(0,len(Sd)-len(T)+1):\n f = 1\n for j in range(len(T)):\n if Tre[j] == Sdre[i+j] or Sdre[i+j] == '?':\n continue\n else:\n f = 0\n break\n if f == 1:\n st = i\n break\nif st == -1:\n print('UNRESTORABLE')\nelse:\n Sdrels = list(Sdre)\n for j in range(len(T)):\n Sdrels[j+st] = Tre[j]\n for j in range(len(Sd)):\n if Sdrels[j] == '?':\n Sdrels[j] = 'a'\n ans = ''.join(reversed(Sdrels))\n print(ans)", "passed": true, "time": 0.15, "memory": 14136.0, "status": "done"}, {"code": "s = input()\nt = input()\nlt = len(t)\nans = []\nfor i in range(len(s)-lt+1):\n cnt = 0\n n = 0\n while n < lt:\n if s[i+n] == '?':\n cnt += 1\n else:\n if s[i+n] == t[n]:\n cnt += 1\n n += 1\n if cnt == lt:\n ans.append(list(s[:i] + t + s[i+lt:]))\n # print(ans)\n # break\n\nif len(ans) != 0:\n for a in ans:\n # print(a)\n for i in range(len(a)):\n if a[i] == '?':\n a[i] = 'a'\n ans.sort()\n print(*ans[0], sep='')\n\nelse:\n print('UNRESTORABLE')", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "S=input()\nT=input()\n\nlt=len(T)\nls=len(S)\nif ls<lt:flg=0\nelse:\n for i in range(ls-lt,-1,-1):\n flg=1\n for j in range(i,i+lt):\n s=S[j]\n if s=='?' or s==T[j-i]: continue\n flg=0\n break\n if flg:break\nif flg:\n print((S[0:i]+T+S[i+lt:ls]).replace('?','a'))\nelse:\n print('UNRESTORABLE')", "passed": true, "time": 0.23, "memory": 14300.0, "status": "done"}, {"code": "import sys\n#import string\n#from collections import defaultdict, deque, Counter\n#import bisect\n#import heapq\n#import math\n#from itertools import accumulate\n#from itertools import permutations as perm\n#from itertools import combinations as comb\n#from itertools import combinations_with_replacement as combr\n#from fractions import gcd\n#import numpy as np\n\nstdin = sys.stdin\nsys.setrecursionlimit(10 ** 7)\nMIN = -10 ** 9\nMOD = 10 ** 9 + 7\nINF = float(\"inf\")\nIINF = 10 ** 18\n\ndef solve():\n s = str(stdin.readline().rstrip())\n t = str(stdin.readline().rstrip())\n #A, B, C = map(int, stdin.readline().rstrip().split())\n #l = list(map(int, stdin.readline().rstrip().split()))\n #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]\n #word = [stdin.readline().rstrip() for _ in range(n)]\n #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]\n #zeros = [[0] * w for i in range(h)]\n anss = []\n for i in range(len(s)-len(t)+1):\n test = s[i:len(t)+i]\n flag = True\n for j in range(len(t)):\n if test[j] != \"?\" and test[j] != t[j]:\n flag = False\n if flag==True:\n ans = s[0:i] + t + s[i+len(t):]\n ans = ans.replace(\"?\",\"a\")\n anss.append(ans)\n if len(anss) == 0:\n print(\"UNRESTORABLE\")\n return\n anss.sort()\n print((anss[0]))\n\n\ndef __starting_point():\n solve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "S = input()\nT = input()\nlen_S, len_T = len(S), len(T)\nans = []\nfor i in range(len_S-len_T+1):\n\tf = True\n\tfor j in range(len_T):\n\t\tif S[i+j] != T[j] and S[i+j] != '?':\n\t\t\tf = False\n\t\t\tbreak\n\tif f:\n\t\ts = S[:i] + T + S[i+j+1:]\n\t\tans.append(s.replace('?', 'a'))\nif len(ans) == 0:\n\tprint('UNRESTORABLE')\nelse:\n\tans.sort()\n\tprint(ans[0])", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "s = input()\nt = input()\nns = len(s)\nnt = len(t)\n\ncand = []\n\nfor i in range(ns-nt+1):\n j = 0\n temps = list(s)\n f1 = True\n while j <= nt-1:\n if temps[i+j] == '?' or temps[i+j] == t[j]:\n temps[i+j] = t[j]\n else:\n f1 = False\n break\n j += 1\n if f1:\n temps = \"\".join(temps)\n cand.append(temps.replace('?', 'a'))\n\nif len(cand) == 0:\n ans = 'UNRESTORABLE'\nelse:\n cand.sort()\n ans = cand[0]\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "S=input()\nT=input()\n\nans_list=[]\nfor i in range(len(S)-len(T)+1):\n X=S[i:i+len(T)]\n isOK=True\n for j in range(len(T)):\n if X[j]==\"?\" or X[j]==T[j]:\n pass\n else:\n isOK=False\n break\n \n if isOK:\n ans=S[:i]+T+S[i+len(T):]\n \n ans=ans.replace('?','a')\n ans_list.append(ans)\n\nif len(ans_list)<1:\n print(\"UNRESTORABLE\")\nelse:\n ans_list.sort()\n print((ans_list[0]))\n", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "s=list(input())\nt=list(input())\nnum=len(s)-len(t)\nans1=-1\nfor i in range(num+1):\n num1=0\n num2=num-i\n for j in range(len(t)):\n if s[num2+j]!=t[j] and s[num2+j]!=\"?\":\n num1=1\n break\n if num1==0:\n ans1=num2\n break\nif ans1==-1:\n print(\"UNRESTORABLE\")\nelse:\n ans=\"\"\n for i in range(len(t)):\n s[ans1+i]=t[i]\n for i in range(len(s)):\n if s[i]==\"?\":\n s[i]=\"a\"\n ans+=s[i]\n print(ans)\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "import math\n\nsd = list(input())\nt = list(input())\n\ndic = []\n\nslen = len(sd)\ntlen = len(t)\nfor i in range(slen - tlen + 1):\n for j in range(tlen):\n if not (t[j] == sd[i + j] or sd[i + j] == \"?\"):\n break\n else:\n s = sd[:i] + t + sd[i + tlen:]\n for k in range(len(s)):\n if s[k] == \"?\":\n s[k] = \"a\"\n dic.append(\"\".join(s))\n\nif len(dic) == 0:\n print(\"UNRESTORABLE\")\n return\nprint(sorted(dic)[0])", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "S = input()\nT = input()\nls = len(S)\nlt = len(T)\n\nunrestorable = 'z'*50\nans = unrestorable\nfor i in range(ls-lt+1):\n for j, t in enumerate(T):\n s = S[i+j]\n if s != t and s != '?':\n break\n else:\n key = (S[:i]+T+S[i+lt:]).replace('?', 'a')\n ans = min(ans, key)\n\nprint((ans if ans != unrestorable else 'UNRESTORABLE'))\n", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "import re\nimport sys\nimport math\nimport itertools\nimport bisect\nfrom copy import copy\nfrom collections import deque,Counter\nfrom decimal import Decimal\nimport functools\ndef v(): return input()\ndef k(): return int(input())\ndef S(): return input().split()\ndef I(): return list(map(int,input().split()))\ndef X(): return list(input())\ndef L(): return list(input().split())\ndef l(): return list(map(int,input().split()))\ndef lcm(a,b): return a*b//math.gcd(a,b)\nsys.setrecursionlimit(10 ** 6)\nmod = 10**9+7\ncnt = 0\nans = 0\ninf = float(\"inf\")\nal = \"abcdefghijklmnopqrstuvwxyz\"\nAL = al.upper()\n\nS = v()\nT = v()\nlen_s = len(S)\nlen_t = len(T)\ncheck = False\nans = []\n\nif len_s<len_t:\n print(\"UNRESTORABLE\")\n return\n\nfor i in range(len_s):\n if S[i] == \"?\":\n cnt += 1\n if cnt >= len_t:\n aaa = S.replace(\"?\",\"a\")\n ans.append(aaa[:i-len_t+1]+T+aaa[i+1:])\n elif S[i] in T:\n cnt = 0\n place = T.index(S[i])\n if len_s<len_t+i-place:\n break\n for j in range(i-place,len_t+i-place):\n if T[j-(i-place)] == S[j] or S[j] == \"?\":\n check = True\n else:\n check = False\n break\n if check:\n aaa = S.replace(\"?\",\"a\")\n ans.append(aaa[:i-place]+T+aaa[len_t+i-place:])\n else:\n cnt = 0\n\nif len(ans)>0:\n ans.sort()\n print((ans[0]))\nelse:\n print(\"UNRESTORABLE\")\n \n", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "S = list(input())\nT = input()\ncandidate = []\n\nans = True\nfor i in range(len(S)):\n flag = True\n for j in range(len(T)):\n if i + j >= len(S):\n flag = False\n break\n if S[i+j] == '?' or S[i+j] == T[j]:\n pass\n else:\n flag = False\n break\n if flag:\n candidate.append(i)\n ans = False\n\nif ans:\n print('UNRESTORABLE')\n return\n\ni = candidate[-1]\nfor tmp in range(i, i + len(T)):\n S[tmp] = T[tmp-i]\n\n\nfor i in range(len(S)):\n if S[i] == '?':\n S[i] = 'a'\n\nprint(''.join(S))", "passed": true, "time": 0.14, "memory": 14388.0, "status": "done"}, {"code": "S=list(input())\nT=list(input())\n\ndef match(s,t):\n for _s, _t in zip(s, t):\n if not (_s == _t or _s == '?'):\n return False\n return True\n \ndef convert(S):\n for i in range(len(S)):\n if S[i] == '?':\n S[i] = 'a'\n return S\n\ndef replace(S,T,off):\n for i in range(len(T)):\n S[off+i] = T[i]\n return S\n\npos = -1\nfor i in reversed(range(0,len(S)-len(T)+1)):\n if match(S[i:], T):\n pos = i\n break\n \nif 0 <= pos:\n ans = S\n ans = replace(ans, T, pos)\n ans = convert(ans)\n print(*ans,sep=\"\")\nelse:\n print('UNRESTORABLE')", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "import bisect, collections, copy, heapq, itertools, math, string, sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = float('inf')\ndef I(): return int(input())\ndef F(): return float(input())\ndef SS(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LSS(): return input().split()\n\ndef resolve():\n S_ = SS()\n T = SS()\n\n len_S = len(S_)\n len_T = len(T)\n\n # T\u306fS'\u306e\u306a\u308b\u3079\u304f\u53f3\u5074\u306b\u3042\u308b\u3079\u304d\n idx = -1\n for i in range(len_S - len_T, -1, -1):\n exists = True\n for j in range(len_T):\n if S_[i+j] != '?' and S_[i+j] != T[j]:\n exists = False\n break\n if exists:\n idx = i\n break\n\n if idx == -1:\n print('UNRESTORABLE')\n else:\n ans = list(S_)\n for i in range(len_S):\n if S_[i] == '?':\n if idx <= i < idx + len_T:\n ans[i] = T[i-idx]\n else:\n ans[i] = 'a'\n\n print((''.join(ans)))\n\ndef __starting_point():\n resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14408.0, "status": "done"}, {"code": "s_ = input()\nt_ = input()\ns = [c for c in s_]\nt = [c for c in t_] \nn = len(s)\nm = len(t)\nfor i in reversed(list(range(m-1, n))):\n replaced = 0\n if s[i]==t[-1] or s[i]==\"?\":\n k = i-1\n \"\"\"\n if k+1<m-1:\n continue\n \"\"\"\n replace = 1\n for j in reversed(list(range(m-1))):\n if s[k]==t[j] or s[k]==\"?\":\n if j==0:\n replace=1\n break\n else:\n replace = 0\n break\n k -= 1\n\n if replace:\n k = i\n for j in reversed(list(range(m))):\n s[k] = t[j]\n k -= 1\n replaced = 1\n if replaced:\n break\nif n < m:\n replaced=0\nif replaced:\n for i in range(n):\n if s[i]==\"?\":\n s[i]=\"a\"\n print((\"\".join(s)))\nelse:\n print(\"UNRESTORABLE\")\n", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "S = input()\nT = input()\ndef match(s,t):\n for c,d in zip(s,t):\n if c == \"?\":\n continue\n elif c == d:\n continue\n else:\n return False\n return True\nfor i in range(len(S)-len(T), -1, -1):\n s = S[i:i+len(T)]\n if match(s, T):\n print((S[:i]+T+S[i+len(T):]).replace(\"?\",\"a\"))\n return\nprint(\"UNRESTORABLE\")", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "S_p=input()\nT=input()\n\nk=[]\nfor i in range(len(S_p)-len(T)+1):\n\tS_sub = S_p[i:i+len(T)]\n\tif all(s in (t, \"?\") for s, t in zip(S_sub, T)):\n\t\tk.append(i)\n\n\nif k:\n\tS=S_p[:k[-1]]+T+S_p[k[-1]+len(T):]\n\tprint(S.replace(\"?\", \"a\"))\nelse:\n\tprint(\"UNRESTORABLE\")", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\nn = len(s)\nm = len(t)\nk = -1\nfor i in range(n-m+1):\n x = s[i:i+m]\n flg = True\n for j in range(m):\n if x[j] != '?' and x[j] != t[j]:\n flg = False\n break\n if flg:\n k = i\nif k != -1:\n for i in range(k,k+m):\n s[i] = t[i-k]\n for i in range(n):\n if s[i] == '?':\n s[i] = 'a'\n print(''.join(s))\nelse:\n print('UNRESTORABLE')", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}]
[{"input": "?tc????\ncoder\n", "output": "atcoder\n"}, {"input": "??p??d??\nabc\n", "output": "UNRESTORABLE\n"}]
4,724
Takahashi is a user of a site that hosts programming contests. When a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows: - Let the current rating of the user be a. - Suppose that the performance of the user in the contest is b. - Then, the new rating of the user will be the avarage of a and b. For example, if a user with rating 1 competes in a contest and gives performance 1000, his/her new rating will be 500.5, the average of 1 and 1000. Takahashi's current rating is R, and he wants his rating to be exactly G after the next contest. Find the performance required to achieve it. -----Constraints----- - 0 \leq R, G \leq 4500 - All input values are integers. -----Input----- Input is given from Standard Input in the following format: R G -----Output----- Print the performance required to achieve the objective. -----Sample Input----- 2002 2017 -----Sample Output----- 2032 Takahashi's current rating is 2002. If his performance in the contest is 2032, his rating will be the average of 2002 and 2032, which is equal to the desired rating, 2017.
introductory
[{"code": "# \u73fe\u5728\u3068\u76ee\u6a19\u306e\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u53d6\u5f97\nR = int(input())\nG = int(input())\n\n# \u76ee\u6a19\u306e\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u306b\u306a\u308b\u305f\u3081\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6570\u5024\u3092\u8a08\u7b97\nTarget = (G * 2) - R\n\n# \u8a08\u7b97\u7d50\u679c\u3092\u51fa\u529b\nprint(Target)", "passed": true, "time": 0.34, "memory": 14284.0, "status": "done"}, {"code": "R=int(input())\nG=int(input())\nprint((2*G-R))\n", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\nprint(2*G-R)", "passed": true, "time": 0.15, "memory": 13988.0, "status": "done"}, {"code": "# \u9ad8\u6a4b\u541b\u306f\u3042\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30b9\u30c8\u304c\u884c\u308f\u308c\u3066\u3044\u308b\u30b5\u30a4\u30c8\u306b\u53c2\u52a0\u3057\u3066\u3044\u307e\u3059\u3002\n# \u3053\u3053\u3067\u306f, \u30b3\u30f3\u30c6\u30b9\u30c8\u306b\u51fa\u5834\u3057\u305f\u6642\u306b\u3053\u306e\u9806\u4f4d\u306b\u5fdc\u3058\u3066\u300c\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u3064\u304d\u3001\n# \u305d\u308c\u306b\u3088\u3063\u3066\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0 (\u6574\u6570\u3068\u306f\u9650\u3089\u306a\u3044) \u304c\u6b21\u306e\u3088\u3046\u306b\u5909\u5316\u3057\u307e\u3059\u3002\n#\n# \u73fe\u5728\u306e\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u3092 a \u3068\u3059\u308b\u3002\n# \u6b21\u306e\u30b3\u30f3\u30c6\u30b9\u30c8\u3067, \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9 b\u3092\u53d6\u3063\u305f\u3068\u3059\u308b\u3002\n# \u305d\u306e\u3068\u304d, \u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u306f a \u3068 b \u306e\u5e73\u5747\u307e\u3067\u5909\u5316\u3059\u308b\u3002\n# \u4f8b\u3048\u3070, \u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u304c 1 \u306e\u4eba\u304c\n# \u6b21\u306e\u30b3\u30f3\u30c6\u30b9\u30c8\u3067\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9 1000\u3092\u53d6\u3063\u305f\u3089,\n# \u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u306f 1 \u3068 1000 \u306e\u5e73\u5747\u3067\u3042\u308b 500.5 \u306b\u306a\u308a\u307e\u3059\u3002\n#\n# \u9ad8\u6a4b\u541b\u306f, \u73fe\u5728\u306e\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u304c R \u3067,\n# \u6b21\u306e\u30b3\u30f3\u30c6\u30b9\u30c8\u3067\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u3061\u3087\u3046\u3069 G\u306b\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002\n# \u305d\u306e\u3068\u304d, \u9ad8\u6a4b\u541b\u304c\u53d6\u308b\u3079\u304d\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6c42\u3081\u306a\u3055\u3044\u3002\n\n# \u5236\u7d04\n# 0 \u2266 R, G \u2266 4500\n# \u5165\u529b\u306f\u3059\u3079\u3066\u6574\u6570\n\n# \u6a19\u6e96\u5165\u529b\u304b\u3089 R, G \u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\nr = int(input())\ng = int(input())\n\n# \u9ad8\u6a4b\u541b\u304c\u53d6\u308a\u3079\u304d\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u8a08\u7b97\u3057\u3001\u51fa\u529b\u3059\u308b\n# (r + x) / 2 = G\nresult = g * 2 - r\n\nprint(result)\n", "passed": true, "time": 0.23, "memory": 14156.0, "status": "done"}, {"code": "def iroha():\n a = [int(input()) for _ in range(2)]\n print((2*a[1]-a[0]))\n \n\ndef __starting_point():\n iroha()\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint(2*G-R)", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "a=int(input())\nb= int(input())\nprint(b*2-a)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint(G * 2 - R)", "passed": true, "time": 0.15, "memory": 14260.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint(G * 2 - R)", "passed": true, "time": 0.38, "memory": 14204.0, "status": "done"}, {"code": "# \u73fe\u5728\u306e\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u304c R \u3067, \u6b21\u306e\u30b3\u30f3\u30c6\u30b9\u30c8\u3067\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u3061\u3087\u3046\u3069 G \u306b\u3057\u305f\u3044\n# \u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u306f\u73fe\u5728\u306e\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u3068\u6b21\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u5e73\u5747\n\nR = int(input())\nG = int(input())\n\nb = 2*G - R\nprint(b)\n", "passed": true, "time": 0.5, "memory": 14156.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint((2 * G - R))\n\n# \u9ad8\u6a4b\u541b\u304c\u53d6\u308b\u3079\u304d\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u3092X\u3068\u7f6e\u304f\u3068\u3000(R + X) / 2 = G \u3068\u306a\u308b\u3002\n# \u5f0f\u3092\u5909\u5f62\u3059\u308b\u3068\u3000X = 2 * G - R \u3068\u306a\u308b\u3002\u3053\u308c\u304c\u9ad8\u6a4b\u541b\u304c\u53d6\u308b\u3079\u304d\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u3002\n", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\n\nx = 2 * g - r\n\nprint(x)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "x=int(input())\ny=int(input())\nprint(y+(y-x))", "passed": true, "time": 0.33, "memory": 14188.0, "status": "done"}, {"code": "current_rating = int(input())\nfinal_rating = int(input())\nperformance = final_rating * 2 - current_rating\nprint(performance)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint(2* G - R)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "print((-1) * int(input()) + 2 * int(input()))", "passed": true, "time": 0.22, "memory": 14212.0, "status": "done"}, {"code": "import bisect,collections,copy,heapq,itertools,math,string\nimport sys\ndef I():\n #1 line 1 int\n return int(sys.stdin.readline().rstrip())\ndef LI():\n #1 line n int\n return list(map(int,sys.stdin.readline().rstrip().split()))\ndef S():\n #1 line 1 string\n return sys.stdin.readline().rstrip()\ndef LS():\n #1 line n strings\n return list(sys.stdin.readline().rstrip().split())\n\nR=I()\nG=I()\n\nx=2*G-R\nprint(x)", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nprint(2*b-a)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\n\nprint(2*b-a)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "R, G = (int(input()) for i in range(2))\nprint(G * 2 - R)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "# \u5165\u529b\nR = int(input())\nG = int(input())\n\n# \u51fa\u529b\n\nif 0 <= R and G <= 4500:\n print(G * 2 - R)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "r = int(input())\nn = int(input())\nprint((n * 2 - r))\n", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "print(-int(input()) + 2 * int(input()))", "passed": true, "time": 0.14, "memory": 14008.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\nprint((G+(G-R)))\n", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "# \u5165\u529b\nr = int(input())\ng = int(input())\n\n# \u51e6\u7406\nanswer = 2 * g - r\n\nprint(answer)\n\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\nprint(2 * G - R)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "# A - Rating Goal\n\n# \u73fe\u5728\u306e\u30ec\u30fc\u30c8\u3092a, \u30b3\u30f3\u30c6\u30b9\u30c8\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092b\u3068\u3059\u308b\u3068\u3001\u30ec\u30fc\u30c8\u306fa\u3068b\u306e\u5e73\u5747\u307e\u3067\u5909\u5316\u3059\u308b\n# \u73fe\u5728\u306e\u30ec\u30fc\u30c8\u3092R, \u6b21\u306e\u30b3\u30f3\u30c6\u30b9\u30c8\u3067\u306e\u76ee\u6a19\u30ec\u30fc\u30c8\u3092G\u3068\u3057\u305f\u5834\u5408\u3001\u53d6\u308b\u3079\u304d\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u51fa\u529b\u3059\u308b\n\n\nR = int(input())\nG = int(input())\n\nprint(((G * 2) - R))\n", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\n\nprint(2*g-r)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\nprint(2*g-r)", "passed": true, "time": 0.15, "memory": 14264.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nprint(b + (b - a))", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint(2 * G - R)", "passed": true, "time": 0.36, "memory": 14024.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\n\nans = g * 2 - r\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\nprint(g*2-r)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "R=int(input())\nG=int(input())\nprint(G*2-R)", "passed": true, "time": 0.5, "memory": 14204.0, "status": "done"}, {"code": "R = int(input()) # \u73fe\u5728\u306e\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\nG = int(input()) # \u6b21\u306e\u30b3\u30f3\u30c6\u30b9\u30c8\u3067\u3068\u308a\u305f\u3044\u3068\u601d\u3063\u3066\u308b\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\n\n# \u9ad8\u6a4b\u541b\u304c\u53d6\u308b\u3079\u304d\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u51fa\u529b\nprint(G*2 - R)", "passed": true, "time": 0.15, "memory": 14060.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\nprint(2 * g - r)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "S_list = [int(input()) for i in range(2)]\n\nmokuhyou = 2 * S_list[1] - S_list[0]\nprint(mokuhyou)\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\nprint((2 * G - R))\n", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "R=int(input())\nG=int(input())\nprint(G*2-R)", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nprint(2*b-a)", "passed": true, "time": 0.14, "memory": 13980.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\n\nprint(2*g-r)", "passed": true, "time": 0.23, "memory": 14204.0, "status": "done"}, {"code": "print((-int(input()) + int(input()) * 2))\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "a,b=[int(input()) for i in range(2)]\n\nprint(2*b-a)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\nprint(2*g - r)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\ng = g * 2\nprint(g-r)", "passed": true, "time": 0.15, "memory": 14048.0, "status": "done"}, {"code": "R=int(input())\nG=int(input())\nprint(2*G-R)", "passed": true, "time": 0.2, "memory": 14192.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint(2 * G - R)", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "R, G = (int(input()) for i in range(2))\n\nR += (G - R) * 2\n\nprint(R)", "passed": true, "time": 0.17, "memory": 14196.0, "status": "done"}, {"code": "r=int(input())\ng=int(input())\nprint(2*g-r)", "passed": true, "time": 0.24, "memory": 14064.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\nprint((g * 2 - r))\n", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "#76\nr=int(input())\ng=int(input())\nprint(2*g-r)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nprint(2*b-a)", "passed": true, "time": 0.24, "memory": 14268.0, "status": "done"}, {"code": "# 076_a\nR=int(input())\nG=int(input())\nif (0<=R and R<=4500) and (0<=G and G<=4500):\n print((2*G-R))\n", "passed": true, "time": 0.16, "memory": 14204.0, "status": "done"}, {"code": "r=int(input())\ng=int(input())\nans=2*g-r\nprint(ans)", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "# \u73fe\u5728\u306e\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u3092 a \u3068\u3059\u308b\u3002\n# \u6b21\u306e\u30b3\u30f3\u30c6\u30b9\u30c8\u3067, \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9 b \u3092\u53d6\u3063\u305f\u3068\u3059\u308b\u3002\n#\u305d\u306e\u3068\u304d, \u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u306f a \u3068 b \u306e\u5e73\u5747\u307e\u3067\u5909\u5316\u3059\u308b\u3002\n\n# \u73fe\u5728\u306e\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0 R \u3068\u3000\u76ee\u6307\u3057\u305f\u3044\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0 G \u3092\u5165\u529b\nR = int(input())\nG = int(input())\n# print(R, G)\n\n# \u3068\u308b\u3079\u304d\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9 \u3092 x \u3068\u3059\u308b\u3068\u3001\n# \u76ee\u6307\u3057\u305f\u3044\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u3000G = (R+x)/2\u3000\n# \u4ee5\u4e0b\u5f0f\u5909\u63db\n# 2G = R + x\n# x = 2G - R\n\nx = (2 * G) - R\n# print(x)\n\n# \u7b54\u3048\u3092\u4ee3\u5165\nanswer = x\nprint(answer)\n", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nprint(b*2-a)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "def main():\n my_rate = int(input())\n avarage_rate = int(input())\n \n target_rate = (avarage_rate * 2) - my_rate\n \n print(target_rate)\n\ndef __starting_point():\n main()\n__starting_point()", "passed": true, "time": 0.23, "memory": 14244.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\nans = 2*G - R\nprint(ans)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\n\nprint((int(2 * g - r)))\n", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "print(-int(input()) + int(input()) * 2)", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "print(-int(input())+int(input())*2)", "passed": true, "time": 0.22, "memory": 14048.0, "status": "done"}, {"code": "r=int(input())\ng=int(input())\nprint(2*g-r)", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "# A - Rating Goal\n# https://atcoder.jp/contests/abc076/tasks/abc076_a\n\nR = int(input())\nG = int(input())\n\nprint((G * 2 - R))\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "r=int(input())\ng=int(input())\nprint(2*g-r)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "r=int(input())\nc=int(input())\nprint(2*c-r)", "passed": true, "time": 0.15, "memory": 14060.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\nprint((2 * g - r))\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "r=int(input())\ng=int(input())\nprint(g*2-r)", "passed": true, "time": 0.15, "memory": 14068.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint(G * 2 - R)", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\n\nprint(2*g - r)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "def main():\n r = int(input())\n g = int(input())\n\n x = 2 * g - r\n print(x)\n \n \nmain()", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\n\nprint((a+(b-a)*2))\n", "passed": true, "time": 0.23, "memory": 14312.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint(G*2-R)", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "print(-int(input()) + 2*int(input()))", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint((G * 2 - R))\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\n# (answer + R)/ 2 = G\n\nanswer = 2 * G -R\nprint(answer)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\nprint((2 * G) - R)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nrating = G * 2 - R\nprint(rating)", "passed": true, "time": 0.24, "memory": 14272.0, "status": "done"}, {"code": "# 076a\n\nR = int(input())\nG = int(input())\n\nB = G * 2 - R\nprint(B)\n", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\nprint(2*g-r)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint(2*G-R)", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "r=int(input())\ng=int(input())\nans=(g*2)-r\nprint((int(ans)))\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\nprint(2*G - R)", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "import bisect, collections, copy, heapq, itertools, math, string, sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = float('inf')\ndef I(): return int(input())\ndef F(): return float(input())\ndef SS(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LSS(): return input().split()\n\ndef resolve():\n R = I()\n G = I()\n\n ans = 2 * G - R\n print(ans)\n\ndef __starting_point():\n resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "# AtCoder abc076 a\n# \u30b9\u30c8\u30ec\u30c3\u30c1\u8ab2\u984c\n\n# \u5165\u529b\n# \u30df\u30b9\u3000r, g = map(int, input().split())\nr = int(input())\ng = int(input())\n\n# \u51e6\u7406\n# G = (R + answer) / 2 -> answer = 2G - R\nanswer = 2 * g - r\n\n# \u51fa\u529b\nprint(answer)\n", "passed": true, "time": 0.25, "memory": 14064.0, "status": "done"}, {"code": "# \u73fe\u5728\u306e\u30ec\u30fc\u30c8R\u3068\u30b3\u30f3\u30c6\u30b9\u30c8\u5f8c\u306e\u76ee\u6307\u3057\u305f\u3044\u30ec\u30fc\u30c8G\u3092\u5165\u529b\nR = int(input())\nG = int(input())\n# G\u306e2\u500d\u304b\u3089\u73fe\u5728\u306e\u30ec\u30fc\u30c8R\u3092\u5f15\u3044\u3066\u3001\u6b21\u306e\u30b3\u30f3\u30c6\u30b9\u30c8\u306e\u30ec\u30fc\u30c8\u3092\u51fa\u529b\nprint(G * 2 - R)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nsys.setrecursionlimit(10**6)\n\nr = int(input())\ng = int(input())\n\nprint((2*g-r))\n", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\nprint((G + (G - R)))\n", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\nprint(G * 2 - R)", "passed": true, "time": 0.22, "memory": 14160.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\nprint(r+2*(g-r))", "passed": true, "time": 0.23, "memory": 14264.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\nprint(2*g-r)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "# \u5165\u529b\nR = int(input())\nG = int(input())\n\n# \u51e6\u7406\nanswer = 2 * G - R\n\n# \u51fa\u529b\nprint(answer)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "R = int(input())\nG = int(input())\n\nprint(2 * G - R)", "passed": true, "time": 0.15, "memory": 14272.0, "status": "done"}, {"code": "# \u5165\u529b\nR = int(input())\nG = int(input())\n\n# (R+G)/2=X X=2G-R\nperformance = G * 2 - R\n\n# \u51fa\u529b\nprint(performance)", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\n\nprint(2 * g - r)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nprint(a+(b-a)*2)", "passed": true, "time": 0.15, "memory": 14068.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\nperformance = 2 * g - r\nprint(performance)", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "r,g=int(input()),int(input())\nprint(2*g-r)", "passed": true, "time": 0.14, "memory": 14028.0, "status": "done"}, {"code": "r = int(input())\ng = int(input())\nprint(g*2 - r)", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "R=int(input())\nG=int(input())\nprint((G*2-R))\n", "passed": true, "time": 0.13, "memory": 14160.0, "status": "done"}]
[{"input": "2002\n2017\n", "output": "2032\n"}, {"input": "4500\n0\n", "output": "-4500\n"}]