problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p03701 | u075303794 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['import sys\n\nN=int(input())\nS=[int(input()) for _ in range(N)]\nS.sort()\n\nans=sum(S)\n\nif ans%10!=0:\n print(ans)\n sys.exit()\nelse:\n for i in range(N):\n if S[i]%10!=0:\n print(ans-S[i])\n else:\n print(0)', 'import sys\n \nN=int(input())\nS=[int(input()) for _ in range(N)]\nS.sort()\n \nans=su... | ['Wrong Answer', 'Accepted'] | ['s532367736', 's995653620'] | [9180.0, 8992.0] | [32.0, 29.0] | [212, 232] |
p03701 | u117182712 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ["import sys\n\nimport math\n\n\nclass Solution(object):\n def __init__(self):\n self.N, self.A, self.B = map(int, sys.stdin.readline().split(' '))\n self.h = []\n for _ in range(self.N):\n self.h.append(int(sys.stdin.readline()))\n self.extra_damage = self.A - self.B\n\n de... | ['Runtime Error', 'Accepted'] | ['s293828147', 's716004981'] | [3064.0, 3064.0] | [18.0, 17.0] | [1251, 811] |
p03701 | u120026978 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['n = int(input())\ns = [int(i) for i in range(n)]\n\ns.sort()\nans = sum(s)\nif ans % 10 != 0:\n print(ans)\nelse:\n for i in range(n):\n if s[i] % 10 != 0:\n print(ans - s[i])\n break\n else:\n print(0)', 'n = int(input())\ns = [int(input()) for i in range(n)]\n\ns.sort()\... | ['Wrong Answer', 'Accepted'] | ['s673247639', 's116672734'] | [3060.0, 3060.0] | [24.0, 17.0] | [234, 240] |
p03701 | u177481830 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['N=int(input())\ns_arr=np.zeros(N, dtype=np.int8)\nfor i in range(N):\n s_arr[i]=int(input())\n\ntotal=np.sum(s_arr)\nif total%10!=0:\n print(total)\nelse:\n msk=(s_arr%10!=0)\n if np.sum(msk)==0:\n print(0)\n else:\n print(total-np.min(s_arr[msk]))', 'import numpy as np\n\nN=int(input())\... | ['Runtime Error', 'Accepted'] | ['s816069261', 's940943354'] | [3060.0, 14424.0] | [17.0, 151.0] | [264, 284] |
p03701 | u301043830 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['import sys\n\nN = int(input())\ns = list()\nfor i in range(N):\n\ts.append(int(input()))\n\ns.sort(reverse=True)\n\nprint(s)\n\npoint = sum(s)\nl = len(s)\ni = 0\n\nwhile i < l:\n\tif point % 10 != 0:\n\t\tprint(point)\n\t\tsys.exit()\n\tif not s == []:\n\t\tfor x in reversed(list(s)):\n\t\t\tif not x % 10 == 0:\n\t\... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s590302934', 's854868438', 's907797010', 's634487205'] | [3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 17.0, 17.0, 18.0] | [341, 256, 266, 331] |
p03701 | u330544393 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | [' sum_ = sum(s)\n if (sum_ % 10) != 0:\n return sum_\n else:\n st = sorted(s)\n m = 0\n for i in range(len(st)):\n s2 = sum(s[:i-1]+s[i+1:])\n if (s2 % 10) != 0:\n return s2\n\n for i in range(len(st)):\n s2 = sum(s[:i-1]+s[i+2... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s058831827', 's093866099', 's143116612', 's678241814', 's909104926', 's514609755'] | [2940.0, 3060.0, 3064.0, 3060.0, 3064.0, 3924.0] | [17.0, 21.0, 17.0, 32.0, 17.0, 59.0] | [477, 414, 505, 498, 562, 533] |
p03701 | u346308892 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['\nN=input()\nscores=[]\nwhile True:\n try:\n scores.append(int(input()))\n except:\n break\n\n\nscores=sorted(scores)\n\nres=0\nfor i,e in enumerate(scores):\n if e%10!=0:\n res=e\n break\n\nprint(res)', 'N=input()\nscores=[]\nwhile True:\n try:\n scores.append(int(input... | ['Wrong Answer', 'Accepted'] | ['s158727322', 's485412157'] | [3060.0, 3064.0] | [17.0, 17.0] | [220, 328] |
p03701 | u390618988 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ["from sys import stdin, exit\n\nN = int(stdin.readline().rstrip())\ns = [int(stdin.readline().rstrip()) for _ in range(N)]\ndp = [0] * (100 * N)\ndp[0] = 1\nfor n in range(N):\n for p in range(len(dp), 0, -1):\n if p - s[n] >= 0\n if dp[p - s[n]] == 1:\n dp[p] = 1\nfor k in range(le... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s397485759', 's766114169', 's985350747'] | [2940.0, 8308.0, 3064.0] | [17.0, 1071.0, 304.0] | [437, 474, 453] |
p03701 | u410717334 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['N=int(input())\ns=[int(input()) for _ in range(N)]\ndef cal(S,items):\n if(S&10!=0):\n return S\n temp=100000000\n for i in items:\n if(i%10!=0):\n temp=min(i,temp)\n return S-temp if(S-temp>0) else 0\nprint(cal(sum(s),s))', 'N=int(input())\ns=[int(input()) for _ in range(N)]\ndef... | ['Wrong Answer', 'Accepted'] | ['s390967750', 's879286096'] | [3064.0, 3060.0] | [18.0, 17.0] | [249, 249] |
p03701 | u481514236 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['N = int(input())\n\nlst = []\n\nfor i in range(N):\n lst.append(int(input()))\n\nlst.sort(reverse=True)\n\nlst2 = [ i / 10 for i in lst if i % 10 != 0 ]\np_list = []\n\nif len(lst2) == 0:\n print(0)\nelse:\n for i in range(N):\n for j in range(N):\n if i > N-j :\n break\n ... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s201284102', 's239227717', 's476062524', 's177164762'] | [3064.0, 3064.0, 1027992.0, 3060.0] | [18.0, 17.0, 2175.0, 18.0] | [509, 889, 900, 389] |
p03701 | u536113865 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['n = int(input())\ns = [int(input()) for i in range(n)]\nif sum(s)%10:\n print(sum(s))\nelse:\n for i in sorted(s):\n if i%10:\n print(sum(s)-i)\n break\n else:\n print(0', 'n = int(input())\ns = [int(input()) for i in range(n)]\nif sum(s)%10:\n print(sum(s))\nelse:\n ... | ['Runtime Error', 'Accepted'] | ['s645207405', 's770140915'] | [2940.0, 3060.0] | [17.0, 18.0] | [204, 205] |
p03701 | u545368057 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['n = sum(Ss)\n# INF = 10**10\ndp = [False] * (n+1)\ndp[0] = True\nfor i in range(N):\n x = Ss[i]\n for j in range(n+1):\n if j+x > n : continue \n dp[j+x] = dp[j] or dp[j+x]\n\nans = 0\nfor i in range(n+1):\n if dp[i] and i%10 != 0:\n ans = i\nprint(ans)', 'N = int(input())\nSs = [int(inp... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s309230349', 's646598608', 's794653742', 's903495030'] | [3064.0, 17236.0, 3060.0, 3436.0] | [19.0, 731.0, 17.0, 620.0] | [269, 441, 248, 443] |
p03701 | u608297208 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['import math\nN,A,B = map(int,input().split())\nH = [int(input()) for i in range(N)]\nHs = sum(H)\nc = A - B\nM = math.ceil(Hs / (B * N))\n\nm = math.ceil(Hs / (A * N))\n\nnibun = [M,m]\nwhile M - m > 1:\n\tn = (M + m) // 2\n\tH2 = [H[i] - n * B for i in range(N) if H[i] - n * B > 0]\n\tcnts = [math.ceil(H2[i] / c) fo... | ['Runtime Error', 'Accepted'] | ['s683701530', 's319941995'] | [3064.0, 3064.0] | [17.0, 17.0] | [386, 220] |
p03701 | u620868411 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['# -*- coding: utf-8 -*-\nn = int(input())\ns = []\nfor _ in range(n):\n s.append(int(input()))\ns.sort()\na = sum(s)\n\nif a%10!=0:\n print(a)\n exit()\n\nfor i in range(n):\n if s[i]%10:\n continue\n a -= s[i]\n if a%10!=0:\n print(a)\n exit()\n\nprint(0)\n', '# -*- coding: utf... | ['Wrong Answer', 'Accepted'] | ['s639777856', 's544412910'] | [3060.0, 3060.0] | [18.0, 17.0] | [276, 279] |
p03701 | u626337957 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['N = int(input())\nnums=[int(input()) for _ in range(N)]\nsum_nums = sum(nums)\nMAX = 10*4\ndp = [0] * (MAX+1)\ndp[0] = 1\nfor num in nums:\n for i in range(MAX+1):\n if dp[i] == 1 and i + num <= MAX:\n dp[i+num] = 1\nans = 0\nfor i in range(MAX+1):\n if dp[i] == 1 and i%10 != 0:\n ans = i\nprint(ans)\n',... | ['Wrong Answer', 'Accepted'] | ['s789290166', 's319176889'] | [3064.0, 3064.0] | [18.0, 167.0] | [301, 289] |
p03701 | u714878632 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['n, a, b = [int(i) for i in input().split()]\nhs = [None]*n\nkill_b = [None]*n\nall_hp = 0\nall_killb = 0\nfor i in range(n):\n hs[i] = int(input())\n # all_hp += hs[i]\n # kill_b[i] = hs[i] // b\n # if((hs[i] % b) != 0):\n # kill_b[i] += 1\n # all_killb += kill_b[i]\n# hs.sort()\nmax_hp = max(hs... | ['Runtime Error', 'Accepted'] | ['s172421517', 's085897603'] | [3064.0, 3060.0] | [17.0, 20.0] | [1211, 278] |
p03701 | u746419473 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['n = int(input())\n*s, = sorted([int(input()) for _ in range(n)], reverse=True)\n\nans = sum(s)\nif ans%10 == 0:\n for _s in s:\n if _s%10 != 0:\n print(ans-_s)\n quit()\n print(0)\nelse:\n print(ans)\n', 'n = int(input())\n*s, = sorted([int(input()) for _ in range(n)])\n\nans = s... | ['Wrong Answer', 'Accepted'] | ['s750002621', 's897925120'] | [2940.0, 2940.0] | [17.0, 17.0] | [227, 213] |
p03701 | u764782120 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['# -*- coding:utf-8 -*-\n\nN = int(input())\ns = [int(input()) for i in range(N)]\ns.sort()\n\nsum = 0\nfor i in range(N):\n\tsum = sum + int(s[i])\n\nj = 0\nfor i in range(N+1):\n\tif sum % 10 != 0:\n\t\tprint("answer: " + str(sum))\n\t\tbreak\n\telif j < N:\n\t\tsum = sum - int(s[j])\n\t\tj = j + 1\n\telif sum == 0:... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s016269755', 's037758745', 's154727153', 's174726026', 's816228338', 's849256856', 's891754057', 's940223061'] | [3060.0, 3064.0, 3064.0, 3060.0, 3316.0, 3060.0, 3060.0, 3060.0] | [18.0, 17.0, 18.0, 18.0, 25.0, 17.0, 17.0, 17.0] | [315, 301, 412, 327, 317, 299, 292, 307] |
p03701 | u765237551 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['import heapq\nfrom collections import Counter\nimport math\n\nn, a, b = map(int, input().split())\nhs = map(int, (input() for _ in range(n)))\ncounter = [[-x, c] for x, c in Counter(hs).items()]\n\ncum = 0\np = 0\n\nheapq.heapify(counter)\n\ndef f(m, c, a, b):\n ans = 0\n ans += math.floor(m / (a + b*(c-1))) * ... | ['Runtime Error', 'Accepted'] | ['s685656118', 's163116710'] | [3316.0, 3060.0] | [21.0, 18.0] | [870, 240] |
p03701 | u780475861 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['import sys\nn, *lst = map(int, sys.stdin.read().split())\nres = sum(lst)\nif not res % 10:\n tmp = [i if not i % 10 for i in lst]\n if tmp:\n res -= min(tmp)\n else:\n res = 0\nprint(res)\n ', 'import sys\nn, *lst = map(int, sys.stdin.read().split())\nres = sum(lst)\nif not res % 10:\n tmp = [i for i in ls... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s320752777', 's951854031', 's745340218'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [190, 191, 187] |
p03701 | u785205215 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['from sys import stdin\ndef readLine_int_list():return list(map(int, stdin.readline().split()))\ndef readAll_int(): return list(map(int, stdin))\n\n \ndef main():\n n = int(input())\n s = sorted(readAll_int())\n ans = sum(s)\n \n if ans % 10 == 0:\n for i in range(n):\n if i % 2 !=... | ['Wrong Answer', 'Accepted'] | ['s746996794', 's958611803'] | [3060.0, 3060.0] | [17.0, 17.0] | [498, 523] |
p03701 | u803848678 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['n = int(input())\ns = []\n\ngeta = 0\nfor i in range(n):\n a = int(input())\n if a % 10 == 0:\n geta += a\n else:\n s.append(a)\n\ns.sort(reverse=True)\n\ntmp = sum(s)\n\nruiseki = [tmp]\nfor i in range(n-1):\n ruiseki.append(ruiseki[-1] - s[i])\n\nans = 0\ndef DFS(depth, now):\n global a... | ['Runtime Error', 'Accepted'] | ['s384789333', 's796629421'] | [3064.0, 3060.0] | [18.0, 18.0] | [543, 215] |
p03701 | u936985471 | 2,000 | 262,144 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | ['n=int(input())\ns=[None]*n\nminv=100\nfor in range(n):\n s[i]=int(input())\n if minv>s[i]:\n if s[i]%10!=0:\n minv=s[i]\nif minv==100:\n print(0)\nelif sum(s)%10==0:\n print(sum(s)-minv)\nelse:\n print(sum(s))\n\n', 'n=int(input())\ns=[None]*n\nminv=100\nfor i in range(n):\n s[i]=int(input())\n if minv... | ['Runtime Error', 'Accepted'] | ['s381122334', 's480175700'] | [2940.0, 3060.0] | [17.0, 17.0] | [211, 213] |
p03702 | u039623862 | 2,000 | 262,144 | You are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called _health_ , and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below. Fortunately, you are a skilled magician, capable of causing e... | ['n, a, b = map(int, input().split())\nextra_damage = a - b\nh = [int(input()) for i in range(n)]\n# h.sort()\nINF = sum(h)\nl = 0\nr = INF\n\n\ndef widespread(bomb):\n base = b * bomb\n for hi in h:\n if hi - base > 0:\n bomb -= (hi - base + extra_damage - 1) // extra_damage\n return bomb >=... | ['Wrong Answer', 'Accepted'] | ['s629721703', 's360006381'] | [7072.0, 7076.0] | [816.0, 829.0] | [422, 409] |
p03702 | u327466606 | 2,000 | 262,144 | You are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called _health_ , and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below. Fortunately, you are a skilled magician, capable of causing e... | ['N,A,B = map(int, input().split())\n\nH = [int(input()) for i in range(N)]\n\nlow = sum(H)//(len(H)*B+A-B) - 1\nhigh = max(H)//B+1\nprint(low, high)\n\nd = A-B\nceildiv = lambda x,y: -(-x//y)\n\nwhile low + 1 < high:\n mid = (low+high)//2\n offset = mid*B\n cnt = sum(max(ceildiv(h - offset, d),0) for h in H)\n if ... | ['Wrong Answer', 'Accepted'] | ['s579410607', 's648762992'] | [7072.0, 7072.0] | [1225.0, 742.0] | [363, 311] |
p03702 | u572144347 | 2,000 | 262,144 | You are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called _health_ , and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below. Fortunately, you are a skilled magician, capable of causing e... | ['N,A,B=map(int,input().split())\nH=[inp(input()) for _ in range(N)]\nH=sorted(H,reverse=True)\n\nok=max(H)//B+1\nng=0\nmid=(ok+ng)//2\nwhile ok-ng>1:\n cntlive=0\n for h in H:\n h-=B*mid\n if h>0:\n cntlive+=1\n if cntlive<=mid:\n ok=mid\n else:\n ng=mid\n mid=(ok+ng)//2\nprint(ok)', 'N,A,B=map(i... | ['Runtime Error', 'Accepted'] | ['s321583295', 's705693053'] | [3064.0, 8280.0] | [18.0, 1455.0] | [285, 301] |
p03702 | u608297208 | 2,000 | 262,144 | You are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called _health_ , and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below. Fortunately, you are a skilled magician, capable of causing e... | ['import math\nN,A,B = map(int,input().split())\nH = [int(input()) for i in range(N)]\nHs = sum(H)\nc = A - B\nM = math.ceil(max(H) / B) + 1\n\nm = math.ceil(max(H) / A)\n\nwhile M - m > 1:\n\tn = (M + m) // 2\n\tH2 = [math.ceil((H[i] - n * B) / c) for i in range(N) if H[i] - n * B > 0]\n\tcnt = sum(H2)\n\tif cnt > n:\... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s131603414', 's325652046', 's995545004', 's286752458'] | [15216.0, 15216.0, 19060.0, 15232.0] | [1355.0, 1352.0, 1592.0, 1345.0] | [364, 360, 398, 350] |
p03702 | u714878632 | 2,000 | 262,144 | You are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called _health_ , and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below. Fortunately, you are a skilled magician, capable of causing e... | ['n, a, b = [int(i) for i in input().split()]\nhs = [None]*n\nkill_b = [None]*n\nall_hp = 0\nall_killb = 0\nfor i in range(n):\n hs[i] = int(input())\n # all_hp += hs[i]\n # kill_b[i] = hs[i] // b\n # if((hs[i] % b) != 0):\n # kill_b[i] += 1\n # all_killb += kill_b[i]\n# hs.sort()\nmax_hp = max(hs... | ['Wrong Answer', 'Accepted'] | ['s079678326', 's752635893'] | [7796.0, 7924.0] | [1951.0, 1909.0] | [1400, 649] |
p03702 | u766407523 | 2,000 | 262,144 | You are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called _health_ , and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below. Fortunately, you are a skilled magician, capable of causing e... | ['N, A, B = map(int, input().split())\nsrc = [int(input()) for i in range(N)]\n\ndef enough(n):\n bomb = 0\n for h in src:\n if h <= B*n: continue\n h -= B*n\n bomb -= (h-1)//(A-B) + 1\n if bomb > n: return False\n return True\n\n\nng = 0\nok = 10**9\nwhile ok - ng > 1:\n m = (ok... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s088970344', 's735347214', 's816271896', 's234984411'] | [7072.0, 2940.0, 7072.0, 7072.0] | [1099.0, 17.0, 1118.0, 890.0] | [426, 430, 413, 426] |
p03702 | u890165321 | 2,000 | 262,144 | You are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called _health_ , and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below. Fortunately, you are a skilled magician, capable of causing e... | ['N, A, B = map(int, input().split())\nD = A - B\n\nH = sorted([int(input()) for _ in range(N)], reverse=True)\n\ndef f(n):\n needed_attacks = 0\n for h in H:\n r = h - B * n\n if r < 0:\n r = 0\n\n if r % D == 0:\n needed_attacks += r // D\n else:\n ne... | ['Wrong Answer', 'Accepted'] | ['s161346935', 's339540569'] | [8284.0, 7076.0] | [873.0, 887.0] | [488, 467] |
p03702 | u937529125 | 2,000 | 262,144 | You are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called _health_ , and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below. Fortunately, you are a skilled magician, capable of causing e... | ['a,b,c = map(int, input().split())\nl = [int(input()) for _ in range(a)]\nflag = True\nl = sorted(l)\nmax_T = 10**18\ndef ok(k):\n s = k\n for i in l:\n hp = i - c * k\n if hp > 0:\n s -= -(-hp // (b - c))\n if s < 0:\n return False\n return True\ndef binary_search(l... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s250181604', 's415977464', 's665414353', 's199045459'] | [8280.0, 8280.0, 8280.0, 8280.0] | [228.0, 864.0, 224.0, 1387.0] | [521, 507, 538, 559] |
p03703 | u284854859 | 2,000 | 262,144 | You are given an integer sequence of length N, a = {a_1, a_2, …, a_N}, and an integer K. a has N(N+1)/2 non-empty contiguous subsequences, {a_l, a_{l+1}, …, a_r} (1 ≤ l ≤ r ≤ N). Among them, how many have an arithmetic mean that is greater than or equal to K? | ['import sys,bisect,math\ninput = sys.stdin.readline\n\n\ndef bitsum(bit,i):\n s = 0\n while i > 0:\n s += bit[i]\n i -= i&(-i)\n return s\n \n\ndef bitadd(bit,i,x):\n while i <= n:\n bit[i] += x\n i += i&(-i)\n return bit\n\nn,k = map(int,input().split())\na = [int(input()... | ['Wrong Answer', 'Accepted'] | ['s611280368', 's621597412'] | [43448.0, 36940.0] | [1302.0, 1397.0] | [943, 945] |
p03703 | u327466606 | 2,000 | 262,144 | You are given an integer sequence of length N, a = {a_1, a_2, …, a_N}, and an integer K. a has N(N+1)/2 non-empty contiguous subsequences, {a_l, a_{l+1}, …, a_r} (1 ≤ l ≤ r ≤ N). Among them, how many have an arithmetic mean that is greater than or equal to K? | ['class BinaryIndexedTree:\n def __init__(self, size):\n self.data = [0] * (size+1)\n self.size = size\n \n def add(self, i, w):\n while i <= self.size:\n self.data[i] += w\n i += i & -i\n\n def sum(self, i):\n result = 0\n while i > 0:\n result += self.data[i]\n i -= i & -i\n ... | ['Runtime Error', 'Accepted'] | ['s189276916', 's258389685'] | [3064.0, 39576.0] | [18.0, 1530.0] | [659, 674] |
p03703 | u332385682 | 2,000 | 262,144 | You are given an integer sequence of length N, a = {a_1, a_2, …, a_N}, and an integer K. a has N(N+1)/2 non-empty contiguous subsequences, {a_l, a_{l+1}, …, a_r} (1 ≤ l ≤ r ≤ N). Among them, how many have an arithmetic mean that is greater than or equal to K? | ["import sys\nfrom itertools import accumulate\n\ninf = 1<<60\nans = 0\n\ndef solve():\n n, k = map(int, sys.stdin.readline().split())\n a = [int(sys.stdin.readline().rstrip()) - k for i in range(n)]\n s = [0] + list(accumulate(a))\n\n print(ans)\n\ndef MergeSort(a):\n if len(a) == 1:\n return a\n... | ['Wrong Answer', 'Accepted'] | ['s045727812', 's333516064'] | [21936.0, 24548.0] | [150.0, 1201.0] | [814, 832] |
p03703 | u375616706 | 2,000 | 262,144 | You are given an integer sequence of length N, a = {a_1, a_2, …, a_N}, and an integer K. a has N(N+1)/2 non-empty contiguous subsequences, {a_l, a_{l+1}, …, a_r} (1 ≤ l ≤ r ≤ N). Among them, how many have an arithmetic mean that is greater than or equal to K? | ['import bisect\nfrom itertools import accumulate\n# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\n\ndef brute():\n N, K = map(int, input().split())\n L = [int(input()) for _ in range(N)]\n ans = 0\n for i in range(N):\n for j in range(i, N):\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s175756958', 's237641396', 's737364180'] | [3064.0, 23792.0, 33444.0] | [17.0, 2105.0, 1127.0] | [1355, 697, 932] |
p03703 | u839537730 | 2,000 | 262,144 | You are given an integer sequence of length N, a = {a_1, a_2, …, a_N}, and an integer K. a has N(N+1)/2 non-empty contiguous subsequences, {a_l, a_{l+1}, …, a_r} (1 ≤ l ≤ r ≤ N). Among them, how many have an arithmetic mean that is greater than or equal to K? | ['N, K = map(int, input().split())\na = []\nfor _ in range(N):\n a.append(int(input())-K)\n \nsu = 0\nv = [(0, 0)]\nfor i in range(N):\n su += a[i]\n v.append((su, i+1))\nv = sorted(v)\n\ndata = [0]*(N+1)\n\ndef sumation(i):\n s = 0\n while i > 0:\n s += data[i]\n i -= i & -i\n return... | ['Runtime Error', 'Accepted'] | ['s404948532', 's965348479'] | [41676.0, 41676.0] | [1321.0, 1478.0] | [460, 462] |
p03704 | u053547321 | 2,000 | 262,144 | For a positive integer n, we denote the integer obtained by reversing the decimal notation of n (without leading zeroes) by rev(n). For example, rev(123) = 321 and rev(4000) = 4. You are given a positive integer D. How many positive integers N satisfy rev(N) = N + D? | ['def recursion(length, ll, string, cc):\n if ll * 2 < length:\n for i in range(10):\n string1 = string + str(i)\n recursion(length, ll+1, string1, cc)\n else:\n number = str(int(string) + int(cc[-ll:]))\n ds = ""\n for i in range(length // 2):\n if i +... | ['Wrong Answer', 'Accepted'] | ['s350319511', 's449197040'] | [3064.0, 3064.0] | [894.0, 18.0] | [1094, 474] |
p03704 | u327466606 | 2,000 | 262,144 | For a positive integer n, we denote the integer obtained by reversing the decimal notation of n (without leading zeroes) by rev(n). For example, rev(123) = 321 and rev(4000) = 4. You are given a positive integer D. How many positive integers N satisfy rev(N) = N + D? | ['# (10-x) ways: (0,x)-(9-x,9) -> (x, -x)\n# (x) ways: (10-x,0)-(9,x-1) -> (x-10, 10 - x)\n\ndef solve(d, k, outer):\n if k <= 1:\n return (10 - outer)**k if d == 0 else 0\n\n tail = d % 10\n if d >= 10**k:\n return 0\n c = d+tail*10**(k-1)\n return (10-tail-outer)*solve(abs(c//10), k-2, 0) + (tail-outer)... | ['Wrong Answer', 'Accepted'] | ['s989481276', 's437989633'] | [3064.0, 3064.0] | [17.0, 18.0] | [456, 307] |
p03704 | u368780724 | 2,000 | 262,144 | For a positive integer n, we denote the integer obtained by reversing the decimal notation of n (without leading zeroes) by rev(n). For example, rev(123) = 321 and rev(4000) = 4. You are given a positive integer D. How many positive integers N satisfy rev(N) = N + D? | ['D = int(input())\n\ndef table(i, k):\n if i == k:\n return list(range(9, -1, -1)) + [0]*9\n else:\n return list(range(10, 0, -1)) + list(range(1, 10))\n\ndef nine(i):\n return 10**i - 1\n\ndef rec(d, i, k):\n res = 0\n num = table(i, k)\n if i == 1:\n for j in range(-9, 10):\n ... | ['Wrong Answer', 'Accepted'] | ['s876963237', 's805233100'] | [3064.0, 3064.0] | [19.0, 19.0] | [928, 900] |
p03705 | u002459665 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = list(map(int, input().split()))\n\nif A == B:\n ans = 1\nelif A > B:\n ans = 0\nelse:\n ans = 0\n\nprint(ans)', 'N, A, B = list(map(int, input().split()))\n\nif A > B:\n ans = 0\nelif A == B:\n ans = 1\nelif N == 1:\n ans = 0\nelse:\n mn = A + B + A * (N-2)\n mx = A + B + B * (N-2)\n... | ['Wrong Answer', 'Accepted'] | ['s435590917', 's880890839'] | [2940.0, 3060.0] | [17.0, 19.0] | [119, 208] |
p03705 | u017810624 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=map(int,input().split())\nif a>b:print(0)\nelif n==1 and a!=b:print(0)\nelse:print((n-2)*(b-a)+1)\u200b', 'n,a,b=map(int,input().split())\nif a>b or (n==1 and a!=b):print(0)\nelse:print((n-2)*(b-a)+1)'] | ['Runtime Error', 'Accepted'] | ['s120822040', 's134570689'] | [2940.0, 2940.0] | [17.0, 17.0] | [103, 91] |
p03705 | u018679195 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['a,b,c = map(int,input().split())\nif a<=1:\n if b==c:\n print(1)\n else:\n print(0)\nelif c>=b:\n print(0)\nelse:\n min = (a-1)*b+c\n max = (a-1)*c+b\n print(max-min+1)', "nums = input()\nnums = nums.split(' ')\nn = int(nums[0])\na = int(nums[1])\nb = int(nums[2])\nif n == 1:\n if a... | ['Wrong Answer', 'Accepted'] | ['s610269663', 's362942332'] | [3060.0, 3064.0] | [19.0, 17.0] | [189, 244] |
p03705 | u024340351 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\n\nif B< A:\n\tprint(0)\nelif B = A:\n\tprint(1)\nelif B-A+1 > N:\n\tprint(0)\nelse:\n\tprint((N-2)*B-(N-2)*A+1)', 'N, A, B = map(int, input().split())\n\nif A == B :\n\tprint(1)\n\texit()\n\nprint(max(B*(N-1)+A-(A*(N-1)+B)+1,0))'] | ['Runtime Error', 'Accepted'] | ['s288661291', 's081515787'] | [2940.0, 2940.0] | [17.0, 17.0] | [135, 105] |
p03705 | u026788530 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=[int(_) for_ in input().split()]\nif n==1:\n if a==b:\n print(1)\n else:\n print(0)\nprint(max(0,(n-2)*(b-a)+1)', 'n,a,b=[int(_) for _ in input().split()]\nif n==1:\n if a==b:\n print(1)\n else:\n print(0)\n exit()\nprint(max(0,(n-2)*(b-a)+1))\n'] | ['Runtime Error', 'Accepted'] | ['s357713762', 's626915715'] | [2940.0, 2940.0] | [17.0, 17.0] | [119, 131] |
p03705 | u030820165 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n, a, b = map(int, input().split())\nif (n == 1 and a == b):\n ans = 1\nelif (n == 1):\n ans = 0\nelif A > B:\n ans = 0\nelse:\n ans = (b - a) * (n - 2) + 1\nprint(ans)', 'n, a, b = map(int, input().split())\nif (n == 1 and a == b):\n ans = 1\nelif (n == 1):\n ans = 0\nelif a > b:\n ans = 0\nelse:\n ans = (b ... | ['Runtime Error', 'Accepted'] | ['s063802482', 's459685988'] | [9104.0, 9120.0] | [31.0, 29.0] | [163, 163] |
p03705 | u042802884 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N,A,B=map(int,input().split())\nprint((B-A)*N+1)', 'N,A,B=map(int,input().split())\nif N==1:\n if A==B:\n ans=1\n else:\n ans=0\nelif:\n if A>B:\n ans=0\n else:\n ans=(B-A)*(N-2)+1\nprint(ans)', 'N,A,B=map(int,input().split())\nif N==1:\n if A==B:\n ans=1\n else:\n... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s743427467', 's904780802', 's393400808'] | [3064.0, 2940.0, 2940.0] | [18.0, 17.0, 18.0] | [47, 169, 169] |
p03705 | u056358163 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\n\nif A > B:\n print(0)\nelif N == 1:\n if A == B:\n print(1)\n else:\n print(0)\nelse:\n ans = (B * (N - 1) + A) - (A * (N - 1) + B)\n print(ans)', 'N, A, B = map(int, input().split())\n\nif A > B:\n print(0)\nelif N == 1:\n if A == B:\n p... | ['Wrong Answer', 'Accepted'] | ['s997974472', 's290624944'] | [3060.0, 3060.0] | [18.0, 18.0] | [200, 204] |
p03705 | u062864034 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['import combinations from itertools\nn = [int(i) for i in input().split()]\nif n[0] == 1 and n[1] < n[2]:\n print(0)\nelif n[1]>n[2]:\n print(0)\nelif n[0] == 1 and n[1]==n[2]:\n print(1)\nelse:\n m = range(n[1],n[2]+1)\n c = list(combinations(m,n[0]-2))\n c.extend([(i,i) for i in m])\n print(len(... | ['Runtime Error', 'Accepted'] | ['s820669026', 's908347236'] | [2940.0, 3064.0] | [17.0, 17.0] | [331, 234] |
p03705 | u063052907 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\n\nif A > B:\n ans = 0\nelif N==1:\n ans = 1 if A==B else 0\nelse:\n sum_min = (N-1) * A\n sum_max = (N-1) * B\n ans = sum_max - sum_min + 1\n\nprint(ans)', 'N, A, B = map(int, input().split())\n\nif A > B:\n ans = 0\nelif N==1:\n ans = 1 if A==B else 0\nelse:\... | ['Wrong Answer', 'Accepted'] | ['s495080193', 's431422883'] | [3060.0, 3060.0] | [17.0, 17.0] | [194, 194] |
p03705 | u064408584 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=map(int, input().split())\nans=(n-2)*(b-a)*2\nif n==1:\n if a!=b:\n ans=0\n else:\n ans=1\nif b<a:ans=0\nprint(ans)', 'n,a,b=map(int, input().split())\nans=(n-2)*(b-a)*2+1\nif n==1:\n if a!=b:\n ans=0\n else:\n ans=1\nif b<a:ans=0\nprint(ans)', 'n,a,b=map(int, input().spl... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s506650377', 's567131835', 's411183966'] | [2940.0, 2940.0, 2940.0] | [17.0, 25.0, 17.0] | [133, 135, 133] |
p03705 | u075304271 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['import numpy as np\nimport math\nimport scipy\nimport itertools\n\ndef solve():\n n, a, b = map(int, input().split())\n print(max(b*(n-1)-a*(n-1)+1, 0))\n return 0\n\nif __name__ == "__main__":\n solve()\n\n', 'import numpy as np\nimport math\nimport scipy\nimport itertools\n\ndef solve():\n n, a, b = ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s121042947', 's403063245', 's550453692'] | [12504.0, 13004.0, 13132.0] | [160.0, 171.0, 170.0] | [206, 339, 343] |
p03705 | u135116520 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N,A,B=map(int,input().split())\nif A>B:\n print(0)\nif B-A>=1 and N==1:\n print(0)\nelse:\n print((B-A)**N+1)', 'N,A,B=map(int,input().split())\nif A<B:\n print(0)\nif N==1 and A!=B:\n print(0)\nelse:\n print((N-2)*(B-A)+1)', 'N,A,B=map(int,input().split())\nif A>B:\n print(0)\nelif N==1 and A!=B:\n print(0)\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s001090747', 's124668179', 's000514521'] | [9888.0, 2940.0, 2940.0] | [2104.0, 18.0, 17.0] | [106, 107, 109] |
p03705 | u136090046 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n, a, b = map(int, input().split())\ntmp = abs(b-a)+1\nif b < a or (n == 1 and b-a > 1):\n print(0)\nelse:\n if n == 1:\n print(1)\n else:\n print(tmp**(n-2) - tmp**2)', 'n, a, b = map(int, input().split())\n\nif a > b or (n == 1 and a != b):\n print(0)\nelse:\n print(((n-2)*(b-a))+1)'] | ['Wrong Answer', 'Accepted'] | ['s686499323', 's062063704'] | [10688.0, 2940.0] | [2104.0, 17.0] | [182, 115] |
p03705 | u189487046 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\n\nif A > B:\n print(0)\nelif N == 1 and A != B:\n print(0)\nelif N == 1 and A == B:\n print(1)\nelif N == 2 and A != B:\n print(1)\nprint(1000)\n', 'N, A, B = map(int, input().split())\n\nif A > B:\n print(0)\nelif N == 1 and A != B:\n print(0)\nelif N == 1 and A... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s228171922', 's863980232', 's165624101'] | [2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0] | [183, 193, 258] |
p03705 | u223646582 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\nprint(max(0, B*(N-1)+A-(A*(N-1)+B)))\n', 'N, A, B = map(int, input().split())\nprint(max(0, B*(N-1)+A-(A*(N-1)+B)+1))\n'] | ['Wrong Answer', 'Accepted'] | ['s390796343', 's934959114'] | [2940.0, 2940.0] | [18.0, 17.0] | [73, 75] |
p03705 | u227082700 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=map(int,input().split());n-=2\nif a>b:print(0)\nelse:print((b-a)*n)', 'n,a,b=map(int,input().split())\nif (n==1 and a!=b) or a>b:exit(print(0))\nmi=b+(n-1)*a\nma=a+(n-1)*b\nprint(ma-mi+1)\n'] | ['Wrong Answer', 'Accepted'] | ['s280549236', 's944175996'] | [2940.0, 2940.0] | [17.0, 17.0] | [71, 113] |
p03705 | u227476288 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['print(0)\n', 'N,A,B = map(int,input().split())\n\nn = B-A\nif A > B or n > N:\n print(0)\nelse:\n print(A+B*(N-1)-(A*(N-1)+B)+1)\n'] | ['Wrong Answer', 'Accepted'] | ['s885794120', 's088733283'] | [2940.0, 2940.0] | [17.0, 17.0] | [9, 115] |
p03705 | u228232845 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ["import sys\n\n\ndef input(): return sys.stdin.readline().strip()\ndef I(): return int(input())\ndef LI(): return list(map(int, input().split()))\ndef IR(n): return [I() for i in range(n)]\ndef LIR(n): return [LI() for i in range(n)]\ndef SR(n): return [S() for i in range(n)]\ndef S(): return input()\ndef LS(): return... | ['Wrong Answer', 'Accepted'] | ['s880062855', 's551855884'] | [9204.0, 9148.0] | [27.0, 24.0] | [500, 481] |
p03705 | u247554097 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['\n\nn, a, b = map(int, input().split())\nif n == 1 or b < a:\n print(0)\nelif n == 2 and a <= b:\n print(1)\nelse:\n minn = (n - 2) * a\n maxn = (n - 2) * b\n print(minn, maxn)\n print(maxn - minn + 1)\n', '\n\n\n\nn, a, b = map(int, input().split())\nif a == b and n == 1:\n print(1)\nelif b < a ... | ['Wrong Answer', 'Accepted'] | ['s278537233', 's755651137'] | [2940.0, 2940.0] | [18.0, 17.0] | [364, 459] |
p03705 | u254871849 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ["# 2019-11-22 16:25:33(JST)\nimport sys\n\n\ndef main():\n n, a, b = [int(x) for x in sys.stdin.readline().split()]\n\n\n if b > a:\n ans = 0\n elif a == b:\n ans = 1\n elif a > b:\n if n == 1:\n ans = 0\n else:\n min_possible = a * (n - 1) + b\n ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s650878537', 's726069169', 's531357243'] | [3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0] | [442, 442, 442] |
p03705 | u263933075 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=map(int,input().split())\nprint(n*b-n*a+1)', 'N=input()\nA=input()\nB=input()\nprint((2-N)(A-B))', 'n, a, b = map(int, input().split())\n\nmin_sum = a * (n - 1) + b\nmax_sum = b * (n - 1) + a\n\nprint(max(max_sum - min_sum + 1, 0))\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s063403245', 's846253981', 's157644779'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [47, 47, 127] |
p03705 | u270681687 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['a = int(input())\nb = int(input())\n\nif a == b:\n print(1)\n exit()\n\n\n\ndef bitlen(x):\n return 1 + bitlen(x >> 1) if x else 0\n\nt = a ^ b\nn = bitlen(t)\n\nT = 1 << (n - 1)\n\na = a & (T * 2 - 1)\nb = b & (T * 2 - 1)\n\nsb = b & (T - 1)\nb_max = (2 ** bitlen(sb) - 1) | T\n\nif (T + a) > b_max:\n pri... | ['Runtime Error', 'Accepted'] | ['s698291996', 's756658275'] | [3064.0, 3060.0] | [18.0, 17.0] | [580, 278] |
p03705 | u280978334 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N,A,B = map(int,input().split())\nmaxi = B*N\nmini = A*N\nif A > B:\n print(0)\nelif A == B:\n print(1)\nelse:\n print(maxi - mini)', 'N,A,B = map(int,input().split())\nmaxi = B*(N-1) + A\nmini = A*(N-1) + B\nif A > B:\n print(0)\nelif N == 0:\n print(0)\nelif A == B:\n print(1)\nelif N == 1:\n p... | ['Wrong Answer', 'Accepted'] | ['s858835457', 's413140740'] | [2940.0, 3060.0] | [17.0, 17.0] | [132, 204] |
p03705 | u288430479 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['s = input()\nl = len(s)\nsu = 0\nfor i in range(1,l-1):\n # print(su)\n if s[i]=="U":\n su += 1*(l-1-i)+2*(i)\n else:\n su += 1*(i)+2*(l-i-1)\nprint(su+2*(l-1))', 'import math \nn,a,b = map(int,input().split())\nif a>b:\n print(0)\n exit()\nif n==1 and a!=b:\n print(0)\n exit()\nif n==2:\n print(1)\n ex... | ['Wrong Answer', 'Accepted'] | ['s639562006', 's651888152'] | [3060.0, 3060.0] | [18.0, 18.0] | [159, 171] |
p03705 | u296518383 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N,A,B=map(int,input().split())\n\nif N==1:\n if A==B:\n print(1)\n else:\n print(0)\nelse:\n if A>B:\n print(0)\n else:\n sum_max=A+B+(N-2)*A\n sum_min=A+B+(N-2)*B\n print(sum_max-sum_min+1)', 'N,A,B=map(int,input().split())\n\nif N==1:\n if A==B:\n print(1)\n else:\n print(0)\nelse:\n ... | ['Wrong Answer', 'Accepted'] | ['s534810746', 's718641623'] | [3060.0, 3060.0] | [17.0, 17.0] | [199, 199] |
p03705 | u297651868 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b= list(map(int, input().split()))\nif a>b:\n print("0")\n exit(0)\nelse n==1:\n if a!=b:\n print("0")\n else:\n print("1")\n exit(0)\nn-=2;b-=a;a=0\nif n>=b:\n print(b*n+1)', 'n,a,b= list(map(int, input().split()))\nif a>b:\n print("0")\n exit(0)\nif n==1:\n if a!=b:\n ... | ['Runtime Error', 'Accepted'] | ['s450418125', 's835216473'] | [2940.0, 3060.0] | [17.0, 17.0] | [197, 182] |
p03705 | u306142032 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n, a, b = map(int, input().split())\n\nif n == 1:\n if a == b:\n print(1)\n else:\n print(0)\nelse:\n if a > b:\n print(0)\n else:\n print((b-a)(n-2)+1) \n', 'n, a, b = map(int, input().split())\n\nif n == 1:\n if a == b:\n print(1)\n else:\n print(0)... | ['Runtime Error', 'Accepted'] | ['s140525313', 's442765611'] | [2940.0, 2940.0] | [17.0, 17.0] | [190, 191] |
p03705 | u306412379 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\n\nif B < A:\n print(0)\nelif N == 1 and A!= B:\n print(0)\nelif N == 1 and A == B:\n print(1)\nelse:\n x = 1\n for i in range(B-A+1):\n x *= B-A+1-i\n print(x)\n ', 'N, A, B = map(int, input().split())\n\nif B < A:\n print(0)\nelif N == 1 and A!= B:\n print(0)\nelif ... | ['Wrong Answer', 'Accepted'] | ['s125069163', 's083734454'] | [9616.0, 9016.0] | [2205.0, 27.0] | [198, 164] |
p03705 | u324549724 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n, a, b = map(int, input().split())\nif (a < b) print(0)\nelse print(b*(n-1)+a-a*(n-1)-b+1)\n', 'n, a, b = map(int, input().split())\nif (a < b) : print(0)\nelse : print(b*(n-1)+a-a*(n-1)-b+1)\n', 'n, a, b = map(int, input().split())\nif (a > b) : print(0)\nelif (n == 1) :\n if (a == b) : print(1)\n else : print(0)... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s032790012', 's938541947', 's190084771'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [90, 94, 145] |
p03705 | u341087021 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef FI(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef I(): return int(sys.stdin.readline())\ndef ... | ['Runtime Error', 'Accepted'] | ['s436411245', 's072941740'] | [2940.0, 7232.0] | [18.0, 64.0] | [501, 502] |
p03705 | u363610900 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\n\ncnt = 0\n\nif A > B:\n print(0)\nelif N == 1:\n if A == B:\n print(1)\n else:\n print(0)\nelse:\n print((B-A)(N-2)+1)', 'N, A, B = map(int, input().split())\n\nif A > B:\n print(0)\nelif N == 1:\n print(0)\n\nelse:\n print((B-A)(N-2)+1)', 'N, A... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s530570421', 's966769320', 's815893660'] | [3060.0, 3060.0, 3060.0] | [18.0, 17.0, 18.0] | [170, 116, 127] |
p03705 | u370721525 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\n\nif N==1 and A==B:\n ans = 1\nelif N==1:\n ans = 0\nelif A > B:\n ans = 0\nelse:\n ans = (B-A) * (N-2) + 1', 'N, A, B = map(int, input().split())\n\nif N==1 and A==B:\n ans = 1\nelif N==1:\n ans = 0\nelif A > B:\n ans = 0\nelse:\n ans = (B-A) * (N-2) + 1\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s489828481', 's371638971'] | [9020.0, 9092.0] | [26.0, 27.0] | [139, 150] |
p03705 | u382423941 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n, a, b = map(int, input().split())\n\nif a > b or n < 1 or not (n == 1 and a == b):\n print(0)\nelse:\n ma, mi = b * (n-1) + a, a * (n - 1) + b\n print(ma - mi + 1)\n', 'n, a, b = map(int, input().split())\n\nif a > b or (n == 1 and a != b):\n print(0)\nelif a == b:\n print(1)\nelse:\n ma, mi = b *... | ['Wrong Answer', 'Accepted'] | ['s720458233', 's928943509'] | [2940.0, 2940.0] | [17.0, 17.0] | [169, 182] |
p03705 | u426964396 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n=input().slipt()\nprint(int(n[2]*(n[0]-2)-(n[1]*n[0]-2)+1))', 's=input().split();n,a,b=int(s[0]),int(s[1]),int(s[2])\nif a>b:\n print(0)\nelif n=1:\n if a==b:\n print(1)\n else:\n print(0)\nelse:\n print((a-b)*(n-2)+1)', 'n,a,b=map(int,input().split())\nif n>1 and b>=a or n==1 and a==b: \n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s447208304', 's471302588', 's875559547'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [59, 172, 115] |
p03705 | u443569380 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n, a, b = map(int, input().split())A\nprint((b - a) * (n - 2) + 1)\n', 'n, a, b = map(int, input().split())\nx = a * n - a + b\ny = b * n - b + a\n\n\nif a > b:\n print(0)\nelif a == b and n == 1:\n print(1)\nelif a != b and n == 1:\n print(0)\nelse:\n print(y - x + 1)\n'] | ['Runtime Error', 'Accepted'] | ['s414896823', 's409473799'] | [2940.0, 2940.0] | [17.0, 17.0] | [66, 198] |
p03705 | u463655976 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\n\nN -= 1\nif A != B:\n N -= 1\n\nif N < 0:\n ans = 0\nelse:\n M = B - A\n ans = 1\n for k, m in zip(range(M + N, 0, -1), range(1, N+1)):\n ans *= k\n ans //= m\n\nprint(ans)\n', 'N, A, B = map(int, input().split())\n\nN -= 1\nif A != B:\n N -= 1\nif A > B:\n N = -1\n\... | ['Wrong Answer', 'Accepted'] | ['s302223462', 's703972430'] | [3444.0, 2940.0] | [2103.0, 17.0] | [207, 145] |
p03705 | u518064858 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=map(int,input().split())\nif a>b:\n print(0)\n exit()\nelif n=1 and a!=b:\n print(0)\n exit()\nprint((b-a)*(n-2)+1)\n', 'n,a,b=map(int,input().split())\nif a>b:\n print(0)\n exit()\nelif n==1 and a!=b:\n print(0)\n exit()\nprint((b-a)*(n-2)+1)\n'] | ['Runtime Error', 'Accepted'] | ['s140572839', 's933598743'] | [2940.0, 3316.0] | [17.0, 19.0] | [127, 128] |
p03705 | u533039576 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n, a, b = map(int, input().split())\n\nif n == 1 and a != b:\n ans = 0\nelse:\n ans = (b * (n - 1) + a) - (a * (n - 1) + b)\n\nprint(ans)\n', 'n, a, b = map(int, input().split())\n\nif n == 1 and a != b:\n ans = 0\nelif b < a:\n ans = 0\nelse:\n ans = (b * (n - 1) + a) - (a * (n - 1) + b) + 1\n\nprint(... | ['Wrong Answer', 'Accepted'] | ['s691356838', 's968367563'] | [9084.0, 9152.0] | [27.0, 29.0] | [137, 165] |
p03705 | u554720358 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['#!/ust/bin/env python\n\nN,A,B=[int(i) for i in input().split()]\n\ndef sum(count, num):\n tmp=0\n for i in range(0, count):\n tmp+=num\n print("tmp",tmp)\n return tmp\n\nMax=(A+B)+sum(N-2, B)\nMin=(A+B)+sum(N-2, A)\n\nif(A>B):\n print(0)\nelif(A==B):\n print(1)\nelif(N==1):\n print(0)\nel... | ['Wrong Answer', 'Accepted'] | ['s973204736', 's527730353'] | [3064.0, 3064.0] | [2103.0, 17.0] | [393, 387] |
p03705 | u572144347 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b = map(int, input().split())\n\nif n == 1 and a == b:\n print(1)\nelif n == 1:\n print(0)\nelif a > b:\n print(0)\nelif n == 2:\n print(1)\nelif n > 2:\n print( (B-A+1) * (n-2) )', 'n,a,b = map(int, input().split())\n\nif n == 1 and a == b:\n print(1)\nelif n == 1:\n print(0)\nelif a > b:\n print(0)\neli... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s455036098', 's853557314', 's887440645', 's637372919'] | [3060.0, 3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [177, 195, 195, 206] |
p03705 | u580362735 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ["N,A,B = map(int,input().split())\ndata = range(A,B+1)\nif N-2>=0:\n print( (B − A)(N − 2) + 1)\nelif N == 1:\n if A!=B:\n print('0')\n else:\n print('1')\nelse:\n print('0')", "N,A,B = map(int,input().split())\nif A>B:\n print('0')\nelif N == 1:\n if A!=B:\n print('0')\n else:\n print('1')\nelse:\n... | ['Runtime Error', 'Accepted'] | ['s943252398', 's601012604'] | [2940.0, 2940.0] | [17.0, 18.0] | [177, 144] |
p03705 | u582763758 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ["n,a,b=list(map(int,input().split(' ')))\nprint(max(0,n-2)*max(0,b-a+1))\n", "n,a,b=list(map(int,input().split(' ')))\nprint(max(0,n-2)*max(0,a-b)+1)", "n,a,b=list(map(int,input().split(' ')))\nif n == 1:\n print(1 if a==b else 0)\nelse:\n print((b-a)*(n-2)+1 if b >= a else 0)\n"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s067759808', 's944410443', 's172416320'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [71, 70, 127] |
p03705 | u597455618 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['s = input()\ns = list(s)\ns.sort()\nans = list("abc")\nif (s == ans):\n print("Yes")\nelse :\n print("No")', 'n, a, b = map(int, input().split())\nprint(max(0, (n-2)*b - (n-2)*a + 1))'] | ['Wrong Answer', 'Accepted'] | ['s699523009', 's576002147'] | [2940.0, 2940.0] | [18.0, 17.0] | [101, 72] |
p03705 | u623687794 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=map(int,input().split())\nif a>b:\n print(0)\nelif a==b:\n print(1)\nelse:\n if n <= 2:\n print(n-1)\n else:\n print((b-a)*(n-2)-1) ', 'n,a,b=map(int,input().split())\nif a>b:\n print(0)\nelif a==b:\n print(1)\nelse:\n if n <= 2:\n print(n-1)\n else:\n print((b-a)*(n-2)+1) \n'] | ['Wrong Answer', 'Accepted'] | ['s510382753', 's111544906'] | [3060.0, 2940.0] | [17.0, 17.0] | [139, 140] |
p03705 | u629350026 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=map(int,input().split())\nans=b*(n-1)+a-a*(n-1)-b\nif ans<=0:\n print(0)\nelse:\n print(ans)', 'n,a,b=map(int,input().split())\nans=b*(n-1)+a-a*(n-1)-b+1\nif ans<=0:\n print(0)\nelse:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s318923850', 's008339212'] | [2940.0, 2940.0] | [17.0, 17.0] | [95, 97] |
p03705 | u637175065 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]\ndef LF(): retur... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s106720835', 's581722351', 's822089362'] | [7752.0, 7880.0, 6732.0] | [87.0, 189.0, 88.0] | [718, 751, 743] |
p03705 | u640922335 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N,A,B=map(int,input().split())\nif A>B:\n print(0)\nelif A==B:\n print(1)\nelse:\n if N==1:\n print(0)\n else:\n print((B*N-A*N)+1)', 'N,A,B=map(int,input().split())\nif A>B:\n print(0)\nelif A==B:\n print(1)\nelse:\n if N==1:\n print(0)\n else:\n print((B*(N-2)-A*(... | ['Wrong Answer', 'Accepted'] | ['s637550625', 's633047174'] | [9116.0, 9100.0] | [29.0, 29.0] | [148, 156] |
p03705 | u649326276 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['s = input().split(" ");\nn = s[0];\na = s[1];\nb = s[2];\nif a > b :\n print(0);\nelse\n if n = 1 or n = 2:\n print(1);\n else\n ans = (b - a)*(n - 2)+1;\n print(ans);', 's = input().split(" ");\nn = int(s[0]);\na = int(s[1]);\nb = int(s[2]);\nif a > b :\n print(0);\nelse :\n if n == 1 :\n if a==b :\... | ['Runtime Error', 'Accepted'] | ['s170524310', 's511102651'] | [2940.0, 3060.0] | [17.0, 17.0] | [168, 223] |
p03705 | u652656291 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b = map(int,input().split())\nif n == 1 :\n print(1)\nelse:\n if (b-a) >= 1:\n print((b+b+a)-(b+a+a)+1)\n else:\n print(0)\n', 'n,a,b = list(map(int, input().split()))\nprint(max(0, (b-a)*(n-2)+1))\n'] | ['Wrong Answer', 'Accepted'] | ['s258148931', 's601044003'] | [2940.0, 2940.0] | [17.0, 17.0] | [129, 69] |
p03705 | u655048024 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b = map(int,input().split())\nif(a>b):\n print(0)\nelse:\n if(n = 1):\n if(a!=b):\n print(0)\n else:\n print(1)\n else:\n print(b*(n-1)+a-(a*(n-1)+b)+1)\n ', 'n,a,b = map(int,input().split())\nk = a - b + n\nans = 1\nfor i in range(n):\n ans *= (k-i)\nfor i in range(n):\n ans = ans//(n-i... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s366910264', 's449504750', 's703677008', 's785817371', 's827750507'] | [8904.0, 9624.0, 9544.0, 9568.0, 9000.0] | [24.0, 2206.0, 2206.0, 2206.0, 28.0] | [171, 142, 146, 145, 173] |
p03705 | u665038048 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n, a, b = map(int, input().split())\nmin_a_b = a * (n-1) + b\nmax_a_b = a + n * (n-1)\nprint(max_a_b - min_a_b + 1)', 'n, a, b = map(int, input().split())\nmin_a_b = a * (n-1) + b\nmax_a_b = a + b * (n-1)\nprint(max(0, max_a_b - min_a_b + 1))'] | ['Wrong Answer', 'Accepted'] | ['s330760462', 's488098678'] | [2940.0, 2940.0] | [17.0, 17.0] | [112, 120] |
p03705 | u667084803 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['A=int(input())\nB=int(input())\nS=[]\ntimes=len(format(A^B,"b"))\nfor i in range(A,B+1):\n S+=[i]\nD=S[:] \nSET=set(S)\n#for t in range(times):\nfor i in range(len(S)):\n for j in range(len(D)):\n S+=[S[i]|D[j]]\n SET.add(S[i]|D[j])\nprint(len(SET))', 'N,A,B=map(int, input().split())\n\nif A>B:\n print(0)\ne... | ['Runtime Error', 'Accepted'] | ['s355368919', 's854570838'] | [3064.0, 3316.0] | [18.0, 22.0] | [261, 164] |
p03705 | u672475305 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b = map(int,input().split())\nif n==1:\n if a==b:\n print(1)\n else:\n print(0)\nelse:\n if b-a < 0:\n print(0)\n elif k==1:\n print(1)\n else:\n print(b*k - a*k+1)', 'n,a,b = map(int,input().split())\nif n==1:\n if a==b:\n print(1)\n else:\n print(0)\nelse:\n k = b-a\n if k < 0:\n ... | ['Runtime Error', 'Accepted'] | ['s592438666', 's438133344'] | [3060.0, 3060.0] | [17.0, 17.0] | [176, 186] |
p03705 | u693933222 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n, a, b = map(int, input().split())\n\nif (a < b):\n print(0)\nelif (n == 1):\n if (a != b):\n print(0)\n else:\n print(1)\nelse:\n mx = a + b * (n - 1)\n mn = a * (n - 1) + b\n print(mx-mn+1)\n', 'n, a, b = map(int, input().split())\n\nif (a < b):\n print(0)\nelif (n == 1):\n pr... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s471194206', 's750873119', 's196707013'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [213, 165, 213] |
p03705 | u699944218 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = list(map(int,input().split()))\nif (B * (N-1) + A) - (B + (N-1) * A) <= 0:\n print(0)\nelif A == B:\n print(1)\nelse:\n print((B * (N-1) + A) - (B + (N-1) * A))', 'N, A, B = list(map(int,input().split()))\nif A > B:\n print(0)\nelif A == B:\n print(1)\nelse:\n print((B * (N-1) + A) - (B + (N-1) * A))'... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s216054050', 's809202153', 's854308624'] | [3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0] | [167, 134, 170] |
p03705 | u713627549 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['s = list(input())\n\nz = 0\n\nfor i in s:\n if s[i] == "U":\n z += (len(s) - i)*1 + i * 2\n else:\n z += (len(s) - i)*2 + i * 1\n\nprint(z)\n', 's = list(input())\n\ncount = 0L\n\nfor i in range(len(s)):\n for j in range(len(s)):\n #print(i, j)\n if (i < j and s[i] == "D") or (i >... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s390242515', 's816868487', 's841367162', 's031656958'] | [2940.0, 2940.0, 3060.0, 3188.0] | [18.0, 18.0, 18.0, 18.0] | [150, 292, 270, 135] |
p03705 | u723721005 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n = int(input())\na = int(input())\nb = int(input())\nprint((b - a) * (n - 2) + 1)', 'c=int(input()),a=int(input()),b=int(input())\nprint((a+b*c-b)-(a*c-a+b)+1)', '\n\nusing namespace std;\nll n,a,b;\nint main(){\n cin>>n>>a>>b;\n cout<<(b*(n-2)-a*(n-2)+1);\n return 0;\n}', '\nusing namespace std;\nint main(... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s085770870', 's099841369', 's427931612', 's556396597', 's040879585'] | [2940.0, 2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 17.0, 19.0] | [79, 73, 147, 193, 126] |
p03705 | u740284863 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b = map(int,input().split())\nif a > b:\n print(0)\nelif a == b:\n print(1)\nelse:\n print((n - 2) * (b - a) + 1))', 'n,a,b = map(int,input().split())\nif a > b:\n print(0)\nelif a == b:\n print(1)\nelse:\n pritn((n - 2) * (b - a) + 1)', 'n,a,b = map(int,input().split())\nprint(max(0,(n - 2) * (... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s074439959', 's445757488', 's660080439'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0] | [121, 120, 68] |
p03705 | u760171369 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\nif N == 1:\n if A == B:\n print(1)\n else:\n print(0)\nelse:\n if A > B:\n print(0)\n elif A == B or N == 2:\n print(1)\n else:\n print((B-A) * (N-2))\n ', 'N, A, B = map(int, input().split())\nif N == 1:\n if A == B:\n print(1)\n else:\n print(0)\nels... | ['Wrong Answer', 'Accepted'] | ['s942545662', 's555361810'] | [3064.0, 3060.0] | [17.0, 18.0] | [198, 199] |
p03705 | u760961723 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int,input().split())\n\n\nif N == 1:\n if A==B:\n print(1)\n else:\n print(0)\nelse:\n ans = (B*(N-1)+A)-(A*(N-1)+B)\n if ans > 0:\n print(ans)\n else:\n print(0)', 'N, A, B = map(int,input().split())\n\n\nif N == 1:\n if A==B:\n print(1)\n else:\n print(0)\nelse:\n ans = (B*(N... | ['Wrong Answer', 'Accepted'] | ['s503513940', 's081744569'] | [9180.0, 9016.0] | [28.0, 29.0] | [180, 183] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.