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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03105 | u834248129 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A, B, C = map(int, input().split())\n\nif B >= A*C:\n print(A*C)\nelse:\n print(B//A)', 'A, B, C = map(int, input().split())\n\nif B >= A*C:\n print(C)\nelse:\n print(B//A)'] | ['Wrong Answer', 'Accepted'] | ['s280066681', 's196712209'] | [2940.0, 2940.0] | [17.0, 18.0] | [86, 84] |
p03105 | u837544459 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a, b, c = map(int, input().split())\nprint(min(n//a, c))', 'a, b, c = map(int, input().split())\nprint(min(a//b, c))', 'a, b, c= map(int, input().split())\nprint(min(a//b, c)', 'a, b, c = map(int, input().split())\nprint(min(b//a, c))'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s286881412', 's429065154', 's553537809', 's210530740'] | [9068.0, 8904.0, 8912.0, 8980.0] | [31.0, 33.0, 27.0, 28.0] | [55, 55, 53, 55] |
p03105 | u842388336 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A,B,C = map(int,input().split())\nprint(min(B//A),C)', 'A,B,C = map(int,input().split())\nprint(min(B//A,C))'] | ['Runtime Error', 'Accepted'] | ['s333949179', 's234362890'] | [2940.0, 2940.0] | [17.0, 20.0] | [51, 51] |
p03105 | u844789719 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A, B, C = [int(_) for _ in input().split()]\nprint(min([A // B, C]))\n', 'A, B, C = [int(_) for _ in input().split()]\nprint(min([B // A, C]))\n'] | ['Wrong Answer', 'Accepted'] | ['s174539202', 's920586834'] | [2940.0, 2940.0] | [19.0, 18.0] | [68, 68] |
p03105 | u845152373 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A, B, C = map(int, input().split())\nprint(max(C, B // A))', 'A, B, C = map(int, input().split())\nprint(min(C, B // A))\n'] | ['Wrong Answer', 'Accepted'] | ['s650682974', 's287425882'] | [2940.0, 2940.0] | [17.0, 17.0] | [57, 58] |
p03105 | u848654125 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a, b, c = [int(i) for i in input().split()]\n\nif a%b > c:\n print(c)\nelse:\n print(a%b)\n', 'import scipy as sp\n\n\ndef divisor(num):\n list = set()\n for i in sp.arange(1, num+1):\n if num % i == 0:\n list.add(i)\n return list\n\n\na, b, k = [int(i) for i in input().split()]\n\ndi... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s086999523', 's709636301', 's358318778'] | [2940.0, 13080.0, 2940.0] | [18.0, 172.0, 17.0] | [91, 308, 93] |
p03105 | u857130525 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['import sys\n\nfor line in sys.stdin:\n print(line.strip().split())', "import sys, math\n\nstdout_write = sys.stdout.write\n\nfor line in sys.stdin:\n a, b, c = (int(i) for i in line.strip().split())\n ans = min(int(math.floor(b / a)), c)\n stdout_write('{}\\n'.format(ans))"] | ['Wrong Answer', 'Accepted'] | ['s497410413', 's508978512'] | [2940.0, 3060.0] | [17.0, 17.0] | [66, 198] |
p03105 | u857148155 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c=[int(s)for s in input().split()]\nprint(max((b//a,c)))', 'a,b,c=[int(s)for s in input().split()]\nprint(min((b//a,c)))'] | ['Wrong Answer', 'Accepted'] | ['s708244336', 's853148019'] | [2940.0, 2940.0] | [17.0, 17.0] | [59, 59] |
p03105 | u863370423 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['n=input().split()\na=int(n[0])\nb=int(n[1])\nc=int(n[2])\nk=b//n\nif k>c:\n print(c)\nelse:\n print(k)', 'a, b, c = map(int, input().split())\nprint(c) if b//a >= c else print(b//a)'] | ['Runtime Error', 'Accepted'] | ['s136716978', 's092677730'] | [2940.0, 2940.0] | [17.0, 17.0] | [96, 74] |
p03105 | u863850961 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['0', 'a,b,c=list(map(int ,input().split()))\nmyans1=int(b/a)\nif(myans1>c):\n\tprint(c)\nelse:\n\tprint(myans1)\n'] | ['Wrong Answer', 'Accepted'] | ['s257447039', 's704726417'] | [9052.0, 9152.0] | [27.0, 25.0] | [1, 99] |
p03105 | u864069774 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,k = map(int,input().split())\n\nyakusuu_array = []\n\nfor ab in [a,b]:\n yakusuu_array_ab = []\n for i in range(1,ab):\n if ab % i == 0:\n yakusuu_array_ab.append(i)\n yakusuu_array.append(yakusuu_array_ab)\n\nkouyakusuu = list(set(yakusuu_array[0]) & set(yakusuu_array[1]))\n\nif len(ko... | ['Runtime Error', 'Accepted'] | ['s334055056', 's710580102'] | [3060.0, 2940.0] | [17.0, 17.0] | [367, 80] |
p03105 | u864667985 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c = map(int, input().split())\nprint(max(b//a, c))', 'a, b, c = map(int, input().split())\nprint(min(c, b//a))\n'] | ['Wrong Answer', 'Accepted'] | ['s099125906', 's803846572'] | [3316.0, 2940.0] | [20.0, 20.0] | [53, 56] |
p03105 | u864900001 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a', 'a, b, c = map(int, input().split())\ni=0\nwhile(a*i<=b and i<=c):\n i += 1\nprint(i-1)\n\n'] | ['Runtime Error', 'Accepted'] | ['s319734158', 's410755165'] | [2940.0, 2940.0] | [17.0, 17.0] | [1, 87] |
p03105 | u865413330 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a, b, k = map(int, input().split())\nl1 = [i for i in range(1, a) if (a % i == 0)]\nl2 = [i for i in range(1, b) if (b % i == 0)]\nl = list(set(l1) & set(l2))\nl.sort()\nprint(l[k-1])', 's = input()\ncount = 0\n\nfor i in range(5):\n if not(("01" in s) | ("10" in s)):\n break\n if "01" in s:\n cou... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s363194494', 's429434581', 's938583387', 's059511957'] | [3060.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [178, 282, 275, 79] |
p03105 | u867796365 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['from sys import stdin\n\n\nsdi = stdin.readline().rstrip()\n# a, b, c = stdin.readline().rstrip().split()\n# a, b, c = [x for x in stdin.readline().rstrip().split()]\n# a, b, c = [int(x) for x in stdin.readline().rstrip().split()]\nl = list(sdi)\nl.reverse()\nstart = len(l)\ni = 0\nwhile len(l) - 1 >= i + 1:\n if ... | ['Wrong Answer', 'Accepted'] | ['s584251769', 's411966080'] | [3060.0, 2940.0] | [17.0, 18.0] | [461, 336] |
p03105 | u876705760 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['class UnionFind():\n def __init__(self, n):\n self.__parent = [i for i in range(n)]\n self.size = [1 for _ in range(n)]\n\n def union(self, x, y):\n pX, pY = self.find(x), self.find(y)\n if pX != pY:\n if pX < pY:\n self.__parent[pY] = pX\n se... | ['Runtime Error', 'Accepted'] | ['s015285098', 's613070233'] | [3064.0, 2940.0] | [18.0, 18.0] | [1046, 122] |
p03105 | u886902015 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c=map(int,input().split())\nprint(max(b//a,c))', 'a,b,c=map(int,input().split())\nprint(min(b//a,c))'] | ['Wrong Answer', 'Accepted'] | ['s204492653', 's629201636'] | [9088.0, 9156.0] | [26.0, 26.0] | [49, 49] |
p03105 | u887207211 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a, b, c = map(int,input().split())\nif(a > b):\n print(0)\nelif(a*c <= b):\n print(b)\nelif(a*c > b):\n print(a)', 'A, B, C = map(int,input().split())\nprint(min(B//A, C))'] | ['Wrong Answer', 'Accepted'] | ['s661148992', 's915850070'] | [2940.0, 2940.0] | [17.0, 18.0] | [109, 54] |
p03105 | u898967808 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c=map(int,input().split())\nmin(b//a,c)', 'a,b,c=map(int,input().split())\nprint(min(b//a,c))'] | ['Wrong Answer', 'Accepted'] | ['s822797068', 's712322135'] | [2940.0, 2940.0] | [18.0, 17.0] | [42, 49] |
p03105 | u902693400 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c= map(int, input().split())\n\nif (b/a) => c:\n print(c)\nelse:\n print(b/a)', 'a,b,c= map(int, input().split())\nd=(b/a)\nif d=> c:\n print(c)\nelse:\n print(d)', 'a,b,c= map(int, input().split())\nd=int(b/a)\nif d>= c:\n print(c)\nelse:\n print(d)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s025999147', 's213132991', 's175285183'] | [2940.0, 2940.0, 2940.0] | [17.0, 24.0, 17.0] | [78, 78, 81] |
p03105 | u905872604 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,k = map(int, input().split())\nimport math\nimport sys\nc = math.gcd(a, b)\nls = []\nfor i in range(1, c):\n if c % i == 0:\n ls.append(i)\n\nprint(ls[k-1])\n', 'a, b, c= map(int, input().split())\nprint(max(b//a, c))\n\n', 'a, b, c= map(int, input().split())\nprint(min(b//a, c))\n\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s543836087', 's873534663', 's542942484'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [162, 56, 56] |
p03105 | u910756197 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A, B, C = map(int, input().split())\nprint(min(A // B, C))', 'A, B, C = map(int, input().split())\nprint(min(B // A, C))\n'] | ['Wrong Answer', 'Accepted'] | ['s487989337', 's882841842'] | [2940.0, 2940.0] | [17.0, 21.0] | [57, 58] |
p03105 | u917733926 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a, b, c = (int(i) for i in input().split())\n\nif a * c == b:\n print(c)\nelse:\n print(b//a)', 'a, b, c = (int(i) for i in input().split())\n\nif (a * c) < b:\n print(c)\nelse:\n print(b//a)', 'a, b, c = (int(i) for i in input().split())\n\nif a * c < b:\n print(c)\nelse:\n print(b//a)', 'a, b, c =... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s172195473', 's645434565', 's676508385', 's748957094'] | [3060.0, 2940.0, 2940.0, 2940.0] | [20.0, 17.0, 22.0, 17.0] | [94, 97, 95, 97] |
p03105 | u919404987 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A, B, C = [int(s) for s in input().split(" ")]\nfor i in range(C):\n B -= A\n if B<0:\n break\nprint(i)\n', 'A, B, C = [int(s) for s in input().split(" ")]\nfor i in range(C):\n B -= A\n if B<0:\n break\nprint(B+A)', 'A, B, C = [int(s) for s in input().split(" ")]\nfor i in range(C):\n B -= A\n if B<0:\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s348648719', 's602234833', 's770342908', 's245237468'] | [2940.0, 3064.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [104, 105, 115, 117] |
p03105 | u919734978 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c = map(int,input().split())\nif a*c > b:\n print(c)\nelse:\n print(b//a)', 'a,b,c = map(int,input().split())\nif a*c < b:\n print(c)\nelse:\n print(b//a)\n'] | ['Wrong Answer', 'Accepted'] | ['s503416138', 's846828416'] | [2940.0, 3064.0] | [17.0, 17.0] | [75, 76] |
p03105 | u920963042 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['INPUT = list(int, input().split)\nA = INPUT[0]\nB = INPUT[1]\nC = INPUT[2]\n\nif (B//A) > C:\n ANS = C\nelse:\n ANS = B//A\n\nprint(ANS)', 'INPUT = list(map(int, input().split))\nA = INPUT[0]\nB = INPUT[1]\nC = INPUT[2]\n\nif (B//A) > C:\n ANS = C\nelse:\n ANS = B//A\n\nprint(ANS)', 'A, B, C = (int(i) for... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s874355147', 's908127162', 's359149387'] | [3064.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [132, 137, 106] |
p03105 | u922769680 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A,B,K=map(int,input().split())\nans_list=[]\nC=min(A,B)+1\nfor i in range(1,C):\n if A%i == 0 and B%i == 0:\n ans_list.append(i)\nprint(ans_list[-K])', 'a_list=list(map(int,input().split()))\nA=a_list[0]\nB=a_list[1]\nC=a_list[2]\nif B//A <= C:\n answer=B//A\nelse:\n answer=C\nprint(answer)'] | ['Runtime Error', 'Accepted'] | ['s775438345', 's186635216'] | [2940.0, 3060.0] | [18.0, 17.0] | [153, 136] |
p03105 | u923010184 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c = map(int,input().split())\nif a // b > c:\n print(c)\nelse:\n print(a // b)\n \n ', 'a,b,c = map(int,input().split())\nif b // a > c:\n print(c)\nelse:\n print(b // a)\n \n \n'] | ['Wrong Answer', 'Accepted'] | ['s673831138', 's587079868'] | [2940.0, 2940.0] | [18.0, 17.0] | [86, 87] |
p03105 | u923341003 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['N, M = list(map(int,input().split()))\nA = []\nB = []\nfor i in range(M):\n A1,B1=[int(i) for i in input().split()]\n A.append(A1)\n B.append(B1)\nA.reverse()\nB.reverse()\n\nclass UnionFind(object):\n def __init__(self, n=1):\n self.par = [i for i in range(n+1)]\n self.rank = [0 for _ in ra... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s386338771', 's719538193', 's788277134'] | [3316.0, 3192.0, 2940.0] | [18.0, 18.0, 18.0] | [1804, 1808, 97] |
p03105 | u924671994 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,k=map(int,input().split())\n \ncount=0\n \nfor i in range(1,min(a,b)+1)[::-1]:\n if a%i==0 and b%i==0:\n count+=1\n if count==k:\n print(i)', 'a,b,c=map(int,input().split())\n\nanswer = b//a\n\nif answer<c:\n print(answer)\n else:\n print(c)', 'a,b,k=map(int,input().split())\n \ncount=0\n \nfor i in ... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s197680402', 's556310982', 's784802401', 's958161943', 's440596626'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0, 17.0] | [143, 96, 159, 140, 92] |
p03105 | u932913455 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['def main120():\n import sys\n S_org = input()\n S = []\n\n for s in range(len(S_org)):\n S.append(S_org[s])\n S = list(map(int, S))\n\n cont = True\n index = 0\n count = 0\n\n if len(S) == 1:\n print(0)\n sys.exit()\n\n else:\n while(cont):\n print(... | ['Runtime Error', 'Accepted'] | ['s011519198', 's631096641'] | [3064.0, 2940.0] | [18.0, 17.0] | [714, 112] |
p03105 | u937706062 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a = str(input())\nx = a.count("0")\ny = a.count("1")\nprint(2 * min(int(x), int(y)))\n', 'a = str(input())\nx = a.count("0")\ny = a.count("1")\nprint(2 * min(int(x), int(y)))\n', 'A, B, C = map(int, input().split())\nprint(min(B // A, C))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s391986307', 's758713075', 's709032724'] | [2940.0, 2940.0, 3064.0] | [18.0, 17.0, 17.0] | [82, 82, 58] |
p03105 | u938486382 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ["a, b, c = list(map(int, input().split(' ')))\nmin(b//a, c)", "a, b, c = list(map(int, input().split(' ')))\nprint(min(b//a, c))"] | ['Wrong Answer', 'Accepted'] | ['s487579793', 's418479793'] | [2940.0, 2940.0] | [17.0, 17.0] | [57, 64] |
p03105 | u940102677 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c = map(int,input().split())\nprint(max(b//a,c))', 'a,b,c = map(int,input().split())\nprint(min(b//a,c))'] | ['Wrong Answer', 'Accepted'] | ['s505317983', 's154546382'] | [2940.0, 2940.0] | [17.0, 18.0] | [51, 51] |
p03105 | u940279019 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A,B,C = map(int,input().split())\nprint(if(B/A <= C)int(B/A) else(int(C))', 'A,B,C = map(int,input().split())\n\nans = min(C,B//A)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s250965444', 's087511255'] | [2940.0, 3064.0] | [18.0, 17.0] | [72, 62] |
p03105 | u943117333 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c =map(int, input().split()) \n\nif b%a <= c :\n print(b//a)\nelse:\n print(c)', 'a,b,c =map(int, input().split()) \n\nif b//a<= c :\n print(b//a)\nelif b//a> c:\n print(c)'] | ['Wrong Answer', 'Accepted'] | ['s741142305', 's977942592'] | [2940.0, 2940.0] | [17.0, 18.0] | [83, 91] |
p03105 | u945945701 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a = input()\nb = input()\nc = input()\n\nprint (a)\nprint (b)\nprint (c)', 'a,b,c = map(int,input.split())\nprint (min(b//a,c))', 'input = input()\na,b,c = map(int,input.split())\nprint (min(a/b,c))', 'input = input()\na,b,c = map(int,input.split())\nprint (min(a/b,c))', 'input = input()\na,b,c = map(int,input.split(... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s179324427', 's573001894', 's909955528', 's989405001', 's057782796'] | [3068.0, 2940.0, 2940.0, 2940.0, 2940.0] | [18.0, 18.0, 17.0, 18.0, 17.0] | [66, 50, 65, 65, 66] |
p03105 | u950708010 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c = (int(i) for i in input().split())\nif a*c <= a:print(c)\nelse:print(b//a)', 'a,b,c = (int(i) for i in input().split())\nif a*c <= b:print(c)\nelse:print(b//a)'] | ['Wrong Answer', 'Accepted'] | ['s386991452', 's889024345'] | [2940.0, 2940.0] | [17.0, 17.0] | [79, 79] |
p03105 | u951652829 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a , b, c = map(int, input().split())\nd = b // a \nif d > c:\n return c\nelse:\n return d', 'a , b, c = map(int, input().split())\nd = b // a \nif d > c:\n print(c)\nelse:\n print(d)'] | ['Runtime Error', 'Accepted'] | ['s514300471', 's206446325'] | [2940.0, 2940.0] | [17.0, 17.0] | [87, 87] |
p03105 | u953379577 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c = map(int,input().split())\nprint(min(c,a//b))', 'a,b,c = map(int,input().split())\nprint(min(c,b//a))'] | ['Wrong Answer', 'Accepted'] | ['s632404878', 's487771266'] | [9100.0, 9060.0] | [28.0, 23.0] | [51, 51] |
p03105 | u963903527 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ["A, B, C = map(int, input().split())\n\nprint(B // A if B // A < C else C)\nprint('a')", 'A, B, C = map(int, input().split())\n\nprint(B // A if B // A < C else C)'] | ['Wrong Answer', 'Accepted'] | ['s237118334', 's335372519'] | [2940.0, 2940.0] | [18.0, 17.0] | [82, 71] |
p03105 | u964763428 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A, B, K = map(int, input().split())\nd = [i for i in range(100,1,-1) if (A%i==0 and B%i==0)]\nprint(d[K-1])\n', 'a,b,c=map(int,input().split())\nif a*c<=b:\n print(c)\nelse:\n print(b//a)'] | ['Runtime Error', 'Accepted'] | ['s005032203', 's410610277'] | [2940.0, 2940.0] | [18.0, 17.0] | [106, 72] |
p03105 | u966000628 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c = map(int,input().split())\nlis = []\nfor i in range(1,min(a,b)+1):\n if a%i == 0 and b%i == 0:\n lis.append(i)\nprint(lis[-1*c])', 'a,b,c = map(int,input(),split())\nif a*c < b:\n print(c)\nelse:\n print(b//a)', 'a,b,c = map(int,input().split())\nif a*c < b:\n print(c)\nelse:\n print(b//a)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s116628770', 's125723266', 's237217668'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0] | [134, 75, 76] |
p03105 | u967835038 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ["s=str(input())\nprint(min(s.count('0'),s.count('1'))*2)", 'a, b, c = map(int, input().split())\nprint(min(b//a, c))\n'] | ['Wrong Answer', 'Accepted'] | ['s714186303', 's838208218'] | [2940.0, 2940.0] | [18.0, 17.0] | [54, 56] |
p03105 | u973108807 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a,b,c = map(int, input().split())\nprint(min(c, b//a)', 'a,b,c = map(int, input().split())\nprint(min(c, b//a))'] | ['Runtime Error', 'Accepted'] | ['s591909958', 's993503693'] | [2940.0, 2940.0] | [17.0, 17.0] | [52, 53] |
p03105 | u980783809 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a, b, c = map(int, input().split())\nprint(min(c,a//b))', 'a, b, c = map(int, input().split())\nprint(min(c,b//a))'] | ['Wrong Answer', 'Accepted'] | ['s311994265', 's620609415'] | [9080.0, 9104.0] | [29.0, 31.0] | [54, 54] |
p03105 | u981002188 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['S = input()\nS = S.split()\nhowMuch = S[0]\nIhave = S[1]\nsutis = S[2]\n \nans = int(Ihave)/int(howMuch)\nans2 = int(sutis) * int(howMuch)\nif ans < sutis:\n print(int(sutis))\nelse:\n print(int(ans))', 'S = input()\nS = S.split()\nhowMuch = S[0]\nIhave = S[1]\nsutis = S[2]\n \nif (Ihave // howMuch) < sutis:\n ... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s055939807', 's305264944', 's383503744', 's095309580'] | [3060.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [195, 150, 113, 165] |
p03105 | u982198202 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A, B, C = map(int, input().split())\nans = int(B / A)\nif ans > 0:\n print(ans)\nelse:\n print(0)', 'A, B, C = map(int, input().split())\nans = int(B / A)\nif ans > 0:\n if C > ans:\n print(ans)\n else:\n print(C)\nelse:\n print(0)'] | ['Wrong Answer', 'Accepted'] | ['s081061435', 's970691381'] | [2940.0, 2940.0] | [17.0, 17.0] | [98, 145] |
p03105 | u982594421 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ["from itertools import chain\nimport sys\nsys.setrecursionlimit(99999)\n\ns = input().rstrip()\n\ndef f(s):\n l = s.split('01')\n for i in range(len(l)):\n l[i] = l[i].split('10')\n l = list(chain.from_iterable(l))\n if len(l) == 1:\n return 0\n else:\n r = (len(l) - 1) * 2\n ... | ['Wrong Answer', 'Accepted'] | ['s191919059', 's380828242'] | [3060.0, 2940.0] | [17.0, 17.0] | [342, 59] |
p03105 | u983599131 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['in = input().split()\n\na = int(in[0])\nb = int(in[1])\nc = int(in[2])\n\nif b / a < c:\n print(b/ a)\nelse:\n print(c)\n', 'in1 = input().split()\n\na = int(in1[0])\nb = int(in1[1])\nc = int(in1[2])\n\nif b / a < c:\n print(int(b / a))\nelse:\n print(c)\n'] | ['Runtime Error', 'Accepted'] | ['s992241407', 's874109552'] | [2940.0, 2940.0] | [17.0, 18.0] | [113, 123] |
p03105 | u987637902 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a, b, c = map(input().split())\nif a * c > b:\n print(b//a)\nelse:\n print(c)\n', 'a, b, c = map(int, input().split())\nif a * c > b:\n print(b//a)\nelse:\n print(c)\n'] | ['Runtime Error', 'Accepted'] | ['s026949707', 's195325620'] | [8908.0, 9084.0] | [26.0, 25.0] | [80, 85] |
p03105 | u988004923 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['import sys\nsys.setrecursionlimit(10**5)\nn, m = list(map(int, input().split()))\nab = [list(map(int, input().split())) for i in range(m)]\n\nans = n * (n - 1) // 2\nresult = [ans]\nleader = [-1] * n\nsize = [1] * n\n\n\ndef leader_check(i):\n if leader[i] == -1:\n return i\n ln = leader_check(leader[i])... | ['Runtime Error', 'Accepted'] | ['s049058276', 's141428479'] | [3064.0, 2940.0] | [17.0, 17.0] | [602, 85] |
p03105 | u989623817 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['a, b, c = input().split()\n\n\nprint(max(c, b//a))', 'a, b, c = map(int,input().split())\nprint(max(c, b//a))\n', 'a, b, c = map(int, input().split())\n\n\nprint(min(c, b//a))\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s189315463', 's720344992', 's228826355'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [47, 55, 58] |
p03105 | u993435350 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['H,W = map(int,input().split())\na,b = map(int,input().split())\n\nwhite = (H * W) - (W * a) - ((H - a) * b)\n\nprint(white)', 'A,B,C = map(int,input().split())\n\nprint(min(B//A,C))'] | ['Runtime Error', 'Accepted'] | ['s447895169', 's416222457'] | [2940.0, 2940.0] | [17.0, 17.0] | [118, 52] |
p03105 | u994064513 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A,B,C = [int(s) for s in input().split()]\n\nprint(C) if B B//A >= C else print(B//A)', 'A,B,C = [int(s) for s in input().split()]\n \nprint(C) if B//A >= C else print(B//A)'] | ['Runtime Error', 'Accepted'] | ['s221609664', 's338821106'] | [2940.0, 2940.0] | [17.0, 17.0] | [83, 82] |
p03105 | u995102075 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['K = int(input())\n\nif K % 2:\n print((K // 2) * (K // 2 + 1))\nelse:\n print((K // 2)**2)\n', 'A, B, C = map(int, input().split())\n\nif C <= B / A:\n print(C)\nelse:\n print(int(B / A))\n'] | ['Runtime Error', 'Accepted'] | ['s258889393', 's989399565'] | [2940.0, 2940.0] | [17.0, 17.0] | [92, 93] |
p03105 | u997641430 | 2,000 | 1,048,576 | Takahashi likes the sound when he buys a drink from a vending machine. That sound can be heard by spending A yen (the currency of Japan) each time. Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time. How many times will he h... | ['A,B,C=map(int,input().split())\nprint(min(int(B/A),C)', 'A,B,C=map(int,input().split())\nprint(min(int(B/A),C))'] | ['Runtime Error', 'Accepted'] | ['s854666744', 's466601094'] | [2940.0, 2940.0] | [17.0, 17.0] | [52, 53] |
p03108 | u000623733 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ["N, M = map(int, input().split())\n\npairs = []\nfor _ in range(M):\n pairs.append(list(map(int, input().split())))\npairs = pairs[::-1]\n\n\n\nclass UnionFind:\n def __init__(self, n):\n self.par = [i for i in range(n)]\n self.rank = [1 for i in range(n)]\n\n def root(self, x):\n if (sel... | ['Wrong Answer', 'Accepted'] | ['s293733455', 's503476501'] | [38356.0, 38352.0] | [780.0, 737.0] | [1407, 1464] |
p03108 | u001024152 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['class UnionFind:\n \n \n \n def __init__(self,n):\n self.par = [-1]*n \n self.size = [1]*n\n for i in range(n):\n self.par[i] = i \n \n def root(self, x: int) -> int:\n \n if self.par[x] == x: # if root\n return x\n else:\n ... | ['Runtime Error', 'Accepted'] | ['s995041455', 's099489042'] | [23284.0, 27600.0] | [1001.0, 878.0] | [1667, 1731] |
p03108 | u013408661 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['import sys\nn,m=map(int,input().split())\nbridge=[[i for i in map(int,l.split())] for l in sys.stdin]\nbridge.reverse()\nall=(n*(n-1))//2\nans=[all]\nroot=[1]*(n+1)\nrank=[0]*(n+1)\nsize=[0]*(n+1)\ndef find(x):\n if root[x]==x:\n return x\n else:\n root[x]=find(root[x])\n return root[x]\ndef check(x,y):\n ... | ['Wrong Answer', 'Accepted'] | ['s960941307', 's497575113'] | [25264.0, 29900.0] | [365.0, 551.0] | [687, 717] |
p03108 | u037098269 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['N, M = map(int, input().split())\na_list = []\nb_list = []\nfor i in range(M):\n a, b = map(int, input().split())\n a_list.append(a)\n b_list.append(b)\n\nclass UnionFind():\n def __init__(self, N):\n self.par = [i for i in range(N+1)]\n self.rank = [0]*(N+1)\n self.size = [1] * (N + ... | ['Runtime Error', 'Accepted'] | ['s878019299', 's706035828'] | [3064.0, 19404.0] | [17.0, 707.0] | [1451, 1088] |
p03108 | u038229929 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ["from sys import stdin\nN, M = [int(x) for x in stdin.readline().rstrip().split()]\ndata = [stdin.readline().rstrip().split() for _ in range(M)]\n\nisland = list(range(N))\ncounts = [1] * N\ntotal = int((N * (N - 1)) / 2)\nresult = []\n\nfor c in reversed(data):\n ref0 = int(c[0]) - 1\n while island[ref0] != ref... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s214652978', 's320175260', 's970626301', 's365838400'] | [36900.0, 36900.0, 52600.0, 50008.0] | [120.0, 110.0, 621.0, 442.0] | [999, 798, 768, 1030] |
p03108 | u052499405 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['class UnionFind:\n def __init__(self, n):\n self.par = [i for i in range(n+1)]\n self.rank = [0] * (n+1)\n\n def find(self, x):\n if self.par[x] == x:\n return x\n else:\n self.par[x] = self.find(self.par[x])\n return self.par[x]\n\n def same_check... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s030821897', 's827689335', 's517673347'] | [3064.0, 3192.0, 30984.0] | [20.0, 18.0, 884.0] | [1260, 1289, 1238] |
p03108 | u054106284 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['N, M = (int(i) for i in input().split())\nL = []\nfor i in range(M):\n a, b = (int(j) for j in input().split())\n L.append((a-1, b-1))\nL.reverse()\n\nuf = [-1]*N\ndef parent(v):\n if uf[v] < 0:\n return v\n else:\n uf[v] = parent(uf[v])\n return parent(uf[v])\n\nres = [0]*M\nans = (N... | ['Wrong Answer', 'Accepted'] | ['s940362685', 's077483925'] | [125708.0, 34368.0] | [2105.0, 489.0] | [616, 709] |
p03108 | u062459048 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['n, m = map(int, input().split())\nA = []*m\nB = []*m\nfor i in range(m):\n A[i],B[i] =map(int, input().split())\n\nal = n(n-1)/2\nansl = [al]\nd = list(range(m+1))\ndl = [[_] for _ in range(m+1)]\n\nfor i in range(m-1,0,-1):\n x = d[A[i]]\n y = d[B[i]]\n x,y = max(x,y),min(x,y)\n al -= dl[x]*dl[y]\n for i in ra... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s172196710', 's651677121', 's378326297'] | [3064.0, 3188.0, 39028.0] | [18.0, 21.0, 739.0] | [406, 436, 439] |
p03108 | u064246852 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['class UnionFind:\n def __init__(self,size):\n self.par = list(range(size))\n self.rank = [0]*size\n self.sizeof = [1]*size \n def find(self,x):\n if self.par[x] == x:\n return x\n self.par[x] = self.find(self.par[x])\n return self.par[x]\n def union(self,x... | ['Wrong Answer', 'Accepted'] | ['s456339905', 's380283693'] | [26488.0, 24088.0] | [786.0, 851.0] | [1294, 1320] |
p03108 | u067729694 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['N, M = map(int, input().split())\n\nAB = []\n\nfor _ in range(M):\n A_i, B_i = map(int, input().split())\n AB.append([A_i, B_i])\n \n \nclass UnionFind(object):\n def __init__(self, n=1):\n self.par = [i for i in range(n)]\n self.rank = [0 for _ in range(n)]\n\n def find(self, x):\n ... | ['Wrong Answer', 'Accepted'] | ['s517878683', 's130628770'] | [19628.0, 27604.0] | [332.0, 794.0] | [997, 1326] |
p03108 | u075303794 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['class UnionFind():\n def __init__(self,n):\n self.parents = list(range(n))\n self.size = [1]*n\n \n def find(self,x):\n if self.parents[x] == x:\n return x\n\t\n self.parents[x] = self.find(self.parents[x])\n return self.parents[x]\n \n def union(self,x,y):\n x = self.find(x)\n y = self... | ['Runtime Error', 'Accepted'] | ['s278876870', 's409225421'] | [33988.0, 31156.0] | [508.0, 490.0] | [805, 841] |
p03108 | u076936237 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['import math\n\nn, m = list(map(int, input().split()))\n\nbr = [list(map(int, input().split())) for _ in range(m)]\n\nans = []\n\ndef ncr(n, r):\n if n<r:\n return 0\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\nsubg = {i+1:i+1 for i in range(n)}\n\nnodes = {i+1:1 for i in r... | ['Wrong Answer', 'Accepted'] | ['s848442944', 's080507642'] | [54872.0, 34204.0] | [2106.0, 793.0] | [920, 1458] |
p03108 | u080428180 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['# find-union\n\nimport sys\ninput = sys.stdin.readline\n\n\ndef find(x):\n if par[x] == x:\n return x\n else:\n return find(par[x])\n\n\ndef unite(x,y):\n x = find(x)\n y = find(y)\n\n if x != y:\n \n if rank[x] < rank[y]:\n par[x] = y\n size[y] += size... | ['Runtime Error', 'Accepted'] | ['s014016210', 's278902480'] | [22928.0, 24052.0] | [359.0, 445.0] | [1183, 1195] |
p03108 | u083960235 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, asc... | ['Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s213216170', 's424057750', 's585175619'] | [35332.0, 33628.0, 37576.0] | [2109.0, 2106.0, 666.0] | [3047, 2944, 2819] |
p03108 | u087917227 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['N,M = map(int,input().split())\ntmp = N*(N-1)//2\nl = []\ncnt = []\nab = [list(map(int, input().split())) for i in range(M)]\n# print(ans)\nherasu = 0\nans = [tmp]\nfor i in ab[::-1]:\n \n if (i[0] in cnt) and (i[1] in cnt):\n\n flag = False\n for index, l1 in enumerate(l):\n print(l1, ... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s002564642', 's447413964', 's499061857', 's809484756'] | [93628.0, 42676.0, 30736.0, 42672.0] | [2105.0, 858.0, 2105.0, 873.0] | [1432, 1315, 1172, 1324] |
p03108 | u095426154 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['n,m=map(int,input().split())\nbridge=[[] for i in range(m)]\niland=[[i+1] for i in range(n)]\nfor i in range(m):\n bridge[i]=list(map(int,input().split()))\nans=[0 for i in range(m+1)]\nans[0]=int((n-1)*n/2)\nk=1\nfor i in reversed(bridge):\n ans[k]=ans[k-1]\n for j in range(i[0]):\n if i[0] in iland[... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s073283285', 's481653696', 's702662062'] | [43800.0, 35072.0, 35024.0] | [2107.0, 375.0, 635.0] | [710, 749, 881] |
p03108 | u096616343 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ["class UnionFind():\n def __init__(self, n):\n self.n = n\n self.parents = [-1] * n\n\n def find(self, x):\n if self.parents[x] < 0:\n return x\n else:\n self.parents[x] = self.find(self.parents[x])\n return self.parents[x]\n\n def union(self, x, y)... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s251445691', 's529565787', 's580617996'] | [17412.0, 20420.0, 22536.0] | [316.0, 775.0, 794.0] | [1475, 1487, 1081] |
p03108 | u099566485 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['def IL(): return list(map(int,input().split()))\ndef SL(): return input().split()\ndef I(): return int(input())\ndef S(): return list(input())\n\nclass UnionFind(object):\n \n def __init__(self, n):\n self.par = [i for i in range(n)]\n self.rank = [0 for i in range(n)]\n self.size=[1 for i in ... | ['Wrong Answer', 'Accepted'] | ['s395918222', 's196633120'] | [30164.0, 29952.0] | [784.0, 834.0] | [1383, 1388] |
p03108 | u119982147 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ["class UnionFind():\n __slots__ = ['parent']\n \n \n\n def __init__(self, n):\n self.parent = [-1] * n\n\n def find(self, x):\n if self.parent[x] < 0:\n return x\n else:\n self.parent[x] = self.find(self.parent[x])\n return self.parent[x]\n\n def ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s099180561', 's275869780', 's819034007'] | [37552.0, 37544.0, 36544.0] | [1023.0, 1051.0, 781.0] | [1455, 1449, 1416] |
p03108 | u129315407 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['N, M = map(int, input().split())\nAi = [list(map(int, input().split())) for _ in range(M)]\n\ngroups = [-1 for i in range(N + 1)] \nsizes = [1 for _ in range(N + 1)]\nAi.reverse()\n\nvalue = N * (N - 1) // 2\nanswers = []\nanswers.append(value)\n\ndef parent(n):\n if groups[n] < 0:\n return n\n return pa... | ['Wrong Answer', 'Accepted'] | ['s157306816', 's259101661'] | [35624.0, 34216.0] | [752.0, 751.0] | [796, 796] |
p03108 | u138253748 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ["import itertools\n\ndef findRoot(uf,value):\n if uf[value]==None:\n return value\n else:\n uf[value]=findRoot(uf,uf[value])\n return uf[value]\n\nn,m=[int(x) for x in input().split(' ')]\n\nuf=[None]*n\nb=[]\ns=[1]*n\nr=[]\n\nfor x in range(0,m):\n b.append([int(x)-1 for x in input().split(' ')])\n\nfor x... | ['Runtime Error', 'Accepted'] | ['s495113584', 's991596295'] | [3064.0, 41444.0] | [18.0, 590.0] | [587, 574] |
p03108 | u147687635 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['from itertools import groupby\n \nclass UnionFind:\n \n def __init__(self, n):\n self.n = n\n self.parents = list(range(n))\n self.rank = [0] * n\n self.size = [1] * n\n \n def find(self, x):\n if self.parents[x] == x:\n return x\n else:\n self.par... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s402997025', 's672721826', 's401145712'] | [154468.0, 32948.0, 35028.0] | [2113.0, 431.0, 925.0] | [1540, 1531, 1620] |
p03108 | u160244242 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['n, m = map(int, input().split())\nlst = [list(map(int, input().split())) for _ in range(m)]\n\nlst = list(reversed(lst))\n\npossible_route = n*(n-1)/2\nans = [possible_route]\nroute_lst = []\n\nfor pair in lst:\n new_route_lst = []\n index0 = -1\n index1 = -1\n for k, route in enumerate(route_lst):\n ... | ['Wrong Answer', 'Accepted'] | ['s062806819', 's403724222'] | [28652.0, 38584.0] | [2105.0, 896.0] | [1212, 1424] |
p03108 | u166306121 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ["from sys import stdin\nclass UnionFind:\n def __init__(self, n):\n \n self.par = [-1 for i in range(n + 1)]\n\n \n def root(self, x):\n if self.par[x] < 0:\n return x\n else:\n self.par[x] = self.root(self.par[x])\n return self.par[x]\n\n \n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s354150343', 's667575182', 's956483570', 's167841077'] | [17788.0, 17780.0, 17792.0, 47092.0] | [621.0, 627.0, 613.0, 627.0] | [1787, 1820, 1820, 1859] |
p03108 | u171366497 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['n,m=map(int,input().split())\nbranch=[tuple(map(int,input().split())) for _ in range(m)]\ncango=dict()\nres=[0]\ndata=[0 for _ in range(1+n)]\n\ndef calc(k):\n return 1/2*k*(k-1)\n\ndef search(data,x):\n bef=x\n while data[x]>0:\n data[bef]=data[x]\n bef=x\n x=data[x]\n return x,data[... | ['Runtime Error', 'Accepted'] | ['s518993646', 's570779786'] | [17352.0, 18576.0] | [301.0, 732.0] | [1076, 794] |
p03108 | u179169725 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['import sys\nread = sys.stdin.readline\n\n\ndef readln():\n return list(map(int, read().split()))\n\n\nN, M = readln()\nA = [0]*M\nB = [0]*M\nfor i in range(M-1, -1, -1):\n a, b = readln()\n A[i], B[i] = a, b\n# AB = [readln() for _ in range(M)]\n# A = [ab[0]-1 for ab in AB[::-1]]\n# B = [ab[1]-1 for ab in AB... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s328500576', 's917804085', 's242878744'] | [15692.0, 34280.0, 17772.0] | [545.0, 553.0, 673.0] | [2075, 1877, 2079] |
p03108 | u191829404 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['# abcde\ts=input()\ts=\'abcde\'\n# abcde\ts=list(input())\ts=[\'a\', \'b\', \'c\', \'d\', \'e\']\n\n# 1 2\t| x,y = s_inpl() |\tx=1,y=2\n\n\n\n\n# INPUT\n# 3\n# hoge\n# foo\n# bar\n# ANSWER\n# n=int(input())\n\n\nimport math\nimport copy\nfrom collections import defaultdict\nfrom collections import Counter\nfrom col... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s093353847', 's945159270', 's531141228'] | [38652.0, 27604.0, 38588.0] | [733.0, 421.0, 904.0] | [2691, 2749, 2485] |
p03108 | u198440493 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['def root(s):\n t=l[s]\n if t<0:\n return s\n return root(t)\ndef f(s):\n return root(int(s)-1)\nn,m=map(int,input().split())\nans=n*(n-1)//2\nl=[-1]*n\na=[1]*n\nb=[input().split() for _ in range(m)]\nc=[0]*m+[ans]\nfor i in range(m-1,-1,-1):\n x,y=map(f,b[i+1])\n if x!=y:\n l[x]=y\n ans-=a[x]*a[y]\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s463052976', 's468136388', 's500865683', 's881151900', 's938180411', 's587420347'] | [35352.0, 43348.0, 121432.0, 36580.0, 36580.0, 40272.0] | [218.0, 1712.0, 526.0, 2108.0, 323.0, 475.0] | [349, 328, 484, 413, 387, 478] |
p03108 | u210543511 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ["N, M = map(int, input().split())\nils = [map(int, input().split()) for _ in range(M)]\n\npar = [i for i in range(N)]\nsize = [1] * N\n\ndef root(x):\n if par[x] == x:\n return x\n else:\n par[x] = root(par[x])\n \ndef unit(x, y):\n x = root(x)\n y = root(y)\n if x == y:\n retu... | ['Runtime Error', 'Accepted'] | ['s823093402', 's902489456'] | [3064.0, 51684.0] | [18.0, 855.0] | [570, 748] |
p03108 | u211160392 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['N,M = map(int,input().split())\nbri = [[int(i) for i in input().split()]for i in range(M)]\n\ndef benri(x,con):\n \n if x in con :\n return con\n else:\n con.append(x)\n \n for i in bri:\n if x in i:\n con=(benri(i[i[0]==x],con))\n return con\n\nfor i in range(1,M+1):... | ['Runtime Error', 'Accepted'] | ['s334916886', 's188430037'] | [22980.0, 52776.0] | [2105.0, 1265.0] | [775, 522] |
p03108 | u215329188 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['N, M = list(map(int, input().split()))\nA = []\nB = []\nfor _ in range(M):\n a, b = list(map(int, input().split()))\n A.append(a)\n B.append(b)\n\nclass UnionFind:\n def __init__(self, n: int) -> None:\n \n self.nodes = [-1]*n\n \n def find_root(self, x: int) -> int:\n if self.node... | ['Wrong Answer', 'Accepted'] | ['s436865876', 's726817292'] | [11876.0, 19112.0] | [345.0, 652.0] | [1237, 1241] |
p03108 | u223133214 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['n, m = map(int, input().split())\npar = [-1] * n \n\n\n\ndef find(x):\n if par[x] < 0:\n return x\n else:\n par[x] = find(par[x])\n return find(par[x])\n\n\n\ndef size(x):\n return -par[find(x)]\n\n\n\ndef unite(x, y):\n \n x, y = find(x), find(y)\n\n \n if x == y:\n ... | ['Runtime Error', 'Accepted'] | ['s038545963', 's855443615'] | [33436.0, 34652.0] | [716.0, 799.0] | [1139, 1132] |
p03108 | u226912938 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['class UnionFindBySize():\n def __init__(self, n):\n self.parents = list(range(n+1))\n self.size = [1] * (n+1)\n\n def find(self, x):\n if self.parents[x] == x:\n return x\n else:\n self.parents[x] = self.find(self.parents[x])\n return self.parents[x]\... | ['Wrong Answer', 'Accepted'] | ['s592736061', 's574758956'] | [27368.0, 26376.0] | [839.0, 841.0] | [1246, 1304] |
p03108 | u228223940 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['n,m = map(int,input().split())\nab = [[int(i) for i in input().split()] for j in range(m)]\n\nclass UnionFind:\n def __init__(self, n):\n self.par = [i for i in range(n+1)]\n self.rank = [0] * (n+1)\n self.size = [1 for _ in range(n+1)]\n\n \n def find(self, x):\n if self.par[x] =... | ['Wrong Answer', 'Accepted'] | ['s244569932', 's465020388'] | [31032.0, 24932.0] | [2105.0, 813.0] | [1267, 1675] |
p03108 | u232320761 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['N,M=[int(x) for x in input().split()]\nI=[[] for n in range(N)]\nG=[n for n in range(N)]\nW=[1 for n in range(N)]\nE=[]\n\nresult=[]\nans = int(N * (N-1) / 2)\n\ndef union(i,g):\n if(G[i]!=g):\n G[i]=g\n for n in I[i]:\n union(n,g)\n\n#for A in range(M):\n# E.append((A,A+1))\n#from ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s664086167', 's738764518', 's728689668'] | [115920.0, 30300.0, 19320.0] | [2106.0, 2105.0, 636.0] | [940, 593, 764] |
p03108 | u240354680 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['def func(n):\n return (n * (n - 1)) // 2\n\n\nnode_size, input_size = [int(i) for i in input().split()]\n\nbr = [func(node_size)]\nfor _ in range(input_size):\n br.append([int(i) for i in input().split()])\n\ncnt_list = [func(node_size)]\n\nindex = 0\nnode_to_group = {}\ngroup_to_index = {}\nindex_size = {}\n\n... | ['Runtime Error', 'Accepted'] | ['s244488060', 's545449709'] | [119440.0, 30892.0] | [2105.0, 586.0] | [2035, 1135] |
p03108 | u242196904 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ["from itertools import combinations\nfrom itertools import combinations\nfrom collections import Counter\nimport numpy as np\n\n\nn,m = list(map(int, input().split()))\na = []\nb = []\nfor _ in range(m):\n aa, bb = list(map(int, input().split()))\n a.append(aa)\n b.append(bb)\na = a[::-1]\nb = b[::-1]\n\n\nde... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s516448513', 's536562445', 's561724427', 's936671465'] | [51524.0, 2940.0, 20952.0, 32464.0] | [2110.0, 17.0, 828.0, 584.0] | [1242, 1827, 1467, 736] |
p03108 | u244070045 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['class UnionFind():\n def __init__(self, n):\n self.n = n\n self.parents = [-1] * n\n \n def find(self, x):\n if self.parents[x] < 0:\n return x\n else:\n self.parents[x] = self.find(self.parents[x])\n return self.parents[x]\n\n \n def size(se... | ['Wrong Answer', 'Accepted'] | ['s161069112', 's792170532'] | [16388.0, 16252.0] | [823.0, 821.0] | [1266, 1269] |
p03108 | u270681687 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['class UnionFind:\n def __init__(self, n):\n self.rank = [0] * n\n self.parent = [i for i in range(n)]\n self.num = [1] * n\n\n\n def find(self, x):\n if self.parent[x] == x:\n return x\n else:\n self.parent[x] = self.find(self.parent[x])\n retu... | ['Wrong Answer', 'Accepted'] | ['s652095401', 's752028713'] | [39324.0, 39324.0] | [1035.0, 1184.0] | [1688, 1736] |
p03108 | u271469978 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['import sys\nn , m, *e = map(int,sys.stdin.read().split())\ntotal = n*(n-1)//2\nans =[total]\nu = [-1]*(n+1)\n\ndef find(x):\n if u[x] < 0 :\n return x\n else:\n return find(u[x])\n\nfor x , y in zip(e[-2:1:-2],e[:1:-2]):\n x = find(x)\n y = find(y)\n if x != y:\n total -= u[x] * u[... | ['Runtime Error', 'Accepted'] | ['s922653686', 's402491407'] | [3064.0, 25332.0] | [17.0, 463.0] | [409, 414] |
p03108 | u272963916 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['# -*- coding: utf-8 -*-\n\n\nclass UnionFindbySize:\n def __init__(self, n):\n self.parent = [-1 for i in range(n)]\n\n def root(self, x):\n if self.parent[x] < 0:\n return x\n else:\n return self.parent[x] = self.root(self.parent[x])\n\n def issame(self, x, y):\n ... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s185077719', 's532115149', 's861111856', 's719156266'] | [2940.0, 14152.0, 14196.0, 31164.0] | [17.0, 428.0, 391.0, 846.0] | [1249, 1234, 1236, 1317] |
p03108 | u286955577 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ["from collections import defaultdict\n\nclass UnionFind():\n def __init__(self):\n self.__table = {}\n self.__size = defaultdict(lambda: 1)\n\n def __root(self, x):\n if x not in self.__table:\n self.__table[x] = x\n elif x != self.__table[x]:\n self.__table[x] =... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s223953383', 's256263232', 's493490625', 's795105740', 's870514227', 's828540495'] | [50900.0, 48872.0, 48868.0, 48868.0, 48932.0, 34272.0] | [1115.0, 2106.0, 2109.0, 2106.0, 2110.0, 727.0] | [1288, 1185, 1185, 1185, 1185, 1458] |
p03108 | u305965165 | 2,000 | 1,048,576 | There are N islands and M bridges. The i-th bridge connects the A_i-th and B_i-th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to t... | ['\nclass UnionFind():\n def __init__(self, N):\n self.par = [i for i in range(N)]\n self.N = N\n\n \n def root(self, x):\n return x if self.par[x] == x else self.root(self.par[x])\n\n \n def same(self, x, y):\n rx = self.root(x)\n ry = self.root(y)\n return rx =... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s352870571', 's645019134', 's671371124', 's717889333'] | [26748.0, 26064.0, 31860.0, 30768.0] | [2105.0, 314.0, 914.0, 915.0] | [1242, 1383, 1381, 1391] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.