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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03200 | u054471580 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['t = input()\ns = input()\ns = s.split()\nlist=[]\nfor i in range(len(s)):\n list.append(int(s[i]))\n\nkind = 1\ncounter=0\n\nfor i in range(len(list)-1):\n if(list[i]>=list[i+1]):\n if(kind==1):\n kind = kind + 1\n else:\n if(counter==kind-1):\n kind = kind + 1\n counter=0 \n e... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s238978262', 's509729483', 's718819403', 's847945686', 's877853956', 's048250540'] | [3500.0, 4968.0, 2940.0, 3628.0, 3628.0, 4840.0] | [19.0, 76.0, 17.0, 18.0, 17.0, 83.0] | [358, 194, 179, 743, 743, 192] |
p03200 | u086127549 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['def integration(s):\n itg = [0]\n counter = 0\n for x in s:\n if x == "B":\n counter += 1\n itg.append(counter)\n return itg\n\ndef solve(s, itg):\n print(s,itg)\n n = len(s)\n if n <= 1:\n return 0\n a = solve(s[0:n//2], itg[0:n//2+1])\n b = solve(s[n//2:n], itg[n//2:n+1])\n res = a + b + \\\... | ['Wrong Answer', 'Accepted'] | ['s379404231', 's303330622'] | [48868.0, 11136.0] | [1332.0, 158.0] | [409, 431] |
p03200 | u112317104 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["A = list(input())\nn = len(A)\n\ncount = 0\nfor _ in range(n):\n for i in reversed(range(1, n)):\n if A[i-1] == 'B' and A[i] == 'W':\n A[i] = 'B'\n A[i-1] = 'W'\n count += 1\n\nprint(A)\nprint(count)\n", "A = list(input())\nn = len(A)\n\ncount = 0\nfor i in reversed(range(1... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s000813546', 's617756650', 's766222845', 's037714599'] | [4840.0, 4840.0, 4840.0, 4840.0] | [2104.0, 56.0, 76.0, 49.0] | [232, 203, 188, 128] |
p03200 | u116702662 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s = input('')\nbc = 0\nc = 0\n\nfor i in range(0,len(s)):\n\tif s[i] == 'B':\n \tbc += 1\n elif s[i] == 'W':\n \tc += bc\n \nprint(c)\n\t\n", "s = input('')\nbc = 0\nc = 0\n\nfor i in range(0,len(s)):\n if s[i] == 'B':\n bc += 1\n elif s[i] == 'W':\n c += bc\n \nprint(c)"] | ['Runtime Error', 'Accepted'] | ['s334626385', 's744273563'] | [2940.0, 3500.0] | [18.0, 66.0] | [139, 129] |
p03200 | u121161758 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['if __name__ == "__main__":\n S = input()\n ans = 0\n bcount = 0\n for i in range(len(S)):\n if S[i] == \'B\':\n bcount += 1\n else:\n ans += bcount\n\u200b\n print(ans)', 'S = input()\nbcount = 0\nans = 0\nfor i in range(len(S)):\n if S[i] == "B":# countup B(= emp... | ['Runtime Error', 'Accepted'] | ['s913156079', 's813854841'] | [2940.0, 3500.0] | [17.0, 60.0] | [204, 197] |
p03200 | u131638468 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["count=0\nosero=input()\ns=[]\nfor i in osero:\n s.append(i)\nfor i in range(len(s)-1):\n for j in range(i,len(s)-1):\n if s[j]=='B' and s[j+1]=='W':\n s[j]='W'\n s[j+1]='B'\n count+=1\nprint(count)", "s=input()\nans=0\nw=0\nfor i in range(1,len(s)+1):\n if s[i-1]=='W':\n ans += i-w-1\n w+=1... | ['Wrong Answer', 'Accepted'] | ['s478545796', 's701209674'] | [5096.0, 3500.0] | [2104.0, 79.0] | [206, 102] |
p03200 | u135116520 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['import collections\nS=list(input())\nc=collections.Counter(S)\nn=c["W"]\ns=0\ni=0\nwhile "B" in S[0:n]:\n if S[i]=="B" and S[i+1]=="W":\n S[i]="W" and S[i+1]="B"\n s+=1\n i=i\n else:\n i+=1\nprint(s)\n', 'import collections\nS=list(input())\nN=len(S)\nn=S.count("W")\ns=0\ni=0\nwhile "B" in S[:n] and i<=... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s402365982', 's725433656', 's881424950', 's903033870'] | [3056.0, 6552.0, 6308.0, 4840.0] | [17.0, 2104.0, 2104.0, 64.0] | [201, 228, 198, 119] |
p03200 | u143492911 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s=list(input())\nn=len(s)\ntotal_b=0\ncnt=0\ntotal=0\nfor i in range(n):\n if s[i]=="B":\n total_b+=i\n cnt+=1\nfor i in range(n-cnt,n):\n total+=i\nprint(total-total_b)\nprint(total,total_b)\n', 's=list(input())\nn=len(s)\ntotal_b=0\ncnt=0\ntotal=0\nfor i in range(n):\n if s[i]=="B":\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s562064696', 's998434984', 's244454688'] | [4840.0, 4840.0, 4840.0] | [98.0, 97.0, 96.0] | [200, 181, 201] |
p03200 | u176208232 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['S = input()\nwhite = 0\ntotal = 0\nfor i in range len(S):\n if S[i] == "W":\n total += (i - white)\n white ++\n \nprint(total)', 'from sys import stdin\n\nS = stdin.readline().rstrip()\n#S = input()\nwhite = 0\ntotal = 0\nfor i in range len(S):\n if S[i] == "W":\n total += (i - white... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s147437853', 's314308137', 's588572225', 's060568147'] | [2940.0, 2940.0, 2940.0, 3500.0] | [17.0, 17.0, 17.0, 69.0] | [142, 199, 145, 200] |
p03200 | u177132624 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s=input()\nanswer-0\ncounter=0\nfor i in range(len(s)-1,-1,-1):\n if s[i]=="B":\n answer += len(s)-i-1-counter\n counter += 1\nprint(answer)\n \n \n ', 's=input()\ncounter=0\nwhile s.find("BW"):\n s.replace("BW","WB")\n counter+=1\nprint(counter)\n ', 's=input()\nanswer-0\ncounter=0\nfor i in ran... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Time Limit Exceeded', 'Accepted'] | ['s045025051', 's156079104', 's236048760', 's569493294', 's894168014'] | [3500.0, 3500.0, 3500.0, 3500.0, 3500.0] | [19.0, 2104.0, 18.0, 2104.0, 95.0] | [153, 97, 158, 94, 159] |
p03200 | u181083204 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['# -*- coding: utf-8 -*-\n\n\ns = input()\n\ncount=0\nanswer=0\nprint(s)\nstr_list = list(s)\n\nfor i in range(len(s)):\n if str_list[i]=="W":\n answer=answer+i-count\n count=count+1\n \nprint(answer)\n', 's = input()\ncount=0\nanswer=0\nfor i in range(len(s)):\n if s[i]=="W":\n answer=answer+i-count\n ... | ['Wrong Answer', 'Accepted'] | ['s097209287', 's555816968'] | [5096.0, 3500.0] | [75.0, 71.0] | [240, 132] |
p03200 | u197300260 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['# _*_ coding:utf-8 _*_\n\n\nfrom collections import Counter\n\ndef maxCountPair(n_ballCount,a_ballDatas):\n\ta_ballDatas.sort(reverse=True)\n\tballDictBox = Counter(a_ballDatas)\n\tballCountRange = range(0,n_ballCount)\n\tpairCount = 0\n\tfor i in ballCountRange:\n\t\tgetBallNumber = a_ballDatas[i]\n\t\tgetBallNumbe... | ['Runtime Error', 'Accepted'] | ['s162666387', 's307005997'] | [3880.0, 19304.0] | [22.0, 81.0] | [1044, 741] |
p03200 | u200516156 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["txt = input()\ntxt_list = list(txt)\n\nnum = 0\ncount = 0\nfor i in range(len(txt)):\n if txt_list[i] == 'W':\n count += i-num \n num += 1\n\nprint(txt_list, count)", "txt = input()\ntxt_list = list(txt)\n\ncount = 0\n\nwhile True:\n pre_count = count\n for i in range(len(txt)-1):\n if t... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s068556898', 's784911101', 's681592163'] | [7908.0, 7780.0, 4840.0] | [87.0, 2104.0, 73.0] | [171, 358, 161] |
p03200 | u206570055 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["S = input()\nlength = len(S)\nfor c in S:\n if c == 'B':\n countB += 1\nsoko = 1\nans = 0\nfor i in range(length):\n if S[-i-1] == 'B':\n ans += i + 1 - soko\n soko += 1\nprint(ans)", "S = input()\nlength = len(S)\nsoko = 1\nans = 0\nfor i in range(length):\n if S[-i-1] == 'B':\n ... | ['Runtime Error', 'Accepted'] | ['s526445053', 's268272095'] | [3500.0, 3500.0] | [57.0, 82.0] | [198, 149] |
p03200 | u219607170 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["import numpy as np\n# S = input()\nS = 'BWBWBW'\nS_mask = np.array([True if s=='W' else False for s in S])\n# print(S_mask.sum())\nW_indices = np.where(S_mask)[0]\n# print(idx.sum())\nW_num = S_mask.sum()\n# print(idx)\nprint(W_indices.sum() - (W_num-1)*W_num//2)", "import numpy as np\nS = input()\n# S = 'BWBWBW'\nS_... | ['Wrong Answer', 'Accepted'] | ['s759749162', 's145223867'] | [21528.0, 14560.0] | [795.0, 177.0] | [254, 254] |
p03200 | u227082700 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['a,s,b=0,input(),0\nfor i in range(len(s)):a+=i*(s[i]=="W");b+=1\nprint(a-((b*(b-1))//2))', 'a,b,s=0,input(),0\nfor i in range(len(s)):a+=i*(s[i]=="W");b+=1\nprint(a-((b*(b-1))//2))', 'a,s,b=0,input(),0\nfor i in range(len(s)):\n if s[i]=="W":a+=i;b+=1\nprint(a-((b*(b-1))//2))'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s731624325', 's760907692', 's301994495'] | [3500.0, 3500.0, 3500.0] | [80.0, 18.0, 70.0] | [86, 86, 90] |
p03200 | u228232845 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['import sys\n\n\ndef input(): return sys.stdin.readline().strip()\ndef I(): return int(input())\ndef LI(): return list(map(int, input().split()))\ndef IR(n): return [I() for i in range(n)]\ndef LIR(n): return [LI() for i in range(n)]\ndef SR(n): return [S() for i in range(n)]\ndef S(): return input()\ndef LS(): return... | ['Runtime Error', 'Accepted'] | ['s974338094', 's800594194'] | [9336.0, 9380.0] | [70.0, 66.0] | [1019, 523] |
p03200 | u239342230 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['S = list(str(input()))\n\nans = 0\ncnt = 0\nfor i in range(len(S)-1):\n if S[i] == "B" and S[i+1] == "W":\n S[i+1] = "B"\n ans = ans + i + 1\n cnt = cnt + 1 \n\nprint(ans - cnt)', 's = input()\nans = 0\ncount = 0\nfor i in range(len(s)):\n if s[i] == "W":\n ans += i - count\n ... | ['Wrong Answer', 'Accepted'] | ['s207383430', 's424101863'] | [4840.0, 3500.0] | [92.0, 69.0] | [191, 128] |
p03200 | u239725287 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["S = list(input())\nn = len(S)\ncnt_b = 0\ncnt = 0\nfor i in range(n):\n if S[i] == 'B':\n cnt_b += 1\n cnt += i\nans = (2*n - cnt_b -1)*cnt_b*0.5 -cnt\nprint(ans)", "S = list(input())\nn = len(S)\ncnt_b = 0\ncnt = 0\nfor i in range(n):\n if S[i] == 'B':\n cnt_b += 1\n cnt += i\nans =... | ['Wrong Answer', 'Accepted'] | ['s426750539', 's271432048'] | [4840.0, 4840.0] | [69.0, 70.0] | [170, 176] |
p03200 | u240630407 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['S = input()\nnum = 0\nwhile(True):\n num += S.count("BW")\n S = S.replace("BW", "WB")\n print(S)\n if not "BW" in S:\n break\nprint(num)', 'S = input()\nindexes = [i for i, x in enumerate(S) if x == "W"]\nprint(sum([x-i for i, x in enumerate(indexes)]))'] | ['Runtime Error', 'Accepted'] | ['s658106687', 's485608483'] | [134588.0, 13032.0] | [1583.0, 51.0] | [147, 111] |
p03200 | u244459371 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s = input()\ncnt = 0\nfor i in s:\n if i == 'W':\n cnt += 1\nprint(cnt)", "s = input()\nret = 0\nst = 0\nfor i in range(len(s)):\n if (s[i] == 'W'):\n ret += (i-st)\n st += 1\nprint(ret)"] | ['Wrong Answer', 'Accepted'] | ['s709858601', 's029192441'] | [3500.0, 3500.0] | [41.0, 70.0] | [76, 121] |
p03200 | u253479302 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['# -*- coding:utf-8 -*-\nS = list(input())\n\nloop_idx = 0\nloop_len = -(-len(S)//2)\ncnt = 0\n\nif len(S) == 1:\n pass\nelse:\n while loop_idx < loop_len:\n while True:\n if S[0] == "W":\n S.pop(0)\n else:\n break\n while True:\n if S[... | ['Runtime Error', 'Accepted'] | ['s850019358', 's581130377'] | [10560.0, 10480.0] | [2206.0, 71.0] | [575, 184] |
p03200 | u268516119 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['#AGC030 B - Powers of two\nbeki=[]\nfor i in range(1,32):\n beki.append(2**i)\ndef tasitekesu(data,n):\n result=[]\n kosu=0\n for i in range(len(data)):\n if i in result:\n continue\n for j in range(i):\n if j in result:\n continue\n if data[i]... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s083719193', 's224652746', 's266307754', 's268690876', 's388504041', 's465592945'] | [3500.0, 3500.0, 3500.0, 3500.0, 5096.0, 5096.0] | [19.0, 19.0, 19.0, 19.0, 77.0, 81.0] | [821, 418, 437, 385, 383, 388] |
p03200 | u282347497 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s = input()\nn = len(s)\nsum = [0] * (n + 1)\nsum[0] = (s[0] == 'B')\nfor i in range(1 , n):\n\tsum[i] = sum[i-1] + (s[i] == 'B')\nans = 0\nfor i in range(n, -1 ,-1):\n\tprint(i)\n\tif s[i] == 'W':\n\t\tans += sum[i]\nprint(ans)\n\t", "s = input()\nn = len(s)\nsum = [0] * (n + 1)\nsum[0] = (s[0] == 'B')\nfor i in ran... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s088902936', 's329599092', 's428752782', 's316000722'] | [16876.0, 16804.0, 17088.0, 16748.0] | [73.0, 71.0, 149.0, 108.0] | [214, 204, 217, 208] |
p03200 | u289288647 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['from itertools import permutations\nN = int(input())\n\nval = []\nfor _ in range(N):\n val.append(int(input()))\nans = 10**10\nfor i in permutations(val):\n for j in range(1, N):\n ans = min(max(sum(i[:j]), sum(i[j:])), ans)\nif N == 1:\n print(val[0])\nelse:\n print(ans)\n \n\n \n', "S = inp... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s883598198', 's886790223', 's371772261'] | [9376.0, 9232.0, 9148.0] | [28.0, 98.0, 56.0] | [290, 142, 129] |
p03200 | u297651868 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["/*test*/\n#include<bits/stdc++.h>\n\nusing namespace std;\n\nint main() {\n int i = 0,b = 0, bko = 0, sum = 0;\n string s;\n cin >> s;\n for (i = 0; i < s.size(); i++) {\n if (s[i] == 'B') {\n b += bko;\n bko += 1;\n sum += s.size() - 1 - i;\n }\n }\n c... | ['Runtime Error', 'Accepted'] | ['s900164618', 's877563049'] | [2940.0, 4840.0] | [17.0, 76.0] | [341, 131] |
p03200 | u303037478 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s=list(input())\n\nima=0\nwNum=0\nfor i in range(len(s)):\n if s[i]=="W":\n ima += i\n wNum += 1\n\ndef kasan(n):\n if n==0:\n return 0\n else:\n return kasan(n-1) + n\n\nprint(0)\n#if wNum==0:\n# print(0)\n#else:\n\n# print(ima-saigo)', 's=list(input())\n\nima=0\nwNum=0\nfor i in range(len(s)):\n i... | ['Wrong Answer', 'Accepted'] | ['s247362017', 's856848958'] | [4840.0, 4840.0] | [74.0, 73.0] | [256, 216] |
p03200 | u303059352 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s,t,a=input(),0,0\nfor c in s:\n t+=1 if c is 'B' else a+=t\nprint(a)", "cnt = ans = 0\nfor c in input():\n if c is 'W':\n ans += cnt\n else:\n cnt += 1\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s473352511', 's836622132'] | [2940.0, 3500.0] | [18.0, 48.0] | [67, 93] |
p03200 | u308684517 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["# -*- coding: utf-8 -*-\nS = input()\nN = len(S)\nS = list(S)\n\ncount = 0\ncount2 = 0\nkekka = 0\nfor i in range(len(S)):\n\tif(S[i] == 'W'):\n\t\tcount = count + 1\n\t\tcount2 = count2 + i\nfor j in range(count):\n\tkekka = kekka + N - j\n\nprint(kekka-count2)", "# -*- coding: utf-8 -*-\nS = input()\nN = len(S)\nS ... | ['Wrong Answer', 'Accepted'] | ['s699609606', 's149012558'] | [4840.0, 4840.0] | [99.0, 109.0] | [241, 243] |
p03200 | u309039873 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['S = array(input())\nprint(S)', "S = list(input().strip())\nis_irrversible = 0\nanswer = 0\nposition_key_sum = 0\nnumber_of_white = 0\nfor i in range(len(S)):\n if S[i] == 'W':\n position_key_sum += i\n number_of_white += 1\nanswer = position_key_sum - number_of_white\nprint(answer)", "S = list(input(... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s079904265', 's524044597', 's345953510'] | [2940.0, 4840.0, 4840.0] | [19.0, 69.0, 91.0] | [27, 257, 294] |
p03200 | u336721073 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['S = input()\n\narr = [0 if s == "W" else 1 for s in S]\n\nstate = [arr[i] * i for i in range(len(S))]\nfinal_state = [sorted(arr)[i] * i for i in range(len(S))]\n\nprint(final_state - state)', 'S = input()\n \narr = [0 if s == "W" else 1 for s in S]\nsorted_arr = sorted(arr)\n \nstate = [arr[i] * i for i in range(len... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s250347862', 's750685682', 's825670810', 's875721686'] | [14568.0, 22504.0, 14568.0, 14568.0] | [2104.0, 85.0, 2104.0, 90.0] | [183, 404, 380, 221] |
p03200 | u363074342 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["S = list(input())\nans = 0\nb = 0\nprint(S)\nfor i in range(len(S)):\n if S[i] == 'B':\n b += 1\n else:\n ans += b\n \nprint(ans)", "S = list(input())\nans = 0\nb = 0\nfor i in range(len(S)):\n if S[i] == 'B':\n b += 1\n else:\n ans += b\n \nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s081160146', 's699543156'] | [7584.0, 4840.0] | [73.0, 56.0] | [146, 137] |
p03200 | u364386647 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['import sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.rea... | ['Wrong Answer', 'Accepted'] | ['s858514402', 's046950021'] | [16652.0, 16932.0] | [76.0, 62.0] | [902, 296] |
p03200 | u369402805 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s = list(input())\nret, counter = 0, 0\nfor a in s:\n if a == "B":\n counter += 1\n else:\n ret += counter\n', 's = list("BWBWBW" * 10000)\n\ns = list(input())\nret, counter = 0, 0\nfor a in s:\n if a == "B":\n counter += 1\n else:\n ret += counter\nprint(str(ret))'] | ['Wrong Answer', 'Accepted'] | ['s679337438', 's568336946'] | [4840.0, 5352.0] | [48.0, 46.0] | [121, 164] |
p03200 | u373047809 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s = input()\nprint(sum(s[:i].count("B") for i in range(len(s)) if s[i]=="W")', 'c = b = 0\nfor s in input():\n c += b*(s=="W")\n b += s=="B"\nprint(c)'] | ['Runtime Error', 'Accepted'] | ['s756812636', 's515341303'] | [2940.0, 3500.0] | [17.0, 73.0] | [75, 68] |
p03200 | u377834804 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["S = input()\nW = []\n\nfor i, s enumerate(S):\n if s == 'W':\n W.append(i)\n\nidx = 0\nans = 0\nfor w in W:\n ans += w-idx\n idx += 1\n\nprint(ans)", "S = input()\nW = []\n \nfor i, s in enumerate(S):\n if s == 'W':\n W.append(i)\n\nidx = 0\nans = 0\nfor w in W:\n ans += w-idx\n idx += 1\n\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s075713009', 's470837495'] | [8804.0, 17048.0] | [27.0, 87.0] | [140, 144] |
p03200 | u377989038 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s = sorted(list(input()), reverse=True)\nans = []\ntmp = 0\nfor i in s:\n if i == "W":\n tmp += 1\n ans.append(tmp)\nprint(sum(ans))', 's = input()[::-1]\nans = []\ntmp = 0\nfor i in s:\n if i == "W":\n tmp += 1\n elif i == "B":\n ans.append(tmp)\nprint(sum(ans))'] | ['Wrong Answer', 'Accepted'] | ['s131683673', 's443927202'] | [12424.0, 5924.0] | [70.0, 54.0] | [142, 139] |
p03200 | u384261199 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['import numpy as np\nS = input()\n\nidx = []\ni = 0\nfor s in S:\n if s == "W":\n idx.append(i)\n i+=1\nprint(int(np.sum(idx) - (len(idx))))', 'import numpy as np\nS = input()\n\nidx = []\ni = 0\nW_flag = False\nfor s in S:\n if not W_flag:\n if s == "W":\n continue\n elif s ==... | ['Wrong Answer', 'Accepted'] | ['s875914904', 's532648387'] | [26360.0, 26256.0] | [1224.0, 1147.0] | [143, 310] |
p03200 | u387914114 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["def main():\n s = np.array(list(input()))\n \n ind = np.array(np.where(s=='B'))\n \n len_ind=ind.shape[1]\n \n len=s.shape[0]\n \n dist=np.arange(len-len_ind,len)\n \n ans=np.sum(dist-ind)\n return ans", "import numpy as np\ndef main():\n s = np.array(list(input()))\n \n i... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s081503424', 's537950006', 's628671643', 's920724451', 's382798202'] | [2940.0, 12504.0, 2940.0, 3064.0, 18064.0] | [17.0, 161.0, 17.0, 28.0, 191.0] | [287, 306, 284, 247, 246] |
p03200 | u394731058 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["ans = 0\nans2 = 0\ns = input()\nl = len(s)\nt = 1\nfor i in range(l):\n print(f'a={t}')\n same = True\n while same:\n if s[i] != s[t]:\n i = t\n print(f'b={t}')\n same = False\n else:\n ans += 1\nprint(max(ans, ans2))\n", "import sys\n\ninput = sys.stdin.readline\n\ndef main():\n ans =... | ['Time Limit Exceeded', 'Accepted'] | ['s156214940', 's334783388'] | [9288.0, 9140.0] | [2206.0, 41.0] | [232, 253] |
p03200 | u395381395 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["txt = input()\ntxt_list = list(txt)\n\ncount = 0\nn_b = 0\nn_w = 0\ni = 0\nfor i in range(len(txt_list)):\n print(txt_list[i])\n if txt_list[i] == 'W':\n n_w += 1\n if (i>=1 and txt_list[i-1] == 'W' and txt_list[i] == 'B') or (i==len(txt_list)-1 and txt_list[i] == 'W'):\n count += n_b * n_w\n ... | ['Wrong Answer', 'Accepted'] | ['s653900718', 's396182355'] | [5860.0, 4840.0] | [269.0, 159.0] | [418, 353] |
p03200 | u397531548 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['import math\nN=int(input())\nA=list(map(int,input().split()))\nA.sort()\ns=0\ni=1\nwhile i<=len(A)-1:\n a=int(math.log2(A[-i]))\n if 2**(a+1)-A[-i] in A[:-i]:\n s+=1\n A.remove(2**(a+1)-A[-i])\n i+=1\n else:\n i+=1\nprint(s)', 'import math\nN=int(input())\nA=list(map(int,input().s... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s151597203', 's888521824', 's570820846'] | [3500.0, 3628.0, 3500.0] | [19.0, 19.0, 79.0] | [247, 728, 100] |
p03200 | u405256066 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['ans=0\nfor i in range(1000000):\n cnt=N.count("BW")\n ans=ans+cnt\n N=N.replace("BW","WB")\n N=N.lstrip("W")\n N=N.rstrip("B")\n if cnt==0:\n break\nprint(ans)', 'from sys import stdin\nN=(stdin.readline().rstrip())\nans=0\nfor i in range(10000):\n index=N.find("W")\n if index==-1:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s306902741', 's830794207', 's635984980'] | [2940.0, 3500.0, 4840.0] | [17.0, 17.0, 46.0] | [175, 186, 153] |
p03200 | u419354839 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['#S = input().strip()\nSb = [c == "B" for c in S]\n\ndef reverse(Sb,i):\n _list = Sb.copy()\n _list[i] = not _list[i]\n return _list\n\ndef operate_onestep(Sb):\n _list = Sb.copy()\n cnt = 0\n flg = True\n while flg:\n flg = False\n for i in range(len(_list)-1):\n if _list... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s214772105', 's559870295', 's516571910'] | [3064.0, 10440.0, 3500.0] | [17.0, 2104.0, 71.0] | [505, 787, 163] |
p03200 | u427344224 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['N = int(input())\nA_list = list(map(int, input().split()))\ntwo_list = [2 ** i for i in range(32)]\n \ncount = 0\nitems = {}\nfor a in A_list:\n if a in items:\n items[a] += 1\n \n else:\n items[a] = 1\nA_list.sort(reverse=True)\n \nfor a in A_list:\n if items[a] >= 1:\n \n for t in two_... | ['Runtime Error', 'Accepted'] | ['s563384464', 's265814314'] | [3500.0, 5096.0] | [19.0, 86.0] | [728, 219] |
p03200 | u428132025 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s = input()\nans = 0\nnumB = 0\nfor i in reversed(range(len(s))):\n if s[i] == 'B':\n ans += len(s) - 1 - i - numB\n numB += 1\n print(ans)", "s = input()\nans = 0\nnumB = 0\nfor i in reversed(range(len(s))):\n if s[i] == 'B':\n ans += len(s) - 1 - i - numB\n numB += 1\nprint(... | ['Wrong Answer', 'Accepted'] | ['s826457459', 's983712546'] | [4456.0, 3500.0] | [217.0, 89.0] | [156, 148] |
p03200 | u434208140 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['import collections\n \nn=int(input())\na=list(map(int,input().split()))\na.sort(reverse=True)\nc=collections.Counter(a)\nans=0\nfor i in a:\n for j in range(31):\n if(2**j>i):\n k=2**j-i\n break\n if k in c.keys():\n if i==k and c[i]>1:\n c[i]-=2\n ans+=1\n elif i!=k and c[i]>0 and c[k]... | ['Runtime Error', 'Accepted'] | ['s811085053', 's855270287'] | [3756.0, 3500.0] | [22.0, 72.0] | [358, 86] |
p03200 | u445511055 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['# -*- coding: utf-8 -*-\n\n\ndef main():\n """Function."""\n s = str(input())\n num = len(s)\n\n total = 0\n for _ in range(num//2+1):\n print(_)\n count = s.count("BW")\n if count == 0:\n break\n else:\n total += count\n s_list = list(s)\n\n... | ['Wrong Answer', 'Accepted'] | ['s046066838', 's435120241'] | [32556.0, 3500.0] | [2104.0, 53.0] | [545, 298] |
p03200 | u447528293 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["N = int(input().rstrip())\nA = [int(s) for s in input().rstrip().split()]\nA.sort()\n\nsquared = [2]\ntmp = 2\nwhile tmp < 2 * 10**9:\n tmp *= 2\n squared.append(tmp)\n\npairs = []\nfor i in range(N):\n for j in range(i+1, N):\n if A[i] + A[j] in squared:\n pairs.append([A[i], A[j]])\n\nado... | ['Runtime Error', 'Accepted'] | ['s628149447', 's247142555'] | [3628.0, 3500.0] | [19.0, 57.0] | [674, 144] |
p03200 | u464032595 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["S = list(input())\ncnt = 0\nfor i, a in enumerate(S):\n if a == 'W':\n cnt += i-1\nprint(cnt)", "S = list(input())\ncnt = call = 0\nfor i, a in enumerate(S):\n if a == 'W':\n cnt += i-call\n call += 1\nprint(cnt)"] | ['Wrong Answer', 'Accepted'] | ['s312621105', 's875069131'] | [4840.0, 4840.0] | [60.0, 75.0] | [92, 116] |
p03200 | u465062650 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["osero = input();\nlen = len(osero);\ncon_b = 0;\ncon = 0;\nfor(i =0; i<len, i++) {\n\tif(osero[i]='B') {\n\t\tcon_b++;\n\t}\n\tif(osero[i] ='W') {\n\t\tcon = con + con_b;\n\t}\n}\nprint(con)", "osero = input();\nlen = len(osero);\ncon_b = 0;\ncon = 0;\nfor i in range(0,len):\n\tif osero[i]=='B':\n\t\tcon_b = con_b + ... | ['Runtime Error', 'Accepted'] | ['s243739167', 's042057676'] | [2940.0, 3500.0] | [17.0, 68.0] | [170, 169] |
p03200 | u466335531 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["S=list(input())\nn=len(S)\n\ndef search(t):\n for i in range(t,n-1):\n if S[i]=='B' and S[i+1]=='W':\n S[i],S[i+1]='W','B'\n if t>0:\n return 1+search(t-1)\n else:\n return 1+search(1)\n return 0\n\nprint(search(0))\n", "S=list(input())\nn=le... | ['Runtime Error', 'Accepted'] | ['s363643548', 's438035490'] | [5564.0, 4840.0] | [2104.0, 53.0] | [279, 98] |
p03200 | u475503988 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s = input()\nslist = list(s)\nl = len(s)\nn = 0\nj = 1\nstart = 0\nend = l-1\n\nwhile j != 0:\n j = 0\n for i in range(start, end):\n if slist[i:i+2] == ['B','W']:\n slist[i:i+2] = ['W','B']\n n += 1\n j = 1\n end = i\n start += 1\n# end -= 1\n\nprint(n)", "s = input()\nslist = list(s)\nl =... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s417649797', 's884842183', 's166675188'] | [4968.0, 4840.0, 3500.0] | [2104.0, 2104.0, 116.0] | [262, 264, 163] |
p03200 | u480472958 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['N, As = int(input()), list(map(int, input().split()))\nmaxA, ans = max(As), 1\nwhile True:\n if pow(ans, maxA) - 1 > N:\n break\n ans += 1\nprint(ans)', "ans, w_idx = 0, 0\nfor i, s in enumerate(input()):\n if s != 'W':\n continue\n ans += i - w_idx\n w_idx += 1\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s988334931', 's346455767'] | [3500.0, 3500.0] | [21.0, 75.0] | [157, 130] |
p03200 | u500297289 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['"""AtCoder"""\n\nS = input()\n\nans = 1\ntmp = 1\n\nfor i in range(len(S)):\n if S[i] == \'W\':\n ans += i - tmp + 1\n tmp = i + 1\n\nprint(ans)\n', '"""AtCoder"""\n\nS = input()\n\nans = 0\ntmp = 0\n\nfor i in range(len(S)):\n if S[i] == \'W\':\n ans += i - tmp\n tmp += 1\n\nprint(a... | ['Wrong Answer', 'Accepted'] | ['s167476016', 's382563190'] | [3500.0, 3500.0] | [74.0, 69.0] | [148, 141] |
p03200 | u517152997 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["# -*- coding: utf-8 -*-\n# \nimport math\nimport sys\nimport itertools\nimport numpy as np\n\n\nm = list(input())\nprint(m)\nanswer = 0\n\nfor i in range(len(m)):\n if m[i] == 'W':\n for j in range(i):\n if m[j] == 'B':\n answer += 1\n\nprint(answer)\n", "# -*- coding: utf-8 -*-\n#... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s562543790', 's838446460', 's624513385'] | [17168.0, 19012.0, 24352.0] | [2108.0, 220.0, 1084.0] | [269, 248, 249] |
p03200 | u517447467 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s = input()\nl = len(s)\nb_num = sum([1 for w in s if w == "B"])\nb_pos = sum([i for i,w in enumerate(s) if w == "B"])\nmax_num = sum([i for i in range(l-b_num, l)])\nprint(max_num - b_num)', 's = input()\nl = len(s)\nb_num = sum([1 for w in s if w == "B"])\nb_pos = sum([i for i,w in enumerate(s) if w == "B"])\nmax_n... | ['Wrong Answer', 'Accepted'] | ['s631800087', 's537625759'] | [11084.0, 11080.0] | [58.0, 57.0] | [184, 184] |
p03200 | u522665179 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['def main(a):\n s=0\n t=0\n for i in range(0,len(a)):\n if a[i]=="B":\n s+=len(a)-i-1\n t+=1\n return s-t*(t-1)/2\n\na=input()\nprint(main(a))', 'def main(a):\n s=0\n t=0\n for i in range(0,len(a)):\n if a[i]=="B":\n s+=len(a)-i-1\n t+=1\n return s-t*(t-1)/2\n\na=input()\nprint(int(ma... | ['Wrong Answer', 'Accepted'] | ['s059625326', 's374069653'] | [3500.0, 3500.0] | [67.0, 66.0] | [148, 153] |
p03200 | u532966492 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s=input()\nprint(sum([s[i+1]!=s[i] for i in range(len(s)-1)]))', 's=list(reversed(list(input())))\nans=0\ncnt=0\nfor i in range(len(s)):\n if s[i]=="W":\n cnt+=1\n else:\n ans+=cnt\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s734609977', 's110111171'] | [5096.0, 6180.0] | [52.0, 60.0] | [61, 138] |
p03200 | u540572789 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['S = input()\ncount_B = 0\nright_W = 0\nfor i in S:\n if i == "B":\n count_B += 1\n else:\n right_W = i\nrb = len(S) - right_W - 1\nprint(count_B - rb)', 'S = input()\ncount_ans = 0\ncount_B = 0\nright_W = 0\nfor i, c in enumerate(S):\n\tif c == "W":\n\t\tcount_ans += count_B\n\telse:\n\t\tcount_B += 1\nprint(... | ['Runtime Error', 'Accepted'] | ['s843975651', 's482641465'] | [3500.0, 3500.0] | [43.0, 56.0] | [149, 151] |
p03200 | u543954314 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s = input()\nans = 0\nwhile b:\n b = 0\n c = s.count("BW")\n if c:\n ans += c\n b = 1\n s = s.replace("BW", "WB")\nprint(ans)\n', 's = input()\nt = 0\nc = 0\nfor i in range(len(s)):\n if s[i] == "W":\n t += i\n c += 1\nprint(t-c*(c-1)//2)'] | ['Runtime Error', 'Accepted'] | ['s021371953', 's771281123'] | [3500.0, 3500.0] | [18.0, 74.0] | [129, 107] |
p03200 | u547537397 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s = input()\n \nn = len(s)\n \nans = 0\n \ncunt = 0\n \nfor i in range(n):\n if s[i] == "B":\n cnt += 1\n else:\n ans += cunt\nprint(ans)', 's = input()\n \nn = len(s)\n \nans = 0\n \ncunt = 0\n \nfor i in range(n):\n if s[i] == "B":\n cunt += 1\n else:\n ans += cunt\nprint(ans... | ['Runtime Error', 'Accepted'] | ['s564241300', 's381240582'] | [9336.0, 9264.0] | [50.0, 62.0] | [144, 145] |
p03200 | u548545174 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['S = input()\n \nans = 1\nfor i in range(len(S)):\n if S[i] == "B":\n ans += S[i:].count("W")\n\nprint(ans)', 'S = input()\n\nans = 1\nfor i in range(len(S)):\n if S[i] == "B":\n ans *= S[i:].count("W")\n\nprint(ans)\n', 'S = input()\nN = len(S)\n \nans = 1\nfor i in range(N):\n if S[i] == "B":\... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s085233829', 's089820453', 's981468103', 's863854785'] | [3500.0, 3500.0, 3500.0, 3500.0] | [2107.0, 2104.0, 2104.0, 45.0] | [109, 109, 115, 129] |
p03200 | u564837886 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s = input()\nans = 0\n\ndef reverse(s,i):\n if s[i] == 'B' and s[i+1] == 'B':\n\ts[i] = 'W'\n\ts[i+1] = 'B'\n ans += 1\n \nwhile True:\n s = ans\n for i in range(len(s) - 1):\n reverse(s,i)\n if s == ans:\n print(ans)\n break", "s = input()\nans = 0\n\ndef reverse(s,i):\n if s[i] == 'B' and s[i+1] =... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s025165132', 's509267474', 's546746352', 's862682136'] | [2940.0, 2940.0, 2940.0, 3500.0] | [17.0, 17.0, 17.0, 109.0] | [225, 226, 6, 186] |
p03200 | u575431498 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | [" = [i for i in input()]\nf = True\ni = 0\ncnt = 0\nwhile True:\n if s[i] == 'B' and s[i+1] == 'W':\n cnt += 1\n s[i] = 'W'\n s[i+1] = 'B'\n i += 1\n f = False\n else:\n i += 1\n if i >= len(s) - 1:\n if f:\n break\n i = 0\n f = True\np... | ['Runtime Error', 'Accepted'] | ['s743506324', 's293292623'] | [2940.0, 12708.0] | [17.0, 97.0] | [309, 252] |
p03200 | u575956662 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["import collections\ns = list(input())\nAns = 0\nc = collections.Counter(s)\nd = c['B']\nfor i in range(len(s)):\n if s[i] == 'B':\n for j in range(len(s)-i-1):\n if s[i+j+1]=='W':\n Ans += j+1\n s[i] = 'W'\n s[i+1] = 'B'\n s[i+j+1] = 'B'... | ['Runtime Error', 'Accepted'] | ['s442130937', 's310864550'] | [8988.0, 10536.0] | [20.0, 67.0] | [367, 152] |
p03200 | u576335153 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s = input()\nl = []\nfor i in range(len(s)-1, -1, -1):\n if s[i] == 'B':\n l.append(0)\n else:\n l.append(1)\ncnt = 0\n\nfor j in range(len(s)**0.5):\n for i in range(j, len(s) - 1, 2):\n if l[i] == 1 and l[i+1] == 0:\n l[i] = 0\n l[i+1] = 1\n cnt += 1\n\... | ['Runtime Error', 'Accepted'] | ['s436428824', 's054301591'] | [11200.0, 9312.0] | [55.0, 52.0] | [314, 123] |
p03200 | u578694888 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["# -*- coding: utf-8 -*-\n\ns=input()\n\ncnt=0\ncum=0\n\nfor i in range(len(s)):\n if s[i]=='W':\n cnt+=1\n cum+=i\nprint(cum-int((cnt+1)*cnt/2))\n", "# -*- coding: utf-8 -*-\n\ns=input()\n\ncnt=0\ncum=0\n\nfor i in range(len(s)):\n if s[i]=='W':\n cnt+=1\n cum+=i\nprint(cum-int((cnt-... | ['Wrong Answer', 'Accepted'] | ['s787393390', 's361639814'] | [3500.0, 3500.0] | [66.0, 67.0] | [151, 151] |
p03200 | u580362735 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["S = str(input())\ncount = 0;\nfor i in range(100000)\n count=count+S.count('BW');\n S = S.replace('BW','WB');\n if 'BW' not in S:break;\nprint(count)\n", "S = input()\nans = 0\ntmp = 0\nfor i in range(len(S)):\n if S[i] == 'W':\n ans+=i-tmp\n else:\n tmp+=1\nprint(ans)", "S = input()\nans = 0\ntmp = 0\nfor... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s619807575', 's621113641', 's560907911'] | [2940.0, 3500.0, 3500.0] | [17.0, 68.0, 71.0] | [147, 114, 107] |
p03200 | u580697892 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['# coding: utf-8\ndef calc(state, print_state):\n times = 0\n while "BW" in print_state:\n for i in range(len(state)):\n if state[i] == "B":\n if i < len(state)-1 and state[i+1] == "W":\n state[i] = "W"\n state[i+1] = "B"\n times += 1\n ... | ['Runtime Error', 'Accepted'] | ['s867082227', 's895427281'] | [3064.0, 4840.0] | [21.0, 74.0] | [514, 137] |
p03200 | u581403769 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s = list(input())\n\ncount = 0\nwhite = 0\nfor i in range(len(s)):\n if s[i] == 'W':\n count += i\n white += 1\n \nprint(count - white)", "s = list(input())\n\ncount = 0\nwhite = 0\nfor i in range(len(s)):\n if s[i] == 'W':\n count += i - white\n white += 1\n\nprint(count)\n"] | ['Wrong Answer', 'Accepted'] | ['s074874248', 's513024875'] | [10568.0, 10556.0] | [67.0, 66.0] | [150, 143] |
p03200 | u584174687 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["data = list(input())[::-1]\n\ncount = 0\n\n# while 1:\ncount_b = 0\nfor i in range(len(data)):\n # print(i)\n if data[i] == 'W':\n count += count_b\n # count += 1\n # data[i], data[i+1] = 'B', 'W'\n # break\n else:\n count_b += 1\n # else:\n # break\nprint(count)\... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s749260039', 's921526563', 's644652541'] | [6304.0, 3628.0, 4840.0] | [58.0, 19.0, 58.0] | [308, 1672, 302] |
p03200 | u593005350 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['import collections\nN=int(input())\nx=list(map(int,input().split()))\nc=collections.Counter(x)\nt=[2**i for i in range(len(str(bin(max(x)*2))[2:])+1)[::-1]]\ncount=0\n#print(c)\n#print("x=",x)\n#print("t=",t)\nfor i in range(len(x))[::-1]:\n if x[i] != 0:\n for j in range(0,len(t)):\n if t[j] <= ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s197911011', 's576069435', 's826363979', 's916936941', 's519370152'] | [3884.0, 134900.0, 3884.0, 3884.0, 7528.0] | [26.0, 457.0, 23.0, 22.0, 83.0] | [805, 280, 675, 565, 328] |
p03200 | u602715823 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['import re\n\ns = input()\na = [m.start() for m in re.finditer("W", s)]\n\nans = 0\nfor i, e in enumerate(a):\n ans += e - (i + 1)\n\nprint(ans)\n', 'import re\n\ns = input()\na = [m.start() for m in re.finditer("W", s)]\n\nans = 0\nfor i, e in enumerate(a):\n ans += e - i\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s503000381', 's345352794'] | [11624.0, 11624.0] | [95.0, 83.0] | [138, 132] |
p03200 | u617515020 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["S=list(input())\na=[0]*len(S)\ncnt=0\nj=len(S)-1\nfor i in range(len(S)-1,-1,-1):\n if S[i]=='W':\n a[i]=a[j]+1\n j=i\n else:\n a[i]=0\nprint(sum(a))", "S=list(input())\ncnt=0\nans=0\nfor i in range(len(S)-1,-1,-1):\n if S[i]=='W':\n cnt+=1\n else:\n ans+=cnt\n\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s267352592', 's292653551'] | [18244.0, 10500.0] | [72.0, 59.0] | [150, 119] |
p03200 | u675918663 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['import re\nimport sys\n\nl = line = next(map(str.strip, sys.stdin))\n\ncount = 0\nprev = None\nwhile prev is None or prev != line:\n prev = line\n count += len(re.findall("BW", line))\n line = line.replace("BW", "WB")\n\nprint(count)\n\nline = l\n\ncount = 0\nnb_bs = 0\nfor i, c in enumerate(line):\n if c... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s223087007', 's809462843', 's886983441', 's988095295'] | [10272.0, 3500.0, 3444.0, 3760.0] | [2104.0, 18.0, 19.0, 73.0] | [397, 370, 483, 217] |
p03200 | u681917640 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['from collections import Counter\n\nn = int(input())\nnums = sorted(list(map(int, input().split())), reverse=True)\n\nnum_map = Counter(nums)\n\nanswer = 0\nfor num in nums:\n pair = (1 << (num.bit_length())) - num\n\n if num_map[num] > 0 and num_map[pair]:\n if num == pair and num_map[num] > 1:\n ... | ['Runtime Error', 'Accepted'] | ['s951935162', 's120177445'] | [3756.0, 3500.0] | [22.0, 56.0] | [464, 165] |
p03200 | u695644361 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s=list(input())\nc=i=0\nwhile i<len(s)-1:\n\tt,u=s[i],s[i+1]\n\tif t>=u:i+=1\n\telse:\n\t\tt,u=u,t\n\t\tc+=1\n\t\tif i>1:i-=1\nprint(c)', "s=input()\nr=w=0\nfor c,i in zip(s,range(len(s))):\n\tif c=='W':\n\t\tr+=i-w\n\t\tw+=1\nprint(r)"] | ['Time Limit Exceeded', 'Accepted'] | ['s477447026', 's154719109'] | [4840.0, 3500.0] | [2104.0, 77.0] | [117, 85] |
p03200 | u713914478 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s = input()\nans = 0\ntmp = 0\n#saving the number of black\n#counting the numbers\n\nfor c in s:\n\tif s == "B":\n\t\ttmp += ans\n\telse:\n\t\tans += tmp\n\nprint(ans)', 's = input()\nans = 0\ntmp = 0\n#saving the number of black\n#counting the numbers\n\nfor c in s:\n\tif s == "B":\n\t\ttmp += 1\n\telse:\n\t\tans +=... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s212721738', 's883087336', 's877638583'] | [3500.0, 3500.0, 3500.0] | [40.0, 41.0, 46.0] | [149, 147, 152] |
p03200 | u730476362 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["S = input()\ncounter = 0\n# while True:\n# tmp=S.count('BW')\n# if tmp == 0:\n# print(counter)\n# break\n# else:\n# counter+=tmp\n# S=S.replace('BW','WB')\n\n# i=0\n# while True:\n# tmp = S[i:].find('W')\n# print(S[i:])\n# if tmp == -1:\n# print(counter)... | ['Wrong Answer', 'Accepted'] | ['s852320838', 's466621836'] | [3500.0, 3500.0] | [74.0, 70.0] | [472, 504] |
p03200 | u747703115 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['print(TODO)', "s = input()\nr = 0\nc = 0\nfor i in range(len(s)):\n if s[i]=='B':\n c += 1\n else:\n r += c\nprint(r)"] | ['Runtime Error', 'Accepted'] | ['s650044572', 's721798599'] | [2940.0, 3500.0] | [17.0, 55.0] | [11, 114] |
p03200 | u760171369 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["import numpy as np\nS = input()\nb_num = S.count('B')\nw_num = len(S) - b_num\nend = 2**(w_num + 1) - 1\nstart = 0\nfor i in range(len(S)):\n if S[i] == 'W':\n start += np.power(2, i)\nprint(np.log2(start / end))", "import numpy as np\nS = input()\nb_num = S.count('B')\nw_num = len(S) - b_num\nend = 2**(w_num + 1... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s528722843', 's806449726', 's186152924'] | [22788.0, 2940.0, 3500.0] | [1778.0, 17.0, 56.0] | [207, 206, 116] |
p03200 | u762488523 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["temp=input()\nS=list(temp)\ncounter1=0\ncounter2=0\ncounter3=0 \ni=len(S)-1\n\nwhile True:\n if S[i-1]=='B' and S[i]=='W':\n S[i-1]='W'\n S[i]='B'\n counter1 +=1\n i -=1\n if i ==0:\n if counter1==counter2:\n break\n counter2=counter1\n for j in range(len(... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s109613848', 's836506428', 's561929859'] | [4840.0, 4840.0, 3500.0] | [2104.0, 2104.0, 60.0] | [415, 330, 142] |
p03200 | u766684188 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["import sys\ninput=sys.stdin.readline\nS=input()\nl=len(S)\nw_idx=0\ncnt=0\nfor i in range(n):\n if S[l]=='W':\n cnt+=i-w_idx\n w_idx+=1\nprint(cnt)", "import sys\nS=sys.stdin.readline()\nl=len(S)\nw_idx=0\ncnt=0\nfor i in range(l):\n if S[i]=='W':\n cnt+=i-w_idx\n w_idx+=1\nprint(cnt... | ['Runtime Error', 'Accepted'] | ['s807865689', 's434892745'] | [3316.0, 3372.0] | [18.0, 71.0] | [154, 142] |
p03200 | u771532493 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["S=input()[::-1]\nans,tmp=0,0\nfor i in S:\n if i=='W'\n tmp+=1\n else:\n ans+=tmp\nprint(ans)", "S=list(input())\na=0\nfor i in range(len(S):\n if S[i]=='W':\n a+=L[:i].count('B')\nprint(a)\n \n ", "S=input()[::-1]\nans,tmp=0,0\nfor i in S:\n if i=='W':\n tmp+=1\n else:\n ans+=tmp\nprint(ans... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s044857870', 's393172506', 's612956572'] | [2940.0, 2940.0, 3500.0] | [18.0, 17.0, 44.0] | [94, 101, 95] |
p03200 | u777028980 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['hoge=input()\nans=0\ncount=0\nwhite=0\nfor i in hoge:\n \n if(i=="W"):\n ans+=count - white\n white+=1\n count+=1\n \nprint(count)', 'hoge=input()\nans=0\ncount=0\nwhite=0\nfor i in hoge:\n \n if(i=="W"):\n ans+=count - white\n white+=1\n \n count+=1\n \nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s400602953', 's405500135'] | [3500.0, 3500.0] | [75.0, 78.0] | [129, 132] |
p03200 | u778814286 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['\n###template###\nimport sys\ndef input(): return sys.stdin.readline().rstrip()\nimport heapq\nINF = float("inf")\ndef mi(): return map(int, input().split())\ndef ii(): return int(input())\n###template###\n\n\nS = ii()\n\nprev = 0\nsum = 0\nfor c in S:\n if c == \'B\':\n prev += 1\n else:\n sum += prev\n \... | ['Runtime Error', 'Accepted'] | ['s941509041', 's200814216'] | [3628.0, 3628.0] | [19.0, 46.0] | [306, 309] |
p03200 | u785578220 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s = input() + "lllllll"\nn = len(s)\ntt = 0\nts = 0\nfor i in range(n-3):\n if s[i] == "B" and s[i+1] == "W":\n tt+=1\n if s[i+2] == "B" and s[i+3] == "W":tt+=1\n for j in range(1,i):\n if i - j >= 0 and s[i-j] =="B":tt+=1\n else:break\n for j in range(1,n-i):\n ... | ['Wrong Answer', 'Accepted'] | ['s455443110', 's267759425'] | [3500.0, 3500.0] | [164.0, 111.0] | [404, 179] |
p03200 | u791110052 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['r = input().split()\n\ns = 0\n\nfor i in range(len(r)):\n if r[i] == "W":\n s += i\n\nprint(s)', 'r = input()\n\ns = 0\nc = 0\n\nfor i in range(len(r)):\n if r[i] == "W":\n s += i - c\n c += 1\n\nprint(s)'] | ['Wrong Answer', 'Accepted'] | ['s420603454', 's156968818'] | [9020.0, 9268.0] | [32.0, 69.0] | [90, 103] |
p03200 | u798316285 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['s=input()\na=0\nc=0\nfor i in range(len(s)):\n if s[i]=="W":\n a+=i\n c+=1\nb=c*(c-1)//2\nprint(a-c)', 's=input()\na=0\nc=0\nfor i in range(len(s)):\n if s[i]=="W":\n a+=i\n c+=1\nb=c*(c-1)//2\nprint(a-b)'] | ['Wrong Answer', 'Accepted'] | ['s364280044', 's256319596'] | [3500.0, 3500.0] | [69.0, 72.0] | [99, 99] |
p03200 | u802234211 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["othello = input()\nbef = 0\nsumall = 0\nsumelse = 0\n\nfor i in range(len(othello)):\n sumall += i\n if(othello[i] == 'B'):\n bef += i\n count += 1\n\ncount = 0\nfor i in range(len(othello)-count):\n sumelse += i\n\naft = sumall - sumelse\n\nprint(aft - bef)", "othello = input()\nbef = 0\nsumal... | ['Runtime Error', 'Accepted'] | ['s125390748', 's976619393'] | [9232.0, 9092.0] | [67.0, 84.0] | [264, 264] |
p03200 | u805668940 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s = list(input())\nl = len(s)\nn, psum = 0, 0\nfor i in range(l):\n if s[i] == 'W':\n n += 1\n psum += i\n\nnsum = n*(n + 1)/2\n\nprint(int(psum - nsum))", "s = list(input())\nl = len(s)\nn, psum = 0, 0\nfor i in range(l):\n if s[i] == 'W':\n n += 1\n psum += i\n\nnsum = (n*(n - 1))/... | ['Wrong Answer', 'Accepted'] | ['s136413997', 's357682734'] | [4840.0, 4840.0] | [76.0, 69.0] | [160, 162] |
p03200 | u807772568 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["a = list(input())\n\nsu = 0\ndd = 0\nco = 0\nfor i in range(len(a)-1,-1,-1):\n\tif a[i] == 'B':\n\t\tco += 1\n\tif co >= 1:\n\t\tif a[i] == 'W':\n\t\t\tsu += (len(a)-1 - i) - dd\n\t\t\tdd += 1\nif dd != 0:\n\tprint(su+dd-1)\nelse:\n\tprint(su+dd)\n\n", "a = list(input())\n\nsu = 0\ndd = 0\nco = 0\nfor i in range(len(... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s184845168', 's283260908', 's847147863', 's687209945'] | [4840.0, 4840.0, 4840.0, 4840.0] | [106.0, 126.0, 104.0, 71.0] | [219, 241, 205, 121] |
p03200 | u813174766 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s=input()\nc=0\na=0\nfor i in s:\n if i=='B':\n c+=1\n else:\n a+=c\nprint(ans)", "s=input()\nc=0\na=0\nfor i in s:\n if i=='B':\n c+=1\n else:\n a+=c\nprint(a)"] | ['Runtime Error', 'Accepted'] | ['s887372114', 's758597862'] | [9200.0, 9228.0] | [51.0, 52.0] | [79, 77] |
p03200 | u818349438 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s = input()\nn =len(s)\nres = 0\nans = 0\nfor i in range(n):\n if s[i] == 'B':\n res+=1AC\n else:\n ans+=res\n\n\nprint(ans)", "s = input()\nn =len(s)\nres = 0\nans = 0\nfor i in range(n):\n if s[i] == 'B':\n res+=1\n else:\n ans+=res\n\n\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s298612615', 's633246469'] | [2940.0, 3500.0] | [17.0, 59.0] | [134, 132] |
p03200 | u820351940 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['import re\nimport numpy as np\ns = input()\nwlen = list(map(len, re.findall(r"(W+)", s)))\nprint(np.cumsum(wlen[::-1]).sum())\n', 's = input()\n\ncnt = 0\nresult = 0\nfor v in reversed(s):\n if v == "W":\n cnt += 1\n else:\n result += cnt\nprint(result)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s412363688', 's376559652'] | [14668.0, 3500.0] | [166.0, 44.0] | [122, 135] |
p03200 | u831274245 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ['S = input().strip()\n\ncount = 0\nsuma = 0\nfor i in S:\n if i=="W":\n suma += count\n else:\n count += 1\n', 'S = input().strip()\n\ncount = 0\nsuma = 0\nfor i in S:\n if i=="W":\n suma += count\n else:\n count += 1\nprint(suma)'] | ['Wrong Answer', 'Accepted'] | ['s051858594', 's375611718'] | [3500.0, 3500.0] | [46.0, 45.0] | [106, 117] |
p03200 | u840813237 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["s=input()\nn=len(s)\ncnt=0\nfor i in range(n):\n if s[i]=='W':\n cnt+=1\nans=0\nfor i in range(n):\n if s[i]=='W':\n cnt--\n else:\n ans+=cnt\nprint(ans)\n \n ", "s=input()\nn=len(s)\ncnt=0\nfor i in range(n):\n if s[i]=='W':\n cnt+=1\nans=0\nfor i in range(n):\n if s[i]=='W':\n cnt-=1\n else:\n... | ['Runtime Error', 'Accepted'] | ['s616920133', 's495435314'] | [2940.0, 3500.0] | [18.0, 84.0] | [158, 158] |
p03200 | u849433300 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["def main():\n s = input()\n start = forward = backward = 0\n intervals = []\n \n if len(s) > 3:\n for i in range(1, len(s)):\n if s[start] != s[i]:\n intervals.append((start, i-1, s[start]))\n if s[start] == 'B':\n ... | ['Wrong Answer', 'Accepted'] | ['s324193239', 's817044549'] | [17836.0, 3500.0] | [77.0, 32.0] | [651, 137] |
p03200 | u851469594 | 2,000 | 1,048,576 | There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the... | ["S = list(input())\ncnt = 0\n\nfor i in range(len(S)-1):\n if S[i] == 'B' and S[i+1] == 'W':\n S[i] = 'W'\n S[i+1] = 'B'\n cnt += 1\n # print(S)\n j = 1\n while True:\n if S[i-j] == 'B':\n S[i-j] = 'W'\n S[i-j+1] = 'B'\n ... | ['Runtime Error', 'Accepted'] | ['s422392576', 's308119778'] | [4840.0, 4840.0] | [2104.0, 83.0] | [430, 139] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.