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
p03291
u102902647
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["s = input()\ndp = [[1, 0, 0, 0]]\nfor s in S:\n tmp = [0, 0, 0, 0]\n if s == 'A' or s == '?':\n tmp[0] += dp[-1][0]\n tmp[1] += dp[-1][1]\n tmp[2] += dp[-1][2]\n tmp[3] += dp[-1][3]\n tmp[1] += dp[-1][0]\n if s == 'B' or s == '?':\n tmp[0] += dp[-1][0]\n tmp[1...
['Runtime Error', 'Accepted']
['s001514580', 's600867772']
[3316.0, 3188.0]
[18.0, 105.0]
[620, 655]
p03291
u102960641
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['s = list(input())\nmod = 10**9 + 7\nabc = 0\nbc = 0\nc = 0\nq = 0\nprint(s[::-1])\nfor i in s[::-1]:\n if i == "A":\n abc = (abc + bc) % mod\n if i == "B":\n bc = (bc + c) % mod\n if i == "C":\n c = (3**q+c) % mod\n if i == "?":\n abc = (abc*3 + bc) % mod\n bc = (bc*3 + c) % mod \n c = (3**q + c...
['Wrong Answer', 'Accepted']
['s715592501', 's509903005']
[6184.0, 3316.0]
[2104.0, 276.0]
[332, 335]
p03291
u119714109
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['\nimport sys\n\nstdin = sys.stdin\n\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nns = lambda: stdin.readline()\n\nmod = 1000000007\n\ns = ns()\n\nnums = [0]*4\nnums[0] = 1\nfor c in s:\n if c == \'A\':\n nums[1] += nums[0]\n nums[1] %= mod\n elif c == "B":\n ...
['Wrong Answer', 'Accepted']
['s495558366', 's230226243']
[3188.0, 3188.0]
[195.0, 188.0]
[626, 634]
p03291
u138486156
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['from collections import Counter\nmod = 10**9+7\ns = input()\nn = len(s)\ndn = [0]*(n+1)\nda = [0]*(n+1)\ndx = [0]*(n+1)\ndh = [0]*(n+1)\nfor i in range(n):\n dn[i+1] = dn[i]%mod\n da[i+1] = da[i]%mod\n dx[i+1] = dx[i]%mod\n dh[i+1] = dh[i]%mod\n if s[i] == "A":\n da[i+1] += 1\n elif s[i] == "...
['Wrong Answer', 'Accepted']
['s361715012', 's200136922']
[9840.0, 3444.0]
[153.0, 123.0]
[646, 364]
p03291
u160244242
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["str_num = 1\na,b,c = 0, 0, 0\nfor i in s:\n if i == 'A':\n a += 1\n elif i == 'B':\n b += a\n elif i == 'C':\n c += b\n else:\n a,b,c = 3*a+str_num, a+3*b, b+3*c\n str_num *= 3\nprint(c)", "s = input()\n\nstr_num = 1\na,b,c = 0, 0, 0\nfor i in s:\n if i == 'A':\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s366834322', 's503101548', 's139675333']
[2940.0, 110680.0, 3188.0]
[17.0, 2112.0, 105.0]
[221, 284, 300]
p03291
u197078193
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["S = input()*10000\nmemo = [[0,0,0,0] for i in range(len(S))]\nQ = 0\nmemo[0][0] = 1\nif S[0] == 'A':\n memo[0][1] = 1\nelif S[0] == '?':\n memo[0][0] = 3\n memo[0][1] = 1\nl = 1\nwhile l < len(S):\n s = S[l]\n if s == 'A':\n memo[l][0] = memo[l-1][0]\n memo[l][1] = memo[l-1][1] + memo[l-1][0]\n memo[l][...
['Wrong Answer', 'Accepted']
['s938064555', 's576567243']
[1415372.0, 27608.0]
[2150.0, 295.0]
[923, 917]
p03291
u197955752
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["s = input()\nn = len(s)\np = 10 ** 9 + 7\n\n\n\n\n\n\ndp = [[0 for j in range(4)] for i in range(n + 1)]\ndp[0][0] = 1 \nfor j in range(1, 4):\n dp[0][j] = 0 \n\nfor i in range(1, n + 1):\n m = 3 if s[i - 1] == '?' else 1\n\n for j in range(4):\n dp[i][j] = dp[i - 1][j] * m\n\n if s[i - 1] == 'A' ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s436775301', 's545975076', 's605364533', 's307516380']
[14836.0, 18924.0, 14836.0, 27608.0]
[104.0, 356.0, 103.0, 459.0]
[963, 1256, 997, 958]
p03291
u237362582
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["def calc_ABC(a, c, bq, aq):\n ans = 0\n if aq != 0:\n if bq != 0:\n ans = ans + (a*pow(3, bq, MOD) + bq*pow(3, bq-1, MOD)) \\\n * (c*pow(3, aq, MOD) + aq*pow(3, (aq-1), MOD))\n else:\n ans = ans + (a*pow(3, bq, MOD)) \\\n * (c*pow(3, aq, MOD) +...
['Runtime Error', 'Accepted']
['s945832600', 's942123318']
[3064.0, 3316.0]
[18.0, 848.0]
[1121, 1117]
p03291
u316386814
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["S = input()\nN = len(S)\nMOD = 10 ** 9 + 7\n\ndp = [0, 0, 0, 0]\ndp[0] = 1\n\nfor s in S:\n factor = 3 if s == '?' else 1\n for j, c in zip([2, 1, 0], 'CBA'):\n dp[j + 1] = dp[j + 1] * factor % MODE\n if s == c or s == '?':\n dp[j + 1] += dp[j]\n if s == '?':\n dp[0] = dp[0] %...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s141091929', 's471347942', 's595287598', 's927090554']
[3188.0, 3316.0, 3316.0, 3188.0]
[18.0, 17.0, 2103.0, 282.0]
[340, 392, 348, 345]
p03291
u319818856
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['S = \'\'\n\ndef we_love_abc()->int:\n global S\n ABC = \'ABC\'\n\n dp = [0, 0, 0, 0]\n dp[3] = 1\n\n for c in reversed(S):\n if c == \'?\':\n m, m1 = 3, 3\n else:\n m, m1 = 1, 1\n\n for j in range(3):\n m2 = 1 if c == \'?\' or c == ABC[j] else 0\n ...
['Runtime Error', 'Accepted']
['s864165676', 's186440312']
[3188.0, 3188.0]
[18.0, 174.0]
[479, 480]
p03291
u367130284
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['s=input()\nBcount=s[1:].count("?")+s[1:].count("B")-1\nCcount=s[2:].count("?")+s[2:].count("C")\nans=0\nAcount=0\nif s[0]=="A":\n Acount+=1\n ans+=(Bcount+1)*Bcount//2\n\nfor i in range(1,len(s)-1):\n if Ccount==0:\n break\n if s[i]=="B":\n ans+=Acount*Ccount\n elif s[i]=="?":\n an...
['Wrong Answer', 'Accepted']
['s326854572', 's218984823']
[3188.0, 27612.0]
[87.0, 236.0]
[509, 792]
p03291
u389910364
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['import bisect\nimport cmath\nimport heapq\nimport itertools\nimport math\nimport operator\nimport os\nimport re\nimport string\nimport sys\nfrom collections import Counter, deque, defaultdict\nfrom copy import deepcopy\nfrom decimal import Decimal\nfrom fractions import gcd\nfrom functools import lru_cache, reduce\nf...
['Time Limit Exceeded', 'Accepted']
['s183707382', 's543148747']
[13364.0, 3316.0]
[2108.0, 292.0]
[934, 602]
p03291
u391731808
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['S=input()\nN = len(S)\nA = [0]*N\nC = [0]*N\nL = [0]*N\nR = [0]*N\nfor i in range(1,N):\n A[i] = A[i-1] + (S[i-1] == "A")\n L[i] = L[i-1] + (S[i-1] == "?")\n C[N-1-i] = C[N-i] + (S[N-i] == "C")\n R[N-1-i] = R[N-i] + (S[N-i] == "?")\nmod = 10**9+7\nd={0:1}\ndef pow_mod(x,n):\n if d.get(n,False) :return ...
['Wrong Answer', 'Accepted']
['s015551237', 's853642965']
[18924.0, 18924.0]
[272.0, 259.0]
[612, 612]
p03291
u415905784
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["S = input()\np = 10 ** 9 + 7\nDP = [0, 0, 0, 1]\ndp = [0] * 4\nfor i in range(len(S) - 1, -1, -1):\n for j in range(3, -1, -1):\n if j == 3:\n dp[j] = DP[3] * (3 if S[i] == '?' else 1) % p\n else:\n dp[j] += DP[j + 1] * (1 if S[i] == chr(65 + j) or S[i] == '?' else 0)\n dp[j] += DP[j] * (3 if S[...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s550009264', 's621354014', 's575675317']
[3188.0, 477408.0, 3188.0]
[2104.0, 2135.0, 345.0]
[381, 437, 305]
p03291
u419686324
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["init_input()\n\nS = input()\nn = len(S)\nmod = (10**9 + 7)\n\nA = [0] * n\nC = [0] * n\nQ = [0] * n\nBi = []\nQi = []\n\nfor i, s in enumerate(S):\n if s == 'A':\n A[i] = 1\n elif s == 'B':\n Bi.append(i)\n elif s == 'C':\n C[i] = 1\n else:\n Q[i] = 1\n Qi.append(i)\n\nf...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s346649331', 's731819490', 's924513069']
[3064.0, 27612.0, 27600.0]
[17.0, 216.0, 468.0]
[943, 905, 329]
p03291
u439396449
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["from scipy.misc import comb\n\nS = input()\nN = len(S)\nmod = 10 ** 9 + 7\n\n\nca = [0] * N\ncq1 = [0] * N\nif S[0] == 'A':\n ca[0] = 1\nif S[0] == '?':\n cq1[0] = 1\nfor i in range(1, N):\n if S[i] == 'A':\n ca[i] = ca[i - 1] + 1\n else:\n ca[i] = ca[i - 1]\n if S[i] == '?':\n cq1...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s326000239', 's980231518', 's667321213']
[39232.0, 39616.0, 27580.0]
[2112.0, 2110.0, 484.0]
[1225, 1139, 727]
p03291
u442581202
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['s = input()\n\nA = [1,0]\nAB = 0\nABC = 0\nD = 10**9 + 7\nfor c in s:\n if c == \'A\':\n A[1] += A[0]\n elif c == \'B\':\n AB += A[1]\n elif c == \'C\':\n ABC += AB\n elif c == \'?\':\n ABC = ABC*3 + AB\n AB *= 3#AB + C and AB + B and AB + C\n AB += A[1] # AB + B\...
['Wrong Answer', 'Accepted']
['s276446821', 's949721113']
[110068.0, 3188.0]
[2103.0, 169.0]
[413, 370]
p03291
u451017206
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['????C?????B??????A???????', "S=input()\ns=len(S)\ndp=[[0,0,0,0]for i in range(s+1)]\ndp[s][3]=1\nfor i in range(s-1,-1,-1):\n for j in[3,2,1,0]:\n dp[i][j]=(3 if S[i]=='?'else 1)*dp[i+1][j]\n if j!=3:dp[i][j]+=(1 if S[i]=='?'or S[i]=='ABC'[j]else 0)*dp[i+1][j+1]\n dp[i][j]%=(10**9+7)\nprint(dp...
['Runtime Error', 'Accepted']
['s218078629', 's310899053']
[2940.0, 27588.0]
[17.0, 467.0]
[25, 288]
p03291
u466917094
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['import numpy as np\ns=input()\nwayA=np.array([0,0,0,0])\nwayB=np.array([0,0,0,0])\nwayC=np.array([0,0,0,0])\nhatena=0\nfor c in s:\n\tif c=="A":\n\t\twayA[0]+=1\n\tif c=="B":\n\t\twayB+=wayA\n\tif c==\'C\':\n\t\twayC+=wayB\n\tif c==\'?\':\n\t\twayC[1]+=wayB[0]\n\t\twayC[2]+=wayB[1]\n\t\twayC[3]+=wayB[2]\n\t\twayB[1]+...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s045034256', 's108263142', 's251478746', 's301049842', 's576576648', 's647042059', 's653770318', 's847201610', 's857942143', 's407817383']
[12620.0, 21244.0, 21324.0, 5444.0, 14668.0, 21408.0, 21416.0, 12656.0, 12616.0, 18624.0]
[575.0, 2108.0, 2108.0, 2108.0, 2108.0, 1930.0, 1825.0, 569.0, 260.0, 1562.0]
[406, 319, 304, 589, 884, 333, 274, 455, 323, 317]
p03291
u474270503
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['MOD=10**9+7\ndef func(s):\n abc="ABC"\n n = len(s)\n dp=[[0 for _ in range(3+1)] for _ in range(n+1)]\n dp[n][3]=1\n\n for i in range(n-1,-1,-1):\n for j in range(3,-1,-1):\n if j==3:\n if s[i]==\'?\':\n dp[i][j]=(dp[i+1][j]*3)%MOD\n el...
['Wrong Answer', 'Accepted']
['s572397208', 's234515364']
[40868.0, 27572.0]
[462.0, 382.0]
[593, 579]
p03291
u498487134
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['S=input()\nN=len(S)', 'S=input()\nN=len(S)\ndp=[0,0,0]\n\nmod=10**9+7\n\np=[1]*(N+1)\nfor i in range(N):\n p[i+1]=p[i]*3', '\n\nS=input()\nN=len(S)\ndp=[0,0,0]\n\nmod=10**9+7\n\np=[1]*(N+1)\nfor i in range(N):\n p[i+1]=(p[i]*3)%mod\n\n\ncount=0\nfor i in range(N):\n if S[i]=="A":\n dp[0]=(dp[0]+p[coun...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s033625565', 's366659590', 's142672727']
[3192.0, 1039988.0, 7140.0]
[18.0, 967.0, 149.0]
[18, 92, 560]
p03291
u512007680
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['MOD = 10 ** 9 + 7\n\nS = list(input())\n\na = [0] * len(S)\nab = [0] * len(S)\nabc = [0] * len(S)\n\nif S[0] == "A" or S[0] == "?":\n a[0] = 1\n\nfor i in range(1,len(S)):\n if S[i] == "A":\n a[i] = a[i-1] + 1\n ab[i] = ab[i-1]\n abc[i] = abc[i-1]\n elif S[i] == "B":\n a[i] = a[i-...
['Wrong Answer', 'Accepted']
['s355120779', 's206146442']
[21996.0, 19536.0]
[175.0, 236.0]
[670, 921]
p03291
u518378780
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["s = input()\n\ndp3 = 1\ndp2 = 0\ndp1 = 0\ndp0 = 0\n\nfor i in reversed(range((len(s)))):\n m = 1\n m1 = 1\n m2 = 0\n m3 = 0\n m4 = 0\n if s[i] == '?':\n m = 3\n m1 = 3\n m2 = 1\n m3 = 1\n m4 = 1\n\n if s[i] == 'C':\n m2 = 1\n\n if s[i] == 'B':\n ...
['Runtime Error', 'Accepted']
['s214016101', 's787504372']
[3188.0, 3188.0]
[17.0, 171.0]
[561, 672]
p03291
u536113865
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["s = input()\nn = len(s)\nmod = 10**9+7\n\nmoji = [[0,0,0,0] for _ in range(n+1)]\n\nfor i in range(1,n+1):\n for k in range(4):\n moji[i][k] += moji[i-1][k]\n if s[i-1] == 'A':\n moji[i][0] += 1\n continue\n elif s[i-1] == 'B':\n moji[i][1] += 1\n continue\n elif s[i-1] ...
['Wrong Answer', 'Accepted']
['s788748621', 's454863205']
[29028.0, 29064.0]
[391.0, 407.0]
[707, 727]
p03291
u619379081
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["s = input()\ncount = 0\nlen = len(s)\ndef isa(char):\n if char == 'A' or char == '?':\n return 1\n else:\n return 0\ndef isc(char):\n if char == 'C' or char == '?':\n return 1\n else:\n return 0\nq = 0\nfor i in range(len):\n if s[i] == '?':\n q += 1\n else:\n ...
['Wrong Answer', 'Accepted']
['s741234023', 's794135520']
[3192.0, 3188.0]
[2104.0, 71.0]
[653, 320]
p03291
u623687794
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['s=input()\nmod=10**9+7\nretnum={"?":0,"A":1,"B":2,"C":3}\ncount=[[0 for i in range(len(s))] for j in range(4)]\nfor i in range(len(s)):\n for j in range(4):\n if retnum[s[i]] == j:\n count[j][i]=count[j][i-1]+1\n else:\n count[j][i]=count[j][i-1]\nans=0\nfor i in range(1,len(s)-...
['Runtime Error', 'Accepted']
['s456490693', 's611610846']
[9548.0, 13540.0]
[2104.0, 447.0]
[574, 647]
p03291
u623819879
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['a', 'a', "s=input()\n\nn=len(s)\ndc=dict()\ndc['A']=0\ndc['B']=1\ndc['C']=2\ndc['?']=3\ndp=[[0 for i in range(4)] for j in range(n+1)]\ndp[0][0]=1\nmo=10**9+7\nfor i in range(n):\n for t in range(4):\n ch=s[i]\n m = 1 if dc[ch]==t-1 or dc[ch]==3 else 0\n if t!=0:\n dp[i+1][t]+=(dp[i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s122439571', 's569579322', 's645816825']
[2940.0, 2940.0, 27616.0]
[17.0, 17.0, 580.0]
[1, 1, 391]
p03291
u627417051
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['\nm = (10 ** 9) + 7\nS = list(input())\nN = len(S)\ndp = [[0 for i in range(N + 2)] for j in range(3)]\nthree = [0 for i in range(10 ** 5 + 1)]\nthree[0] = 1\nfor i in range(1, 10 ** 5 + 1):\n\tthree[i] = (three[i - 1] * 3) % m\n\n#DP\nque = 0\nfor i in range(N):\n\tif S[i] == "A":\n\t\tdp[0][i + 1] = dp[0][i] + thre...
['Wrong Answer', 'Accepted']
['s086385046', 's896429587']
[30024.0, 19792.0]
[303.0, 272.0]
[851, 841]
p03291
u631277801
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["import sys\nstdin = sys.stdin\n\nsys.setrecursionlimit(10**5)\n\ndef li(): return map(int, stdin.readline().split())\ndef li_(): return map(lambda x: int(x)-1, stdin.readline().split())\ndef lf(): return map(float, stdin.readline().split())\ndef ls(): return stdin.readline().split()\ndef ns(): return stdin.readline()...
['Wrong Answer', 'Accepted']
['s541223615', 's421556522']
[15836.0, 15216.0]
[136.0, 373.0]
[1091, 1128]
p03291
u631914718
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['import sys\nsys.setrecursionlimit(10**7)\n\nmodulus = 10 ** 9 + 7\ns = input()\n\n\ndef dp(i, j):\n """\n dynamic programming for abc 104\n :param i: index of the given string\n :param j: count of letters of composed string (like \'ABC\')\n :return: the number of cases\n """\n if i == n:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s467310517', 's815756961', 's210103979']
[3188.0, 3188.0, 27588.0]
[19.0, 17.0, 504.0]
[733, 1034, 806]
p03291
u690536347
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['from itertools import accumulate as ac\ns=input()\nn=len(s)\nmod=int(1e9)+7\n\n*aca,=ac([0]+[1 if i=="A" else 0 for i in s])\n*acc,=ac([0]+[1 if i=="C" else 0 for i in s])\n*acq,=ac([0]+[1 if i=="?" else 0 for i in s])\n\nv=0\nfor i in range(1,n-1):\n if s[i]=="B" or s[i]=="?":\n a=aca[i]\n l=acq[i]\n c=acc...
['Wrong Answer', 'Accepted']
['s142570317', 's592796216']
[17220.0, 17220.0]
[971.0, 961.0]
[498, 507]
p03291
u726615467
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['import sys\n# input = sys.stdin.readline\nS = list(input())\np = 10 ** 9 + 7\n# p = 10 ** 18\n\nC = BC = ABC = 0\nfor Si in reversed(S):\n print("#", C, BC, ABC)\n if Si == \'C\':\n C = (C + 1) % p\n elif Si == \'B\':\n BC = (BC + C) % p\n elif Si == \'A\':\n ABC = (ABC + BC) % p\n ...
['Wrong Answer', 'Accepted']
['s149083729', 's554728909']
[7136.0, 3956.0]
[479.0, 110.0]
[847, 470]
p03291
u745514010
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['s=input()\ncount=0\nfor i in range(len(s)):\n if s[i]=="A" or s[i]=="?":\n for j in range(len(s)-1,i,-1):\n if s[j]=="C" or s[j]=="?":\n k=s[i+1:j]\n bb=k.count("B")\n dd=k.count("?")\n count=(count+bb*3**dd+dd*3**(dd-1))%(10**9+7)\nprin...
['Runtime Error', 'Runtime Error', 'Accepted']
['s379915058', 's710953288', 's412851226']
[3316.0, 3316.0, 32040.0]
[2104.0, 2104.0, 198.0]
[316, 325, 1053]
p03291
u769852547
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["S = input()\nMOD = 10**9+7\nA = 0\nC = S.count('C')\nQ = 0\nQMAX = S.count('?')\n\nans = 0\n\nb = 3 ** (QMAX-2) % MOD\nq = 3 ** (QMAX-3) % MOD\n\nfor s in S:\n if s == 'A':\n A += 1\n elif s == 'C':\n C -= 1\n elif s == 'B':\n \n ans = (ans + (3*A+q) * (3*C+QMAX-q) * b)%MOD\n e...
['Wrong Answer', 'Accepted']
['s770444506', 's360338344']
[3188.0, 3188.0]
[92.0, 87.0]
[426, 437]
p03291
u782098901
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["\n#include <string>\n\nusing namespace std;\n\nconst int MOD = 1000000007;\n\nint main() {\n string S;\n cin >> S;\n\n int len = S.size();\n ll a = 0, ab = 0, abc = 0, all_s = 1;\n\n for (int i = 0; i < len; i++) {\n if (S[i] == 'A')\n a = (a + all_s) % MOD;\n else if (S[i] == 'B')\n ab = (ab + a...
['Runtime Error', 'Accepted']
['s661588540', 's598099797']
[2940.0, 3188.0]
[18.0, 109.0]
[606, 410]
p03291
u786607349
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['s = input()\ndp = [[0 for _ in range(0,4)] for _ in range(0,len(s)+1)]\ndp[len(s)][3] = 1\ndp[len(s)][0] = 0\ndp[len(s)][1] = 0\ndp[len(s)][2] = 0\nabc = ["A","B","C"]\nfor i in range(len(s)-1,-1,-1):\n m = 1\n if s[i] == "?":\n m=3\n dp[i][3] += m * dp[i+1][3]\n\nfor i in range(len(s)-1,-1,-1):\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s342999738', 's808633167', 's575681323']
[1068580.0, 3188.0, 3188.0]
[2170.0, 110.0, 107.0]
[610, 454, 392]
p03291
u807772568
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['a = list(input())\n\ndp = [[0]*3 for i in range(len(a)+1)]\n\nppp ~ 1\nfor i in range(len(a))[::-1]:\n\tif a[i] == "A":\n\t\tdp[i][0] += dp[i+1][0] + dp[i+1][1]\n\t\tdp[i][1] += dp[i+1][1]\n\t\tdp[i][2] += dp[i+1][2]\n\telif a[i] == "B":\n\t\tdp[i][0] += dp[i+1][0]\n\t\tdp[i][1] += dp[i+1][1] + dp[i+1][2]\n\t\tdp[i][...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s042404060', 's197466155', 's524356780', 's617558070']
[2940.0, 25124.0, 25128.0, 23572.0]
[17.0, 282.0, 286.0, 293.0]
[637, 448, 449, 637]
p03291
u816116805
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["S=input()\n\nemp=1\nA=0\nAB=0\nABC=0\n\nbig = 10**9+7\n\n\n\nfor a in S:\n if a == 'A':\n (emp,A,AB,ABC)=(emp,emp+A,AB,ABC)\n if a == 'B':\n (emp,A,AB,ABC)=(emp,A,A+AB,ABC)\n if a == 'C':\n (emp,A,AB,ABC)=(emp,A,AB,AB + ABC)\n if a == '?':\n (emp,A,AB,ABC)=(3*emp%big, (emp+ 3*A...
['Wrong Answer', 'Accepted']
['s726533233', 's275901087']
[7372.0, 3188.0]
[318.0, 105.0]
[379, 355]
p03291
u833070958
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['inf = 1000000007\n\na = 0\nab = 0\nabc = 0\nr = 1\n \ns = input()\n \nfor c in s:\n if c == "A":\n a += r\n elif c == "B":\n ab += a\n elif c == "C":\n abc += ab\n else:\n abc = abc * 3 + ab\n ab = ab * 3 + a\n a = a * 3 + r\n r *= 3\n \n\ta %= inf\n\tab %=...
['Runtime Error', 'Runtime Error', 'Accepted']
['s831835185', 's915926085', 's355538686']
[2940.0, 2940.0, 3188.0]
[18.0, 18.0, 118.0]
[337, 682, 351]
p03291
u834415466
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["s=input()\nl=len(s)\na=[[0,0,0] for i in range(l)]\nnum=1\nfor i in range(l):\n if s[i]=='A':\n a[i][0]=a[i-1][0]+1*num\n a[i][1]=a[i-1][1]\n a[i][2]=a[i-1][2]\n if s[i]=='B':\n a[i][0]=a[i-1][0]\n a[i][1]=a[i-1][1]+a[i-1][0]\n a[i][2]=a[i-1][2]\n if s[i]=='C':\n ...
['Wrong Answer', 'Accepted']
['s943481453', 's998214126']
[32968.0, 22860.0]
[305.0, 247.0]
[669, 681]
p03291
u875361824
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['def main():\n \n S = input()\n ans3 = cumsum(S)\n\n print(ans3)\n \n\ndef cumsum(S):\n \n n = len(S)\n q = [0 for _ in range(n+1)]\n abc = [[0] * 3 for _ in range(n+1)]\n for i in range(n):\n is_q = S[i] == "?"\n q[i+1] += q[i] + int(is_q)\n\n # for j, c in enumerate...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s100158268', 's378404548', 's959852155', 's929935572']
[26748.0, 17012.0, 26740.0, 15000.0]
[2109.0, 801.0, 2109.0, 796.0]
[1895, 1989, 1890, 1999]
p03291
u886747123
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
['S = input()\nN = len(S)\nMOD = 10**9 + 7\n\ndef find_cumsum(X):\n output = [1] if S[0] == X else [0] \n for idx in range(1,N):\n if S[idx] == X:\n output.append(output[-1]+1)\n else:\n output.append(output[-1])\n return output\n\nq_count = S.count("?")\nA_cumsum = find_...
['Wrong Answer', 'Accepted']
['s352783266', 's307688499']
[20952.0, 3956.0]
[243.0, 119.0]
[1098, 644]
p03291
u906428167
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["s = input()\nls = len(s)\n\ndp = [[0]*4 for _ in range(ls+1)]\n\ndp[0][0] = 1\n\nfor i in range(ls):\n if s[i] == 'A':\n for j in range(4):\n dp[i+1][j] += dp[i][j]\n dp[i+1][1] += dp[i][0]\n elif s[i] == 'B':\n for j in range(4):\n dp[i+1][j] += dp[i][j]\n dp[i...
['Wrong Answer', 'Accepted']
['s221830739', 's357961653']
[1554804.0, 32440.0]
[1956.0, 405.0]
[543, 642]
p03291
u941407962
2,000
1,048,576
The _ABC number_ of a string T is the number of triples of integers (i, j, k) that satisfy all of the following conditions: * 1 ≤ i < j < k ≤ |T| (|T| is the length of T.) * T_i = `A` (T_i is the i-th character of T from the beginning.) * T_j = `B` * T_k = `C` For example, when T = `ABCBC`, there are three tr...
["string = '????C?????B??????A???????'\n#string = 'A??C'\nac = 0\nbc = 0\ncc = 0\nac2 = 0\nbc2 = 0\nbc3 = 0\nbc4 = 0\ncc2 = 0\ncc3 = 0\ncc4 = 0\ncc5 = 0\ncc6 = 0\ncc7 = 0\ncc8 = 0\nfor s in string:\n if s == 'A':\n ac += 1\n elif s == 'B':\n bc += ac\n bc2 += ac2\n elif s == 'C':\n ...
['Wrong Answer', 'Accepted']
['s187367052', 's870753872']
[3064.0, 3188.0]
[18.0, 78.0]
[665, 642]
p03292
u004025573
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a,b,c=map(int,input().split())\n\nprint(abs(a-b)+abs(b-c))', 'a,b,c=map(int,input().split())\n\nans=[a,b,c]\nans.sort()\n\nprint(abs(ans(0)-ans(1))+abs(ans(1)-ans(2)))', '\na,b,c=map(int,input().split())\n\nans=[a,b,c]\nans.sort()\n\nprint(abs(ans[0]-ans[1])+abs(ans[1]-ans[2]))']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s425854347', 's446951364', 's167498164']
[3064.0, 2940.0, 2940.0]
[20.0, 19.0, 17.0]
[56, 100, 101]
p03292
u020604402
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['L = list(map(int,input().split()))\nL = sorted(L)\nans += L[2]-L[1]\nans += L[1]-L[0]\nprint(ans)', 'L = list(map(int,input().split()))\nL = sorted(L)\nans = 0\nans += L[2]-L[1]\nans += L[1]-L[0]\nprint(ans)']
['Runtime Error', 'Accepted']
['s427694949', 's866883796']
[2940.0, 2940.0]
[18.0, 18.0]
[93, 101]
p03292
u023229441
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a,b,c=map(int(input().split())\nA=[a,b,c]\nA.sort()\nprint(abs(A[0]-A[1])+abs(A[1]-A[2]))\n\n \n', 'a,b,c=map(int(input().split())\nA=[a,b,c]\nsorted(A)\nprint(abs(A[0]-A[1])+abs(A[1]-A[2]))\n\n ', 'a,b,c=map(int,input().split())\nA=[a,b,c]\nsorted(A)\nprint(abs(A[0]-A[1])+abs(A[1]-A[2]))', 'import ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s438492641', 's519504041', 's932011176', 's834561018']
[2940.0, 2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0, 17.0]
[99, 99, 87, 156]
p03292
u029000441
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['import math\nimport collections\nimport sys\n\n#input = sys.stdin.readline\ndef I(): return int(input())\ndef MI(): return map(int, input().split())\ndef LI(): return list(map(int, input().split()))\ndef LI2(): return [int(input()) for i in range(n)]\ndef MXI(): return [[LI()]for i in range(n)]\n\nAS=LI()\nAS=sorted(...
['Wrong Answer', 'Accepted']
['s841542273', 's907460397']
[3316.0, 3316.0]
[21.0, 21.0]
[347, 338]
p03292
u037221289
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['list_task = list(map(int, input().split()))\nN = len(list_task)\n\nlist_task.reverse()\n\ntotal_cost = 0\nlast_number = list_task[0]\nlist_task.pop(0)\nfor i in list_task:\n total_cost += last_number - i\n last_number = i \nprint(total_cost)\n\n', 'list_task = list(map(int, input().split()))\nN = len(list_t...
['Wrong Answer', 'Accepted']
['s548624544', 's455267255']
[2940.0, 2940.0]
[20.0, 17.0]
[387, 410]
p03292
u039192119
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['*a=map(int,input().split())\nprint(max(a)-min(a))', '*a,=map(int,input().split())\nprint(max(a)-min(a))']
['Runtime Error', 'Accepted']
['s168894769', 's276748980']
[2940.0, 2940.0]
[17.0, 17.0]
[48, 49]
p03292
u047197186
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a1, a2, a3 = map(int, input().split())\nlst = sorted([a1, a2, a3])\nprint(abs(a2 - a1) + abs(a3 - a2))', 'a1, a2, a3 = map(int, input().split())\nelem1 = abs(a2 - a1) + abs(a3 - a2) \nelem2 = abs(a3 - a1) + abs(a2 - a3)\nelem3 = abs(a1 - a2) + abs(a3 - a1)\nelem4 = abs(a3 - a2) + abs(a1 - a3)\nelem5 = abs(a1 - a3) + ...
['Wrong Answer', 'Accepted']
['s025513184', 's757790867']
[2940.0, 3064.0]
[17.0, 17.0]
[100, 321]
p03292
u050698451
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['A = list(map(int, input().split()))\nN = len(A)\nA = A.sort()\nsum = 0\n\nfor i in range(1,N):\n\tsum += A[i]-A[i-1]\nprint(sum)', 'a, b, c = map(int, input().split())\nA = []\nA.append(a)\nA.append(b)\nA.append(c)\nA = A.sort()\nsum = 0\nfor i in range(4):\n\tsum += int(A[i]) - int(A[i-1])\nprint(sum)', 'from sys im...
['Runtime Error', 'Runtime Error', 'Accepted']
['s029191568', 's430362382', 's277587293']
[2940.0, 3060.0, 2940.0]
[18.0, 17.0, 20.0]
[120, 161, 100]
p03292
u052332717
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['li = list(input().split())\nli.sort()\n\nprint(li[2]-li[0])', 'li = list(map(int,input().split()))\nli.sort()\n\nprint(li[2]-li[0])']
['Runtime Error', 'Accepted']
['s719813953', 's376818954']
[2940.0, 2940.0]
[18.0, 17.0]
[56, 65]
p03292
u059262067
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a, b, c = (int(_) for _ in input().split()) \nprint(abs(a - b)+abs(b - c))\n\n\n\n', 'a = list(int(i) for i in input().split()) \na = sorted(a)\n\nprint(abs(a[0] - a[1]) + abs(a[1] - a[2]))\n\n\n\n']
['Wrong Answer', 'Accepted']
['s488785727', 's109001816']
[2940.0, 3060.0]
[17.0, 48.0]
[78, 105]
p03292
u059628848
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
["input()\na=list(map(int,input().split(' ')))\nsum=0\nfor i in a:\n sum+=i-1\nprint(sum)\n", "a=list(map(int,input().split(' ')))\nif a[0] < a[1]:\n if a[1] > a[2]:\n if a[0] < a[2]:\n temp = a[1]\n a[1] = a[2]\n a[2] = temp\n else:\n temp = a[0]\n ...
['Runtime Error', 'Accepted']
['s353490655', 's472575014']
[2940.0, 3064.0]
[17.0, 17.0]
[86, 601]
p03292
u063346608
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['A1,A2,A3 = map(int,input().split())\n\nx = abs(A1 - A2)\ny = abs(A2 - A3)\nz = abs(A3 - A1)\n\nif x + y <= y + z and x <= z + x:\n\tprint(x + y )\nelif y + z <= x + y and y + Z <= z + x:\n\tprint(y + z )\nelse:\n\tprint(z + x)', 'A1,A2,A3 = map(int,input().split())\n \nx = abs(A1 - A2)\ny = abs(A2 - A3)\nz = abs(A3 ...
['Runtime Error', 'Accepted']
['s939977241', 's880383036']
[3060.0, 3064.0]
[18.0, 17.0]
[213, 219]
p03292
u064563749
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['1,A2,A3=map(int,input().split())\nA=[A1,A2,A3]\nA.append(A1)\ndef A_(i):\n if A[i]-A[i+1]>=0:\n return A[i]-A[i+1]\n else:\n return A[i+1]-A[i]\nB=[A_(i) for i in range(3)]\nB.append(A_(0))\nB.append(A_(1))\ndef sum(j):\n return B[j]+B[j+1]\nC=[sum(j) for j in range(3)]\nprint(min(C))\n', 'A1,A...
['Runtime Error', 'Accepted']
['s010057394', 's778732723']
[3064.0, 2940.0]
[17.0, 17.0]
[295, 135]
p03292
u069533671
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['def main():\n cost_list = input().split()\n for i in range(len(cost_list)):\n cost_list[i] = int(cost_list[i])\n cost_list.sort()\n cost_list.reverse()\n counter = 0\n for i in range(len(cost_list) - 1):\n counter += cost_list[i+1] - cost_list[i]\n print(counter)\n\nmain()', 'def ma...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s085102906', 's085195443', 's171150216', 's326438601']
[3060.0, 3064.0, 3060.0, 3060.0]
[17.0, 19.0, 17.0, 17.0]
[297, 340, 294, 273]
p03292
u069925317
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['moji_S=input()\nmoji_T=input()\n\nflag=0\nfor i in range(len(moji_S)):\n\tif moji_S==moji_T:\n\t\tflag =1\n\t\tbreak\n\tmoji_S=moji_S[-1]+moji_S[0:-1]\nif flag:\n\tprint("Yes")\nelse:\n\tprint("No")\n', "A=list(map(int,input().split(' ')))\nA.sort()\ncost=A[1]-A[0]\ncost+=A[2]-A[1]\nprint(cost)"]
['Runtime Error', 'Accepted']
['s415475432', 's668690774']
[2940.0, 2940.0]
[17.0, 17.0]
[179, 87]
p03292
u072717685
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['A, B, C = map(int, input().split())\n\nr = abs(a-b) + abs(a-c) + abs(b-c)\nr = r - max(abs(a-b) , abs(a-c) , abs(b-c))\nprint(int(r))', 'a, b, c = map(int, input().split())\n \nr = abs(a-b) + abs(a-c) + abs(b-c)\nr = r - max(abs(a-b) , abs(a-c) , abs(b-c))\nprint(int(r))']
['Runtime Error', 'Accepted']
['s952231056', 's941292231']
[2940.0, 2940.0]
[17.0, 17.0]
[129, 130]
p03292
u073729602
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['import itertools\na1, a2, a3 = map(int, input().split())\nans = 10 ** 9\nfor v in itertools.permutations([a1, a2, a3]):\n d = 0\n for i in range(1, 3):\n d += abs(v[i]-v[i-1])\n ans = min(ans, d)\n print(v, d)\n\nprint(ans)\n', 'import itertools\na1, a2, a3 = map(int, input().split())\nans = 10 ** ...
['Wrong Answer', 'Accepted']
['s579046303', 's380405169']
[9108.0, 9092.0]
[27.0, 30.0]
[233, 217]
p03292
u075155299
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a,b,c = map(int,input().split())\n\ns=[abs(a-b),abs(a-c),abs(b-c)]\ns.sort()\nprint(abs(s[0]-s[1]))', 'a,b,c = map(int,input().split())\n\ns=[abs(a-b),abs(a-c),abs(b-c)]\ns.sort()\nprint(s[0]+s[1])']
['Wrong Answer', 'Accepted']
['s715165998', 's232020951']
[2940.0, 2940.0]
[17.0, 17.0]
[95, 90]
p03292
u094565093
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a=[int() for i in range(input().split())]\na.sort()\nprint(a[2]-a[0])', 'a = [int(i) for i in input().split()]\na.sort()\nprint(a[2]-a[0])']
['Runtime Error', 'Accepted']
['s843249485', 's916261176']
[2940.0, 2940.0]
[17.0, 18.0]
[67, 63]
p03292
u095426154
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['task=list(map(int,input().split(" ")))\nprint(task)\ntask.sort()\nprint(task)\ncost=0\n\nfor i in range(len(task)-1):\n cost+=task[i+1]-task[i]\nprint(cost)', 'task=list(map(int,input().split(" ")))\ntask.sort()\ncost=0\n\nfor i in range(len(task)-1):\n cost+=task[i+1]-task[i]\nprint(cost)']
['Wrong Answer', 'Accepted']
['s878622403', 's458202595']
[3064.0, 2940.0]
[18.0, 18.0]
[151, 127]
p03292
u096326554
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['S = list(input())\nT = list(input())\nS.sort()\nT.sort()\nif S == T:\n\tprint("Yes")\nelse:\n\tprint("No")', 'a_l = [int(a_v) for a_v in input().split()]\na_l.sort()\nprint(abs(a_l[0]-a_l[1])+abs(a_l[1]-a_l[2]))']
['Runtime Error', 'Accepted']
['s011079496', 's303155578']
[2940.0, 2940.0]
[17.0, 17.0]
[97, 99]
p03292
u102242691
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['\na = list(map(int,input().split()))\na.sort()\n\nprint(ans(a[3]-a[1]))\n', '\na = list(map(int,input().split()))\na.sort()\n\nprint(abs(a[2]-a[0]))\n']
['Runtime Error', 'Accepted']
['s158571426', 's520000127']
[2940.0, 2940.0]
[17.0, 17.0]
[68, 68]
p03292
u106103668
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a,b,c=map(int,input().split())\nprint(abs(a-b)+abs(b-c))', 'a=list(map(int,input().split()))\nprint(max(a)-min(a))']
['Wrong Answer', 'Accepted']
['s784148527', 's246478856']
[2940.0, 3316.0]
[17.0, 21.0]
[55, 53]
p03292
u107091170
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['A,B,C=map(int, input().split())\nd = [0 0 0]\nd[0] = abs(A-B)\nd[1] = abs(A-C)\nd[2] = abs(C-B)\nd.sort()\nprint(d[0]+d[1])\n', 'A,B,C=map(int, input().split())\nd = [0,0,0]\nd[0] = abs(A-B)\nd[1] = abs(A-C)\nd[2] = abs(C-B)\nd.sort()\nprint(d[0]+d[1])\n']
['Runtime Error', 'Accepted']
['s708916545', 's895212188']
[2940.0, 3060.0]
[17.0, 17.0]
[118, 118]
p03292
u113971909
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a = list(map(int,input()))\nprint(max(a)-min(a))', 'a = list(map(int,input().split()))\nprint(max(a)-min(a))']
['Runtime Error', 'Accepted']
['s323178629', 's196471423']
[2940.0, 2940.0]
[17.0, 17.0]
[47, 55]
p03292
u114366889
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['A = list(input())\nA.sort()\ncost =0\nfor i in range(len(A)-1):\n cost += abs(A[i]+A[i+1])\nprint(cost)', 'A = list(map(int,input().split()))\nA.sort()\nans = 0\nfor i in range(len(A)-1):\n\tans += abs(A[i]-A[i+1])\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s555531542', 's463091979']
[2940.0, 2940.0]
[18.0, 17.0]
[99, 114]
p03292
u118642796
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['N,M = map(int,input().split())\nrequests = []\nfor _ in range(M):\n a,b = map(int,input().split())\n requests.append([a,b])\n\nans = 1\nrequests = sorted(requests, key=lambda x:(x[1],x[0]))\nb = min(requests, key=lambda x:x[1])[1]\nfor i in range(M):\n if requests[i][0] < b:\n cont...
['Runtime Error', 'Accepted']
['s211086843', 's725684325']
[3064.0, 2940.0]
[19.0, 19.0]
[422, 111]
p03292
u119460590
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['N = int(input())\nprint(sum(list(map(int,input().split())))-N)', 'A = list(map(int, input().split())).sorted\nprint(A[2] - A[0])', 'A = list(map(int, input().split()).sorted\nprint(A[2] - A[0])', 'A = list(map(int, input().split()))\nA.sort()\nprint(A[2] - A[0])']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s212785495', 's672256480', 's744068575', 's756689219']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0, 18.0]
[61, 61, 60, 63]
p03292
u121732701
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a = list(map(int, input().split()))\ncount = 1000\nnum = 0\n\n\nfor i in a:\n for j in a:\n for k in a:\n num = abs(j-i)+abs(k-j)\n if count>num:\n count = num\n\nprint(num)', 'a = list(map(int, input().split()))\ncount = 1000\nnum = 0\n\n\nfor i in a:\n for j in a:\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s476998849', 's982366397', 's288743628']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0]
[208, 210, 51]
p03292
u122195031
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a = [map(int,input().split())]\na.sort()\nprint(abs(a[0]-a[1])+abs(a[1]-a[2])', 'a = list(map(int,input().split()))\na.sort()\nprint(abs(a[0]-a[1])+abs(a[1]-a[2]))']
['Runtime Error', 'Accepted']
['s138714009', 's784384244']
[2940.0, 3060.0]
[17.0, 19.0]
[75, 80]
p03292
u127499732
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['l=list(map(int,input().split()))\nl.sort()\nprint(l[1]+abs(l[1]-l[2]))\n', 'l=list(map(int,input().split()))\nl.sort()\nprint(abs(l[0]-l[1])+abs(l[1]-l[2]))\n']
['Wrong Answer', 'Accepted']
['s816055155', 's300952661']
[2940.0, 2940.0]
[17.0, 17.0]
[69, 79]
p03292
u128740947
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a, b, c = map(int,input().split())\nA = []\nA.append(a)\nA.append(b)\nA.append(c)\nA.sort()\nprint(A)\nprint((A[1]-A[0])+(A[2]-A[1]))', 'a, b, c = map(int,input().split())\nA = []\nA.append(a)\nA.append(b)\nA.append(c)\nA.sort()\nprint((A[1]-A[0])+(A[2]-A[1]))']
['Wrong Answer', 'Accepted']
['s392025461', 's679046380']
[3060.0, 3060.0]
[18.0, 18.0]
[126, 117]
p03292
u129978636
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['A = list(map( int, input().split()))\nA = sorted(A)\n\nA1 = int(A[1]-A[0])\nA2 = int(A[2]-A1)\n\nprint(A1+A2)\n\n', 'A = list(map( int, input().split()))\nA = sorted(A)\n \nA1 = int(A[1]-A[0])\nA2 = int(A[2]-A[1])\n \nprint(A1 + A2)']
['Wrong Answer', 'Accepted']
['s003914587', 's511796034']
[2940.0, 2940.0]
[19.0, 18.0]
[105, 109]
p03292
u131406572
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['L=list(map(int,input().split()))\nL.sort()\na=0\nfor i in range(len(L)-1):\n a+=L[i]-L[i-1]\n #print(i)\nprint(a)', 'L=list(map(int,input().split()))\nL.sort()\na=0\nfor i in range(1,len(L)):\n a=a+(L[i]-L[i-1])\n #print(L[i]-L[i-1])\nprint(a)']
['Wrong Answer', 'Accepted']
['s699753844', 's384290533']
[2940.0, 2940.0]
[17.0, 17.0]
[113, 126]
p03292
u131625544
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['A = list(map(int, input().split()))\nA.sort()\n\nans = 0\nfor i in range(1,3):\n ans += a[i] - a[i-1]\nprint(ans)', 'A = list(map(int, input().split()))\nA.sort()\n\nans = 0\nfor i in range(1,3):\n ans += A[i] - A[i-1]\nprint(ans)']
['Runtime Error', 'Accepted']
['s102411477', 's406156609']
[2940.0, 2940.0]
[18.0, 17.0]
[108, 108]
p03292
u141410514
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['import itertools\na=map(int,input().split())\nans=999\nl=[0,1,2]\nfor x in itertools(l,3):\n tmp=abs(a[x[0]]-a[x[1]])+abs(a[x[1]]-a[x[2]])\n if tmp <=ans:\n ans =tmp\nprint(ans)', 'import itertools\na=list(map(int,input().split()))\nans=999\nl=[0,1,2]\nfor x in itertools.permutations(l,3):\n tmp=abs(a[x[0]]-a[x...
['Runtime Error', 'Accepted']
['s373303907', 's731616508']
[3060.0, 3060.0]
[18.0, 18.0]
[174, 193]
p03292
u143318682
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['# -*- coding: utf-8 -*-\nA = map(int, input().split())\nA = sorted(A)\nprint(A[1] - A[0] + A[2] - A[0])', '# -*- coding: utf-8 -*-\nA = map(int, input().split())\nA = sorted(A)\nprint(A[1] - A[0] + A[2] - A[1])']
['Wrong Answer', 'Accepted']
['s260888427', 's118997451']
[2940.0, 2940.0]
[19.0, 17.0]
[100, 100]
p03292
u145600939
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a = mlist(map(int,input().split()))\na.sort()\nprint(a[2] - a[0])', 'a = list(map(int,input().split()))\na.sort()\nprint(a[2] - a[0])\n']
['Runtime Error', 'Accepted']
['s144858273', 's254557608']
[2940.0, 3064.0]
[18.0, 18.0]
[63, 63]
p03292
u146346223
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['arr = map(int, input().split())\nprint(max(arr) - min(arr))', 'arr, =map(int, input().split())\nprint(max(arr) - min(arr))', 'arr = list(map(int, input().split()))\nprint(max(arr) - min(arr))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s500989568', 's514629756', 's610536344']
[2940.0, 3060.0, 2940.0]
[17.0, 19.0, 17.0]
[58, 58, 64]
p03292
u151171672
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a = [int(x) for x in input().split()]\n\na.sort(reverse=True)\n\nprint(a[2] - a[0])', 'a = [int(x) for x in input().split()]\n\na.sort(reverse=True)\n\nprint(abs(a[2] - a[1]) + abs(a[1] - a[0]))']
['Wrong Answer', 'Accepted']
['s471010518', 's210998941']
[3064.0, 2940.0]
[17.0, 18.0]
[79, 103]
p03292
u151625340
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a = list(map(int,input().split()))\ns = sum(a)\nans = 1000\nfor i in range(3):\n for j in range(3):\n if i == j:\n continue\n b = abs(A[i]-A[j])+abs(A[j]-(a-(A[i]+A[j])))\n ans = min(ans,b)\nprint(ans)', 'A = list(map(int,input().split()))\ns = sum(A)\nans = 1000\nfor i in range(3):...
['Runtime Error', 'Accepted']
['s809742399', 's573512820']
[3060.0, 3060.0]
[18.0, 17.0]
[227, 227]
p03292
u154979004
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['*a = map(int, input().split())\nprint(max(a) - min(a))', '*a = map(int, input().split())\nprint(max(a) - min(a))', '*a, = map(int, input().split())\nprint(max(a) - min(a))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s248693486', 's657205609', 's962332688']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0]
[53, 53, 54]
p03292
u155687575
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['lst = list(map(int, input().split()))\nsor = sorted(lst)\ncost = 0\nfor i in range(len(sor)):\n if i == 0:\n continue\n else:\n cost = abs(sor[i]-sor[i-1])\nprint(cost)', '# A\nlst = list(map(int, input().split()))\nsor = sorted(lst)\ncost = 0\nfor i in range(len(sor)):\n if i == 0:\n co...
['Wrong Answer', 'Accepted']
['s667939449', 's161970673']
[3060.0, 3060.0]
[17.0, 17.0]
[180, 185]
p03292
u160861278
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
["// B103.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。\n//\n\n\n#include <algorithm>\n\nusing namespace std;\n\nint main()\n{\n\tint a[3];\n\tcin >> a[2] >> a[1] >> a[0];\n\tsort(a, a + 3);\n\tcout << abs(a[0] - a[1]) + abs(a[1] - a[2]) << endl;\n\n\treturn 0;\n}\n", 'import math\nA = list(map(int, input()....
['Runtime Error', 'Accepted']
['s614369755', 's078317745']
[2940.0, 3060.0]
[17.0, 17.0]
[356, 95]
p03292
u163320134
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a,b,c=map(int,input().split())\ns=abs(a-b)+abs(b-c)+abs(c-a)\nmn=max(abs(a-b)+abs(b-c)+abs(c-a))\nprint(s-mn)', 'a,b,c=map(int,input().split())\ns=abs(a-b)+abs(b-c)+abs(c-a)\nm=max(abs(a-b),abs(b-c),abs(c-a))\nprint(s-m)']
['Runtime Error', 'Accepted']
['s384898762', 's386220029']
[3064.0, 2940.0]
[17.0, 17.0]
[106, 104]
p03292
u163449343
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a,b,c = map(int, input().split())\nprint(c-a)', 'a,b,c = sorted(map(int, input().split()))\nprint(c-a)']
['Wrong Answer', 'Accepted']
['s564050426', 's249028819']
[2940.0, 2940.0]
[17.0, 17.0]
[44, 52]
p03292
u167161639
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['from statistics import median\n\ntask=[0,0,0]\n\nfor i in range(3):\n a=input()\n task[i]=int(a)\n \nb=median(task)\nsum=0\n\nfor i in range(3):\n sum+=abs(b-task[i])\n \nsum', 'from statistics import median\n\ntask=[int(i) for i in input().split()]\n \nb=median(task)\nsum=0\n\nfor i in range(3):\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s181102811', 's852924670', 's942402033']
[5660.0, 5400.0, 5080.0]
[50.0, 41.0, 37.0]
[175, 148, 155]
p03292
u168416324
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['l=list(map(int,input().split()))\nl.sort(reverse=True)\nans=0\nbef=l[0]\nfor i in l:\n ans+=abs(bef-i)\nprint(ans)', 'l=list(map(int,input().split()))\nl.sort(reverse=True)\nans=0\nbef=l[0]\nfor i in l:\n ans+=abs(bef-i)\n bef=i\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s109377668', 's554472208']
[9116.0, 9116.0]
[26.0, 27.0]
[109, 118]
p03292
u170324846
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['A = [int(x) for x in input()split()]\nA.sort()\nprint(A[2] - A[0])', 'A = [int(x) for x in input().split()]\nA.sort()\nprint(A[2] - A[0])']
['Runtime Error', 'Accepted']
['s885230327', 's003357310']
[2940.0, 2940.0]
[18.0, 18.0]
[64, 65]
p03292
u181195295
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['*a = map(int, input().split())\n\nprint(max(a)-min(a))', '*a ,= map(int, input().split())\n\nprint(max(a)-min(a))\n']
['Runtime Error', 'Accepted']
['s748326758', 's761033690']
[2940.0, 3064.0]
[17.0, 17.0]
[52, 54]
p03292
u181949308
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['inp = [input() for _ in range(2)]\ns = inp[0]\nt = inp[1]\n\ns = list(s)\nt = list(t)\ncheck = []\nfor i in t:\n if i in s:\n s[s.index(i)] = 0\n check.append(0)\n\nif s == check:\n print("Yes")\nelse:\n print("No")', 'task = input().split()\nfor i, j in enumerate(task):\n task[i] = int(j)\ntask...
['Runtime Error', 'Accepted']
['s113717827', 's543595125']
[3060.0, 2940.0]
[17.0, 17.0]
[219, 134]
p03292
u183896397
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['A = [ int(i) for i in input().split()]\n\nX = [ abs(A[0] - A[1]),abs(A[1] - A[2]),abs(A[0] -A[2])]\n\nX = X.sort()\nans = X[1] + X[2]\nprint(ans)', 'A1,A2,A3 =(int(i) for i in input().split())\n\nx = abs(A1-A2)\ny = abs(A2-A3)\nz = abs(A3-A1)\n\nN = [x,y,z]\nN.sort()\nans = N[0] + N[1]\nprint(ans)']
['Runtime Error', 'Accepted']
['s037137899', 's589038991']
[3060.0, 3060.0]
[17.0, 19.0]
[139, 140]
p03292
u185806788
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['ns=list(map(int,input().split()))\nns.sort()\nprint(ns[2]-ns[1])\n', 'ns=list(map(int,input().split()))\nns.sort()\nprint(ns[2]-ns[0])\n']
['Wrong Answer', 'Accepted']
['s516922483', 's407795896']
[2940.0, 2940.0]
[17.0, 18.0]
[63, 63]
p03292
u190907730
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a = list(map(int, input().split()))\na.sort\nprint(a[2]-a[0])', 'a = list(map(int, input().split()))\na.sort()\nprint(a[2]-a[0])\n']
['Wrong Answer', 'Accepted']
['s500726915', 's326228865']
[2940.0, 2940.0]
[17.0, 17.0]
[59, 62]
p03292
u195396655
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['a, b, c = map(int, input().split())\n\nif a > max(b, c):\n print(a - max(b,c))\nelif a < max(b, c):\n print(max(b, c))\n', '*a, = map(int, input().split())\nprint(max(a) - min(a))']
['Wrong Answer', 'Accepted']
['s593354782', 's506278098']
[2940.0, 2940.0]
[17.0, 17.0]
[120, 54]
p03292
u197078193
2,000
1,048,576
You have three tasks, all of which need to be completed. First, you can complete any one task at cost 0. Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|. Here, |x| denotes the absolute value of x. Find the minimum total cost required to complete all the task.
['A=[int(i) for i ininput().split()]\nA.sort()\nprint(A[2]-A[0])', 'A=[int(i) for i input().split()]\nA.sort()\nprint(A[2]-A[0])', 'A=[int(i) for i in input().split()]\nA.sort()\nprint(A[2]-A[0])']
['Runtime Error', 'Runtime Error', 'Accepted']
['s046909148', 's095356292', 's718192140']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[60, 58, 61]