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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03837 | u813102292 | 2,000 | 262,144 | You are given an undirected connected weighted graph with N vertices and M edges that contains neither self-loops nor double edges. The i-th (1≤i≤M) edge connects vertex a_i and vertex b_i with a distance of c_i. Here, a _self-loop_ is an edge where a_i = b_i (1≤i≤M), and _double edges_ are two edges where (a_i,b_i... | ['N, M = map(int, input().split())\nINF = 10**9\n\nedges = []\n\nfor i in range(M):\n edges.append(list(map(int, input().split())))\n\ndist = [[INF for j in range(N)] for i in range(N)]\n\nfor i in range(N):\n dist[i][i] = 0\n\nfor i in range(M):\n a, b, c = edges[i]\n a, b = a - 1, b - 1\n dist[a][b] = ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s381793332', 's390080903', 's856479591'] | [3316.0, 3316.0, 3572.0] | [21.0, 21.0, 627.0] | [721, 700, 715] |
p03837 | u844789719 | 2,000 | 262,144 | You are given an undirected connected weighted graph with N vertices and M edges that contains neither self-loops nor double edges. The i-th (1≤i≤M) edge connects vertex a_i and vertex b_i with a distance of c_i. Here, a _self-loop_ is an edge where a_i = b_i (1≤i≤M), and _double edges_ are two edges where (a_i,b_i... | ['V, E = [int(_) for _ in input().split()]\nG = {}\nfor i in range(V):\n G[i] = {}\n G[i][i] = 0\n\nfor _ in range(E):\n s, t, c = [int(_) for _ in input().split()]\n s -= 1 \n t -= 1 \n G[s][t] = c\n G[t][s] = c\n\nINF = 10**10\n\nedges_used = set()\nfor i in range(V):\n D = [INF] * V\n D[... | ['Wrong Answer', 'Accepted'] | ['s405124781', 's856915635'] | [3188.0, 37680.0] | [227.0, 176.0] | [1000, 319] |
p03837 | u859897687 | 2,000 | 262,144 | You are given an undirected connected weighted graph with N vertices and M edges that contains neither self-loops nor double edges. The i-th (1≤i≤M) edge connects vertex a_i and vertex b_i with a distance of c_i. Here, a _self-loop_ is an edge where a_i = b_i (1≤i≤M), and _double edges_ are two edges where (a_i,b_i... | ['N,M=map(int,input().split())\nd=[[9999 for _ in range(N)]for _ in range(N)]\n\nfor _ in range(M):\n a,b,c=map(int,input().split())\n d[0][1]=c\n d[1][0]=c\n\nans=0\nfor k in range(N):\n for i in range(N):\n if i == k:\n continue\n for j in range(N):\n if j == k or j == ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s264248014', 's590227656', 's186773431'] | [13832.0, 3188.0, 3444.0] | [1764.0, 465.0, 411.0] | [530, 487, 838] |
p03837 | u879870653 | 2,000 | 262,144 | You are given an undirected connected weighted graph with N vertices and M edges that contains neither self-loops nor double edges. The i-th (1≤i≤M) edge connects vertex a_i and vertex b_i with a distance of c_i. Here, a _self-loop_ is an edge where a_i = b_i (1≤i≤M), and _double edges_ are two edges where (a_i,b_i... | ['from scipy.sparse.csgraph import dijkstra\n\nn,m = map(int,input().split())\nedges = [[int(x) for x in input().split()] for i in range(m)]\ngraph = [[None]*n for i in range(n)]\nfor a, b, c in edges :\n graph[a-1][b-1] = c\n\n#graph = csgraph_from_dense(graph)\ndist = dijkstra(graph, directed=True).astype(int)\n\n... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s121206863', 's240529939', 's129177983'] | [17188.0, 16080.0, 14080.0] | [243.0, 2109.0, 179.0] | [595, 592, 528] |
p03837 | u923279197 | 2,000 | 262,144 | You are given an undirected connected weighted graph with N vertices and M edges that contains neither self-loops nor double edges. The i-th (1≤i≤M) edge connects vertex a_i and vertex b_i with a distance of c_i. Here, a _self-loop_ is an edge where a_i = b_i (1≤i≤M), and _double edges_ are two edges where (a_i,b_i... | ["ans = 0\nn,m = map(int,input().split())\ndis = [[float('inf') for i in range(n)] for j in range(n)] \nabt = []\nfor i in range(m):\n abt.append(list(map(int,input().split()))) \nfor a,b,t in abt:\n dis[a-1][b-1] = t \n dis[b-1][a-1] = t \nfor i in range(n):\n for j in range(n):\n for k in range(n):... | ['Wrong Answer', 'Accepted'] | ['s421333863', 's673927815'] | [3572.0, 3700.0] | [651.0, 623.0] | [526, 526] |
p03837 | u924374652 | 2,000 | 262,144 | You are given an undirected connected weighted graph with N vertices and M edges that contains neither self-loops nor double edges. The i-th (1≤i≤M) edge connects vertex a_i and vertex b_i with a distance of c_i. Here, a _self-loop_ is an edge where a_i = b_i (1≤i≤M), and _double edges_ are two edges where (a_i,b_i... | ['import heapq\n\ndef dijkstra(graph, node, start):\n INF = float("inf")\n dist = [INF] * node\n dist[start] = 0\n que = [(0, start)]\n while que:\n cost, one_node = heapq.heappop(heap)\n for next_c, next_n in graph[one_node]:\n dist_candi = dist[one_node] + next_c\n if dist_candi < dist[next_n]:\n... | ['Runtime Error', 'Accepted'] | ['s393703925', 's500734083'] | [3188.0, 3572.0] | [19.0, 100.0] | [1108, 1108] |
p03837 | u952022797 | 2,000 | 262,144 | You are given an undirected connected weighted graph with N vertices and M edges that contains neither self-loops nor double edges. The i-th (1≤i≤M) edge connects vertex a_i and vertex b_i with a distance of c_i. Here, a _self-loop_ is an edge where a_i = b_i (1≤i≤M), and _double edges_ are two edges where (a_i,b_i... | ['# -*- coding: utf-8 -*-\nimport sys\nimport copy\n\ndef main():\n\tN, M = map(int, input().split(" "))\n\t\n\tgraph = []\n\tmaps = [[9999999 for _ in range(N)] for _ in range(N)]\n\tfor i in range(N):\n\t\tmaps[i][i] = 0\n\t\n\tfor _ in range(M):\n\t\ta, b, c = map(int, input().split(" "))\n\t\ta, b = a-1, b-1\n\t\tm... | ['Wrong Answer', 'Accepted'] | ['s311413138', 's135752909'] | [3700.0, 3828.0] | [139.0, 820.0] | [725, 746] |
p03837 | u977389981 | 2,000 | 262,144 | You are given an undirected connected weighted graph with N vertices and M edges that contains neither self-loops nor double edges. The i-th (1≤i≤M) edge connects vertex a_i and vertex b_i with a distance of c_i. Here, a _self-loop_ is an edge where a_i = b_i (1≤i≤M), and _double edges_ are two edges where (a_i,b_i... | ["import heapq\nimport copy\n\nV, M = map(int, input().split())\nd = [0] * V\nprev = [0] * V\n\ncost = [[INF] * V for i in range(V)]\nfor i in range(M):\n a, b, c = map(int, input().split())\n cost[a - 1][b - 1] = c\n cost[b - 1][a - 1] = c\n \ndef dijkstra_back(s, t):\n for i in range(V):\n prev... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s057875876', 's181173681', 's607278549'] | [3572.0, 3572.0, 26580.0] | [23.0, 23.0, 417.0] | [1274, 1274, 509] |
p03839 | u064408584 | 2,000 | 262,144 | There are N squares aligned in a row. The i-th square from the left contains an integer a_i. Initially, all the squares are white. Snuke will perform the following operation some number of times: * Select K consecutive squares. Then, paint all of them white, or paint all of them black. Here, the colors of the squar... | ['import numpy as np\nn,k=map(int, input().split())\na=np.array(list(map(int, input().split())))\nb=np.maximum(a,0)\nsm=sum(a[:k])\nat=sum(b[k:])\nans=max(sm,0)+at\nfor i in range(k,n):\n sm+=a[i]-a[i-k]\n at+=b[i-k]-b[i]\n ans=max(max(0,sm)+at,ans)\n print(sm,at)\nprint(ans)', 'import numpy as np\nn,k=map(... | ['Wrong Answer', 'Accepted'] | ['s672532535', 's198828885'] | [23164.0, 23172.0] | [1479.0, 636.0] | [274, 257] |
p03839 | u476604182 | 2,000 | 262,144 | There are N squares aligned in a row. The i-th square from the left contains an integer a_i. Initially, all the squares are white. Snuke will perform the following operation some number of times: * Select K consecutive squares. Then, paint all of them white, or paint all of them black. Here, the colors of the squar... | ["from itertools import accumulate as acc\nN, K, *A = map(int, open('0').read().split())\nB = [0]+list(acc(A))\nM = list(acc(a if a>0 else 0 for a in A))\nans = -10**30\ns = sum(A)\nfor i in range(N-K+1):\n mi = B[i+K]-B[i]\n c = M[N-1] - M[i+K-1]\n if i>0:\n c += M[i-1]\n ans = max(ans,mi+c,c)\nprint(ans)", 'N,... | ['Runtime Error', 'Accepted'] | ['s001668204', 's900086493'] | [3064.0, 14092.0] | [17.0, 165.0] | [300, 252] |
p03839 | u547167033 | 2,000 | 262,144 | There are N squares aligned in a row. The i-th square from the left contains an integer a_i. Initially, all the squares are white. Snuke will perform the following operation some number of times: * Select K consecutive squares. Then, paint all of them white, or paint all of them black. Here, the colors of the squar... | ['n,k=map(int,input().split())\na=list(map(int,input().split()))\nsum_a=[0]*n\nb=[max(0,a[i]) for i in range(n)]\nsum_b=[0]*n\nsum_a[0]=a[0]\nsum_b[0]=a[0]\nfor i in range(1,n):\n sum_a[i]=sum_a[i-1]+a[i]\n sum_b[i]=sum_b[i-1]+b[i]\nans=sum_a[k-1]+sum_b[n-1]-sum_b[k-1]\nans=max(ans,0)\nfor i in range(k,n):\n ans=max... | ['Wrong Answer', 'Accepted'] | ['s191827438', 's504500262'] | [17852.0, 17608.0] | [250.0, 235.0] | [418, 388] |
p03839 | u814986259 | 2,000 | 262,144 | There are N squares aligned in a row. The i-th square from the left contains an integer a_i. Initially, all the squares are white. Snuke will perform the following operation some number of times: * Select K consecutive squares. Then, paint all of them white, or paint all of them black. Here, the colors of the squar... | ['N,K=map(int,input().split())\na=list(map(int,input().split()))\nans=0\ntmp=0\nfor i in range(N):\n if i < K:\n tmp+=a[i]\n else:\n if a[i]>0:\n ans+=a[i]\nans+=max(0,tmp)\n\nans2=0\ntmp=0\nfor i in range(N-1,-1,-1):\n if ans < N-K:\n if a[i]>0:\n ans2+=a[i]\n else:\n tmp+=a[i]\nans2+=max(0,t... | ['Runtime Error', 'Accepted'] | ['s804837862', 's096691821'] | [20032.0, 23664.0] | [86.0, 150.0] | [322, 353] |
p03840 | u088063513 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['## coding: UTF-8\n\n#from decimal import *\n#from itertools import permutations, combinations,combinations_with_replacement,product\n\n#N = int(input())\n\ns = input().split()\np = [int(w) for w in s]\n\nprint(p)\n\nI = p[0]\nO = p[1]\n\nJ = p[3]\nL = p[4] \n\n\n\nanswer = 0\n\nanswer += O \n\nif(I % 2 == J % 2 and I... | ['Wrong Answer', 'Accepted'] | ['s230716652', 's861809009'] | [3064.0, 3064.0] | [17.0, 18.0] | [742, 1014] |
p03840 | u107077660 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['A = [int(i) for i in input().split()]\nB = [A[1],A[0],A[3],A[4]]\nif max(B) == 1 and B[0] == 0:\n\tprint(0)\nelse:\n\tans = 0\n\tans += B[0]\n\tif min(B[1:]) == 0:\n\t\tfor b in B[1:]:\n\t\t\tif b%2 == 0:\n\t\t\t\tans += 2\n\telif not sum([i%2 for i in B[1:]])%3:\n\t\tans += sum(B[1:])\n\telse:\n\t\tans += sum(B[1:])... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s242373345', 's280129894', 's549668466', 's771602495', 's835153563', 's726013736'] | [3188.0, 3188.0, 3064.0, 3064.0, 3192.0, 3192.0] | [163.0, 24.0, 23.0, 23.0, 23.0, 22.0] | [300, 243, 218, 240, 310, 232] |
p03840 | u118642796 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['I,O,T,J,L,S,Z = map(int,input().split())\nprint(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3*(I>0*❨L>0❩*❨J>0❩,(I//2+J//2+L//2)*2+O))\n', 'I,O,T,J,L,S,Z = map(int,input().split())\nprint(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3*(I>0)*(L>0)*(J>0),(I//2+J//2+L//2)*2+O))\n'] | ['Runtime Error', 'Accepted'] | ['s691443228', 's546495069'] | [3188.0, 2940.0] | [18.0, 17.0] | [134, 127] |
p03840 | u227082700 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['I,O,R,J,L,S,Z=map(int,input().split())\nans=O\nm=min(I,J,L):\nI-=m\nJ-=m\nL-=m\nans+=m*3\nans+=I//2*2\nans+=J//2*2\nans+=L//2*2\nprint(ans)', 'I,O,R,J,L,S,Z=map(int,input().split())\na=(I//2+J//2+L//2)*2\nb=0\nif I*J*L!=0:b=(2*((I-1)//2+(J-1)//2+(L-1)//2)+3)\nprint(max(a,b))', 'I,O,R,J,L,S,Z=map(int,input().split())\... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s617511759', 's880344144', 's966423542'] | [2940.0, 3064.0, 3060.0] | [17.0, 17.0, 17.0] | [129, 128, 130] |
p03840 | u366886346 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['i,o,t,j,l,s,z=map(int,input().split())\nans=0\nans+=o\nif j==1 and l==1 and i==1:\n ans+=3\nelif j<2 or l<2 or i<2:\n ans+=0\nelif j%2==1 and l%2==1 and i%2==1:\n ans+=j+i+l\nelif j%2==1 and l%2==1 and i%2==0:\n ans+=j+i+l-1\nelif j%2==1 and l%2==0 and i%2==1:\n ans+=j+i+l-1\nelif j%2==1 and l%2==0 and... | ['Wrong Answer', 'Accepted'] | ['s707001227', 's399126650'] | [3064.0, 3064.0] | [18.0, 17.0] | [548, 550] |
p03840 | u391731808 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['A = {k:a for k,a in zip(list("IOTJLSZ"),map(int,input().split()))}\nm = min(A["I"],A["J"],A["L"])\nans = 0\nfor i in (0,1,m-1,m):\n ans = max(ans, 3*i + A["O"] + (A["I"]-i)//2 + (A["J"]-i)//2 + (A["L"]-i)//2)\nprint(ans)', 'A = {k:a for k,a in zip(list("IOTJLSZ"),map(int,input().split()))}\nm = min(A["I"],A["J"],A... | ['Wrong Answer', 'Accepted'] | ['s672757208', 's417925711'] | [3064.0, 3064.0] | [17.0, 17.0] | [218, 230] |
p03840 | u536113865 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['i,o,_,j,l,_,_ = list(map(int,input().split()))\n\nans = (i//2)*4 + o*2 + (j//2)*4 + (l//2)*4\nif i&1 and j&1 and l&1: ans += 6\nprint(ans)\n', 'i,o,_,j,l,_,_ = list(map(int,input().split()))\n\nif i>0 and j>0 and l>0:\n ans = max((i//2)*2 + o + (j//2)*2 + (l//2)*2, ((i-1)//2)*2 + o + ((j-1)//2)*2 + ((l-1)//2)*2 +3... | ['Wrong Answer', 'Accepted'] | ['s725994102', 's148333159'] | [2940.0, 3064.0] | [17.0, 17.0] | [135, 246] |
p03840 | u543954314 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['i,o,t,j,l,s,z = map(int, input().split())\nk = o*2\np = (i//2 + j//2 + l//2)*4\nq = 0\nif i*j*l:\n q = ((i-1)//2 + (j-1)//2 + (l-1)//2)*4 + 6\nprint(k + max(p, q)) \n', 'i,o,t,j,l,s,z = map(int, input().split())\nk = o*2\np = (i//2 + j//2 + l//2)*4\nq = ((i-1)//2 + (j-1)//2 + (l-1)//2)*4 + 6\nprint(k + max(p, q)) ',... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s123202514', 's519918771', 's533160049', 's212148059'] | [2940.0, 3064.0, 3060.0, 2940.0] | [20.0, 17.0, 17.0, 17.0] | [160, 141, 159, 158] |
p03840 | u619819312 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['a=list(map(int,input().split()))\nk,h=b,b\nk+=a[0]-a[0]%2\nk+=a[3]-a[3]%2\nk+=a[4]-a[4]%2\nif min(a[0],a[3],a[4])>0:\n h+=3\n a[0],a[3],a[4]=a[0]-1,a[3]-1,a[4]-1\n h+=a[0]-a[0]%2\n h+=a[3]-a[3]%2\n h+=a[4]-a[4]%2\nprint(max(k,h))', 'a=list(map(int,input().split()))\nk,h=a[1],a[1]\nk+=a[0]-a[0]%2\nk+=a[... | ['Runtime Error', 'Accepted'] | ['s091146586', 's958604517'] | [3316.0, 3064.0] | [23.0, 17.0] | [233, 239] |
p03840 | u623687794 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['i,o,t,j,l,s,z=map(int,input().split())\nansl=[o,o]\nansl[0]+=3+(max(0,(i-1)//2))*2+(max(0,(j-1)//2))*2+(max(0,(l-1)//2))*2\nansl[1]+=(i//2)*2+(j//2)*2+(l//2)*2\nprint(max(ansl))\n', 'i,o,t,j,l,s,z=map(int,input().split())\nansl=[o,o]\nansl[0]+=3+(max(0,(i-1)//2))*2+(max(0,(j-1)//2))*2+(max(0,(l-1)//2))*2\nansl[1]+=(i... | ['Wrong Answer', 'Accepted'] | ['s876215501', 's659132897'] | [3060.0, 3064.0] | [18.0, 17.0] | [174, 229] |
p03840 | u691018832 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['import math\n\na = list(map(int, input().split()))\nans = 0\ni = 2 * math.floor(0.5 * a[0])\n\nif a[5] or a[2] or a[6]:\n pass\nelse:\n if a[3] == a[4]:\n ans = ans + a[3]\n \n ans = ans + i + a[1]\n\nprint(ans)', 'import math\n\ndef xv(num):\n return 2 * math.floor(0.5 * num)\n\na = list(ma... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s290661071', 's576944784', 's638751570', 's716555539'] | [3060.0, 3064.0, 3060.0, 3064.0] | [17.0, 18.0, 17.0, 18.0] | [220, 335, 225, 201] |
p03840 | u729707098 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['a = [int(i) for i in input().split()]\nf = lambda x: max(0,x-x%2)\nprint(max(a[1]+f(a[0])+f(a[3])+f(a[4]),a[1]+f(a[0]-1)+f(a[3]-1)+f(a[4]-1)+3))', 'a = [int(i) for i in input().split()]\nf = lambda x: x-x%2\nans = a[1]+f(a[0])+f(a[3])+f(a[4])\nif a[0] and a[3] and a[4]: ans = max(ans, a[1]+f(a[0]-1)+f(a[3]-1)+f(a[4]-... | ['Wrong Answer', 'Accepted'] | ['s368611869', 's974972619'] | [3064.0, 3064.0] | [17.0, 17.0] | [142, 183] |
p03840 | u752513456 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['aI, aO, aT, aJ, aL, aS, aZ = map(int, input().split())\n\nt = min([aJ, aL, aI])\ns = min([aJ - 1, aL - 1])\nprint(3 * t + 2 * s + (aI - t) // 2 * 2 + aO)\n', 'aI, aO, aT, aJ, aL, aS, aZ = map(int, input().split())\n\nif aI * aJ * aL == 0:\n K = (aI // 2 + aJ // 2 + aL // 2) * 2 + aO\nelse:\n K1 = ((aI - 1) // 2... | ['Wrong Answer', 'Accepted'] | ['s822477718', 's374339551'] | [3188.0, 3064.0] | [33.0, 23.0] | [150, 280] |
p03840 | u813174766 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['a=list(map(int,input().split()))\nans=min(a[0],a[3],a[4])\na[0]-=ans\na[3]-=ans\na[4]-=ans\nans*=6\nans+=(a[0]//2*4)+(a[3]//2*4)+(a[4]//2*4)+a[1]*2\nprint(ans)', 'a=list(map(int,input().split()))\nans=min(a[0],a[3],a[4])\na[0]-=ans\na[3]-=ans\na[4]-=ans\nans*=3\nif(ans>0&&(a[0]%2+a[3]%2+a[4]%2==2)):\n ans+=1\nans+=(... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s287101589', 's609811950', 's473018859'] | [3188.0, 2940.0, 3064.0] | [17.0, 17.0, 18.0] | [152, 198, 201] |
p03840 | u934019430 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ["#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\ndef f(s):\n _res = s[1]\n x,y,z = s[0],s[3],s[4]\n if ((x%2) + (y%2) + (z%2) > 1) and (x > 0 and y > 0 and z > 0):\n x = x - 1\n y = y - 1\n z = z - 1\n _res = res + 3\n _res = _res + x//2 + y//2 + z//2;\n return _res\n\n\n... | ['Wrong Answer', 'Accepted'] | ['s911399643', 's456150715'] | [3192.0, 3828.0] | [23.0, 29.0] | [365, 458] |
p03840 | u969190727 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['i,o,t,j,l,s,z=map(int,input().split())\nans=0\nif i==0 or j==0 or l==0:\n ans+=o+(i//2)*2+min(j,l)*2\nelse:\n ans+=o+(i//2)*2+min(j,l)*2\n ans1=o+((i-1)//2)*2+max(0,min(j-1.l-1))*2\nprint(ans)', 'i,o,t,j,l,s,z=map(int,input().split())\nans=0\nif i==0 or j==0 or l==0:\n ans+=o+(i//2)*2+(j//2)*2+(l//2)*2\nelse:\n ... | ['Runtime Error', 'Accepted'] | ['s684849875', 's641139179'] | [2940.0, 3064.0] | [17.0, 17.0] | [188, 228] |
p03840 | u976162616 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['if __name__ == "__main__":\n AI,AO,AT,AJ,AL,AS,AZ = map(int, input().split())\n result = 0\n resAI = AI // 2\n\n result += 6 * resAI // 3\n resAI -= resAI // 3\n\n resAJAL = min(AJ, AL)\n result += 6 * resAJAL // 3\n resAJAL -= resAJAL // 3\n\n result += 3 * min(resAI, AO)\n tmp = min(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s446308042', 's767153969', 's172784008'] | [3064.0, 3060.0, 3064.0] | [17.0, 17.0, 17.0] | [469, 378, 400] |
p03840 | u984276646 | 2,000 | 262,144 | A _tetromino_ is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: Snuke has many tetrominos. The number of I-, O-, T-, J-, L-, S- and Z-tetrominos in his possession are a_I, a_O, a_T, a_J, a_L, a_S ... | ['A = list(map(int, input().split()))\nS = A[1] * 2\nS += (A[0] // 2) * 4\nif A[4] > 0 and A[5] > 0 and A[0] % 2 == 1:\n A[4] -= 1\n A[5] -= 1\n S += 3\nS += (A[4] // 2) * 4 + (A[5] // 2) * 4\nprint(S)', 'A = list(map(int, input().split()))\nS = A[1]\nS += (A[0] // 2) * 2\nT = S\n if A[4] > 0 and A[5] > 0 and A[0] ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s083916228', 's147573672', 's400597564'] | [3060.0, 2940.0, 3064.0] | [17.0, 18.0, 17.0] | [194, 258, 411] |
p03848 | u021548497 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['import numpy as np\nn = int(input())\na = np.array([int(x) for x in input().split()])\nnp.sort(a)\nkey = True\nif n%2:\n key = False\nans = True\nfor i in range(n):\n if key:\n if a[i] != (i//2)*2+1:\n ans = False\n break\n else:\n if a[i] != ((i+1)//2)*2:\n ans = False\n break\n\nif ans:... | ['Wrong Answer', 'Accepted'] | ['s808183292', 's497464163'] | [23504.0, 13880.0] | [186.0, 104.0] | [339, 359] |
p03848 | u024782094 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['import sys\ndef input(): return sys.stdin.readline().strip()\nn=int(input())\na=sorted(list(map(int,input().split())))\nif n%2==0:\n l=[]\n for i in range(n//2):\n l.append(i*2+1)\n l.append(i*2+1)\nelse:\n l=[0]\n for i in range(n//2):\n l.append((i+1)*2)\n l.append((i+1)*2)\n... | ['Wrong Answer', 'Accepted'] | ['s981510763', 's371248465'] | [13880.0, 13880.0] | [110.0, 97.0] | [363, 366] |
p03848 | u063052907 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['from collections import Counter\n\n\nN = int(input())\nlstA = list(map(int, input().split()))\nmod = 10**9 + 7\ncountA = Counter(lstA)\nans = 0\n\nif N % 2:\n if countA[0] == 1 and all(countA[i] == 2 for i in range(2, N, 2)):\n ans = pow(2, N//2) // mod\nelse:\n if all(countA[i] == 2 for i in range(1, N,... | ['Wrong Answer', 'Accepted'] | ['s983475342', 's093385285'] | [14820.0, 14820.0] | [70.0, 66.0] | [358, 350] |
p03848 | u102960641 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['n = int(input())\na = list(map(int, input().split()))\na.sort()\nb = True\nfor i,j in enumerate(a):\n if n % 2:\n if j != ((i+1) // 2) * 2:\n b = False\n break\n else:\n if j != (i // 2) * 2 + 1:\n b = False\n break\nif b == True:\n print(((n // 2) ** 2) % mod)\nelse:\n print(0)', 'n = i... | ['Runtime Error', 'Accepted'] | ['s301336839', 's620313262'] | [13880.0, 13880.0] | [103.0, 102.0] | [293, 306] |
p03848 | u131881594 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['from collections import Counter\ndef powmod(a,n,m): #a^n mod m\n ans=1\n while n!=0:\n if n&1: ans*=a\n a**=2\n n>>=1\n return ans\nn=int(input())\na=list(map(int,input().split()))\na.sort()\ndic=Counter(a)\nif n%2==0:\n temp={}\n for i in range(1,n,2):\n temp[i]=2\n if t... | ['Wrong Answer', 'Accepted'] | ['s563598598', 's173227464'] | [24676.0, 24732.0] | [92.0, 89.0] | [512, 523] |
p03848 | u169138653 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['n=int(input())\na=list(map(int,input().split()))\nmod=10**9+7\nd=dict()\nfor i in range(n):\n if a[i] not in d:\n d[a[i]]=1\n else:\n d[a[i]]+=1\nd=sorted(list(d.items()))\nif n%2:\n for i in range(len(d)):\n if i==0:\n if d[i][0]!=0 or d[i][1]!=1:\n print(0)\n exit()\n else:\n ... | ['Runtime Error', 'Accepted'] | ['s167648925', 's431158748'] | [3064.0, 15096.0] | [17.0, 94.0] | [510, 516] |
p03848 | u193264896 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ["import sys\nfrom collections import defaultdict\n\nread = sys.stdin.read\nreadline = sys.stdin.buffer.readline\nsys.setrecursionlimit(10 ** 8)\nINF = float('inf')\nMOD = 10 ** 9 + 7\n\n\ndef main():\n N = int(readline())\n A = list(map(int, readline().split()))\n A.sort()\n if N % 2 == 0:\n for i i... | ['Wrong Answer', 'Accepted'] | ['s316749875', 's194462299'] | [19852.0, 19724.0] | [71.0, 72.0] | [781, 775] |
p03848 | u212328220 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['from collections import defaultdict,Counter\nn = int(input())\nal = list(map(int, input().split()))\n\nc_al = Counter(al)\n\nif n % 2 == 0 and 0 not in c_al.values():\n print(int(2**(n/2))%(10**9) + 7)\nelif n % 2 != 0 and c_al[0] == 1:\n print(int(2 ** (n // 2))%(10**9) + 7)\nelse:\n print(0)', 'from colle... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s139494480', 's884405394', 's048063449'] | [14820.0, 24984.0, 20624.0] | [57.0, 96.0, 67.0] | [293, 506, 487] |
p03848 | u216752093 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['n=int(input())\na=list(map(int,input().split()))\na.sort()\n\nif a[0]==0:\n a.remove(0)\n sta=0\nelse:\n sta=1\nfor i in range(1,len(a),2):\n if a[i]!=a[i-1] or a[i]%2!=sta or a[i]!=2*(i+1)-sta:\n print(0)\n exit()\nans=2**(len(a)//2)\nprint(ans)', 'n=int(input())\na=list(map(int,input().spl... | ['Wrong Answer', 'Accepted'] | ['s014484486', 's998298998'] | [13880.0, 14008.0] | [76.0, 96.0] | [258, 264] |
p03848 | u266014018 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ["def main():\n import sys\n\n def input(): return sys.stdin.readline().rstrip()\n\n n = int(input())\n mod = 10**9 + 7\n a.sort()\n check = [i+1 - (i+n)%2 for i in range(n)]\n if a != check:\n print(0)\n return\n else:\n ans = pow(2, n//2, mod)\n print(ans)\n\n\n\n\n... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s513585353', 's732066428', 's401123754'] | [9104.0, 17092.0, 20556.0] | [27.0, 35.0, 77.0] | [336, 370, 376] |
p03848 | u281610856 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['from collections import Counter\nmod = 10 ** 9 + 7\nans = 0\nn = int(input())\nA = list(map(int, input().split()))\nc = Counter(A).most_common()\nval, cnt = zip(*c)\nval = sorted(list(val))\ncnt = sorted(list(cnt))\nif n % 2 == 0:\n if cnt == [2] * (n // 2) and val == [i for i in range(n) if i % 2 != 0]:\n ... | ['Wrong Answer', 'Accepted'] | ['s014773706', 's665885587'] | [17372.0, 16088.0] | [96.0, 77.0] | [483, 710] |
p03848 | u302957509 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['N = int(input())\nA = map(int, input().split())\n\nif N%2 == 0:\n count = [(2 if i%2 == 1 else 0) for i in range(N)]\nelse:\n count = [(2 if i%2 == 0 else 0) for i in range(N)]\n count[0] = 1\n\nfor a in A:\n count[a] -= 1\n if count[a] < 0:\n print(0)\n break\nelse:\n print(2**(N//2)/... | ['Wrong Answer', 'Accepted'] | ['s132144732', 's274561406'] | [10808.0, 10740.0] | [79.0, 82.0] | [313, 313] |
p03848 | u305366205 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['n = int(input())\na = sorted(list(map(int, input().split())))\nif n % 2 == 1:\n for i in range(0, n, 2):\n if i == 0 and a[i] != 0:\n print(0)\n exit()\n elif a[i] != a[i + 1] or a[i] != 2 * i:\n print(0)\n exit()\nelse:\n for i in range(0, n, 2):\n ... | ['Runtime Error', 'Accepted'] | ['s035654106', 's002416012'] | [13880.0, 13880.0] | [78.0, 91.0] | [411, 253] |
p03848 | u397531548 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['import collections\nN=int(input())\nA=list(map(int,input().split()))\nif N%2==1:\n if 0 not in A:\n print(0)\n else:\n B=A.remove(0)\n Bc=dict(collections.Counter(B))\n for i in Bc.keys():\n if Bc[i]!=2:\n print(0)\n break\n else:\n ... | ['Runtime Error', 'Accepted'] | ['s806803455', 's442304040'] | [16352.0, 16352.0] | [70.0, 63.0] | [521, 533] |
p03848 | u413165887 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ["import sys\nn = int(input())\na = list(map(int, input().split(' ')))\n\na.sort()\nif n%2 == 0:\n for i in range(n-1):\n if i%2 == 0:\n if a[i] == a[i+1]:\n continue\n else:\n print(0)\n sys.exit()\n else:\n if a[i]+2 == a[i... | ['Runtime Error', 'Accepted'] | ['s174926434', 's005804371'] | [14008.0, 14008.0] | [104.0, 92.0] | [917, 547] |
p03848 | u422590714 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ["n = int(input())\nlst = [int(e) for e in input().split(' ')]\n\nlst = sorted(lst)\n\nvalid_list = []\nif n % 2 == 1:\n \n valid_list.append(0)\n for i in range(1, int((n + 1) / 2)):\n valid_list.append(i * 2)\n valid_list.append(i * 2)\n if lst == valid_list:\n print((2 ** (((n - 1) /... | ['Runtime Error', 'Accepted'] | ['s004258361', 's437300088'] | [13880.0, 13880.0] | [100.0, 107.0] | [630, 789] |
p03848 | u455696302 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['N = int(input())\nA = [int(i) for i in input().split()]\ncount = [0 for _ in range(N+1)]\n\nif N % 2 == 0:\n if len(set(A)) != int(N/2):\n print(0)\n exit()\nelse:\n if len(set(A)) != int(N/2)+1:\n print(0)\n exit()\n\nfor i in A:\n count[i] += 1\n\nres = 1\nfor i in range(N+1):\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s531018132', 's675819592', 's190419495'] | [13880.0, 13880.0, 14008.0] | [141.0, 146.0, 143.0] | [444, 432, 500] |
p03848 | u485137520 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['\nn = int(input())\na_list = list(map(int, input().split()))\n\nco = a_list.copy()\nco.sort()\nif 0 in co:\n co.remove(0)\n\nif len(co) %2 == 0:\n print(0)\n quit()\n\nelse:\n print(0)\n quit()\n\n\nfor index in range(len(a_list)[:-1:2]):\n if not a_list[index] == a_list[index + 1]:\n print(0... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s090200745', 's092607017', 's145393213', 's189130759', 's191471418', 's401600112', 's464258818', 's510353646', 's748976521', 's779929400', 's476941803'] | [13880.0, 13880.0, 14008.0, 13880.0, 14008.0, 13812.0, 14008.0, 14008.0, 13880.0, 13880.0, 13812.0] | [81.0, 80.0, 81.0, 88.0, 164.0, 86.0, 167.0, 83.0, 82.0, 88.0, 87.0] | [369, 344, 342, 336, 380, 333, 376, 342, 373, 333, 366] |
p03848 | u519968172 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['n=int(input())\na=list(map(int,input().split()))\n\nb=[0 for _ in range(n)]\nfor i in range(n):\n b[a[i]]+=1\nprint(b)\nc= 1 if n%2==0 else 0\n\nif n%2==1:\n if b[0]!=1:\n print(0)\n else:\n for i in range(2,n,2):\n if b[i]!=2:\n print(0)\n break\n else:\n print(2**(n//2))\nelse:... | ['Wrong Answer', 'Accepted'] | ['s818590589', 's441736521'] | [26124.0, 20492.0] | [2231.0, 72.0] | [405, 401] |
p03848 | u527993431 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['N=int(input())\nA=list(map(int,input().split()))\nif N%2==0:\n\tfor i in range (N):\n\t\tA[i]%2!=1:\n\t\t\tprint(0)\n\t\t\texit()\n\tprint((2**N)%(10**9+7))\nelse:\n\tfor i in range (N):\n\t\tA[i]%2!=0:\n\t\t\tprint(0)\n\t\t\texit()\n\tif min(A)!=0:\n\t\tprint(0)\n\t\texit()\n\telse:\n\t\tprint((2**(N-1))%(10**9+7))'... | ['Runtime Error', 'Accepted'] | ['s692676437', 's999195842'] | [2940.0, 13812.0] | [17.0, 52.0] | [273, 308] |
p03848 | u536113865 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['mod = 10**9+7\n\nn = int(input())\na = sorted(f())\nif n&1:\n if all([a[i] == i+i%2 for i in range(n)]):\n print(1<<((n-1)//2)%mod)\n else:\n print(0)\nelse:\n if all([a[i] == i+(i+1)%2 for i in range(n)]):\n print(1<<(n//2)%mod)\n else:\n print(0)', 'f = lambda: list(map(int,i... | ['Runtime Error', 'Accepted'] | ['s247060986', 's392096951'] | [3064.0, 14004.0] | [18.0, 95.0] | [275, 315] |
p03848 | u541568482 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['import sys\n\ncin = sys.stdin\ncin = open("in.txt", "r")\n\nMODULO = int(10**9+7)\nN = int(cin.readline())\nA = list(map(int, cin.readline().split()))\npos = [0]*(N)\nif (N%2==1):\n pos[N//2+1]=1\nfor ai in A:\n if (ai+N)%2==0:\n print(0)\n exit()\n pos[ai]+=1\n if pos[ai]>2:\n print(... | ['Runtime Error', 'Accepted'] | ['s940034262', 's052863617'] | [3064.0, 13876.0] | [22.0, 104.0] | [386, 401] |
p03848 | u561083515 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['N = int(input())\nA = sorted([int(i) for i in input().split()], reverse=True)\n\nfrom itertools import groupby\n\ngr = groupby(A)\n\nans = 1\nif N % 2 == 0:\n for _,group in gr:\n if len(tuple(group)) != 2:\n print(0)\n exit()\n else:\n ans *= 2\nelse:\n for key,gr... | ['Wrong Answer', 'Accepted'] | ['s107692106', 's833908088'] | [13940.0, 15904.0] | [176.0, 84.0] | [537, 379] |
p03848 | u667024514 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['import math\nn = int(input())\nlis = list(map(str,input().split()))\nli = [0 for _ in range(math.ceil(n / 2))]\n\nfor i in range(n):\n li[math.floor(lis[i] / 2)] += 1\nfor i in range(len(li)):\n if n % 2 == 1 and i == 0:\n if li[i] != 1:\n print("0")\n exit()\n else:\n if li[i] != 2:\n print("... | ['Runtime Error', 'Accepted'] | ['s434999877', 's256530231'] | [10740.0, 13812.0] | [34.0, 118.0] | [350, 372] |
p03848 | u667084803 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['N=int(input())\nA=list(map(int,input().split()))\nA.sort()\nB=[]\nC=[]\nif N%2==0:\n for i in range(0,int(N/2)):\n B+=[2*i,2*i]\n C+=[2*i+1,2*i+1]', 'def power_func(a,n,p):\n bi=str(format(n,"b"))\n res=1\n for i in range(len(bi)):\n res=(res*res) %p\n if bi[i]=="1":\n res=(res*a) %p\n return re... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s060679361', 's210543320', 's212533023', 's545347162', 's556352649', 's635130620', 's708172561', 's798939390', 's073204613'] | [16484.0, 13880.0, 13880.0, 16612.0, 16612.0, 16228.0, 16612.0, 16228.0, 13880.0] | [112.0, 114.0, 94.0, 110.0, 112.0, 111.0, 111.0, 111.0, 96.0] | [171, 478, 456, 406, 448, 448, 246, 457, 465] |
p03848 | u677440371 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['N = int(input())\nA = [int(i) for i in input().split()]\n\ncheck = True\nA = sorted(A)\nprint(A)\nif N % 2 == 0:\n for i in range(N):\n if i % 2 == 0 and A[i] != i + 1:\n check = False\n if i % 2 == 1 and A[i] != i:\n check = False\n\nif N % 2 != 0:\n for i in range(N):\n ... | ['Wrong Answer', 'Accepted'] | ['s547035447', 's894026199'] | [13880.0, 13940.0] | [122.0, 109.0] | [502, 493] |
p03848 | u698479721 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['import sys\nN = int(input())\nA = list(map(int, input().split()))\nif N%2 == 1:\n if A.count(0) != 1:\n print(0)\n sys.exit()\n i = 1\n while i <= N//2:\n if A.count(2*i) != 2:\n print(0)\n sys.exit()\n i += 1\n j = 0\n ans = 1\n while j <= N//2:\n ans = ans*2\n j += 1\n print(ans)\... | ['Wrong Answer', 'Accepted'] | ['s814174458', 's509879734'] | [14008.0, 14008.0] | [2104.0, 108.0] | [486, 541] |
p03848 | u703890795 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['N = int(input())\nA = list(map(int, input().split()))\nA = sorted(A)\nf = True\nif N%2 == 1:\n for i in range(N):\n if A[i] != ((i+1)//2)*2:\n f = False\n break\nelse:\n for i in range(N):\n if A[i] != (i//2)*2 + 1:\n f = False\n break\nm = N//2\nif f:\n print((2**m)//1000000007)\nelse:\n... | ['Wrong Answer', 'Accepted'] | ['s226181891', 's967657246'] | [13880.0, 13880.0] | [102.0, 98.0] | [310, 309] |
p03848 | u714378447 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['N=int(input())\nA=list(map(int,input().split()))\nA.sort()\n\nf=True\nif N%2!=0:\n\tidx=1\n\tx=2\n\tif A[0]!=0:f=False\nelse:\n\tidx=0\n\tx=1\nprint(A)\nfor i in range(N//2):\n\tprint(idx)\n\tif A[idx]!=x or A[idx+1]!=x:\n\t\tf=False\n\tidx+=2\n\tx+=2\n\nif f:print(2**(N//2)%(10**9+7))\nelse:print(0)', 'N=int(input()... | ['Wrong Answer', 'Accepted'] | ['s483338974', 's132779974'] | [13880.0, 13880.0] | [143.0, 100.0] | [269, 249] |
p03848 | u780475861 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['import sys\nfrom collections import Counter\nn, *lst = map(int, sys.stdin.read().split())\nlst = sorted(Counter(lst).items())\nl = len(lst)\nmod = 10 ** 9 + 7\nif n % 2:\n for i in range(l):\n if not i:\n if lst[i][0] or lst[i][1] != 1:\n print(0)\n quit()\n if lst[i][0] != i * 2 or lst[i][1... | ['Wrong Answer', 'Accepted'] | ['s281401664', 's233860319'] | [15840.0, 15840.0] | [75.0, 79.0] | [475, 566] |
p03848 | u785578220 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['a = int(input())\nx = list(map(int, input().split()))\nx.sort()\nx = x[::-1]\nif a == 1:\n if x[0] == 0:print(1)\n else:print(0)\nelse:\n if a %2 == 0:\n for i in range(1,a,2):\n if not i == x[-1] and i ==x[-2]:\n x.pop()\n x.pop()\n print(0)\n break\n else:print(2**(a//2))\n... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s009173947', 's180812811', 's511835568', 's949922102', 's141414193'] | [14008.0, 14008.0, 14008.0, 14008.0, 13880.0] | [90.0, 92.0, 92.0, 95.0, 95.0] | [520, 514, 540, 555, 191] |
p03848 | u802772880 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['n=int(input())\na=list(map(int,input().split()))\na.sort()\nif n%2==1:\n if a[0]!=0:\n print(0)\n exit()\n for i in range(n//2):\n if a[2*i+1]!=2*(i+1) or a[2*(i+1)]!=2*(i+1):\n print(0)\n exit()\n print((pow(2,n//2))%(1e9+7))\nelse:\n for i in range(n//2):\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s030141432', 's676420063', 's834071642', 's759849759'] | [14004.0, 14008.0, 14008.0, 14008.0] | [97.0, 99.0, 96.0, 98.0] | [419, 413, 417, 417] |
p03848 | u804358525 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['# -*- coding: utf-8 -*-\n\npeople_num = int(input())\nline_list = list(map(int, input().split()))\n\nnum_odd = True\nbool_false = True\n\nline_list.sort()\n\nif(people_num%2 == 0):\n num_odd = False\n\nfor i in range(people_num):\n\n if(num_odd):\n if(line_list[i] == 2*((i+1)//2)):\n continue\... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s319685089', 's616317816', 's034674920'] | [14008.0, 13880.0, 13880.0] | [99.0, 100.0, 99.0] | [585, 610, 617] |
p03848 | u813102292 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['n = int(input())\na = list(int(i) for i in input().split())\nif n%2==0 and sum(a)==n*n//2 or n%2 ==1 and sum(a) == (n+1)*n//2:\n print(2**(n//2)%(10**9+7))', 'n = int(input())\na = list(int(i) for i in input().split())\nif n%2==0 and sum(a)==n*n//2 or n%2 ==1 and sum(a) == (n+1)*n//2:\n print(2**(n//2)%(10**9+7... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s789985275', 's812083898', 's698387598'] | [14008.0, 13880.0, 14004.0] | [49.0, 49.0, 48.0] | [155, 174, 175] |
p03848 | u835482198 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['from collections import Counter\n\nN = int(input())\nA = map(int, input().split())\n# N = 5\n# A = [2, 4, 4, 0, 2]\nmod = 10 ** 9 + 7\n\ncnt = Counter(A)\nif N % 2 == 0:\n if len(filter(lambda c: c == 2, cnt.values())) != 0:\n print(0)\n else:\n print(2 ** (N // 2))\nelse:\n if cnt[0] != 1:\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s337570381', 's503252353', 's720439755'] | [16620.0, 14820.0, 16620.0] | [57.0, 172.0, 62.0] | [445, 618, 503] |
p03848 | u856232850 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['n = int(input())\n\na = list(map(int,input().split()))\na.sort()\nif n % 2 == 0:\n b = 0\n for i in range(0,n,2):\n if a[i] == a[i+1] and a[i] == i+1:\n b = 1\n if b == 1:\n print(0)\n else:\n print(2**(n//2))\nelse:\n b = 0\n if a[0] != 0:\n b = 1\n else:\n... | ['Wrong Answer', 'Accepted'] | ['s565446633', 's832553218'] | [14008.0, 14008.0] | [92.0, 88.0] | [466, 492] |
p03848 | u859897687 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['n=int(input())\n#ne,[7,5,3,1,1,3,5,7]8\n#no,[8,6,4,2,0,2,4,6,8]9\nm=[0]*n\nfor i in map(int,input().split()):\n m[i]+=1\nans=1\nfor i in range(n-1,0,-2):\n d[i]!=2:\n ans=0\nif d[0]!=n%2:\n ans=0\nif ans:\n print(2**(n//2)%1000000007)\nelse:\n print(0)\n ', 'n=int(input())\n#ne,[7,5,3,1,1,3,5,7]8\n#no,[8,6... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s039549768', 's872487942', 's891475629'] | [2940.0, 10616.0, 10616.0] | [17.0, 52.0, 54.0] | [250, 253, 253] |
p03848 | u860002137 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['import sys\nfrom collections import Counter\n\nn = int(input())\narr = list(map(int, input().split()))\n\nif arr.count(0) > 1:\n print(0)\n sys.exit()\n\nif len(arr) % 2 == 0 and arr.count(0) > 0:\n print(0)\n sys.exit()\n\ncnt = Counter(arr)\n\nli = list(cnt.values())\n\nif li.count(2) != n // 2:\n pr... | ['Runtime Error', 'Accepted'] | ['s088981727', 's708572163'] | [14820.0, 14820.0] | [64.0, 60.0] | [408, 430] |
p03848 | u867848444 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['from collections import Counter\nn = int(input())\na = list(map(int,input().split()))\nmod = 10 ** 9 + 7\n\ncnt = Counter(a)\nif n % 2 == 0:\n for i, j in cnt.items():\n if j != 2 or not(1 <= i <= n - 1) :\n print(0)\n exit()\nelse:\n for i, j in cnt.items():\n if i == 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s688392851', 's253701919'] | [14812.0, 14812.0] | [66.0, 65.0] | [529, 529] |
p03848 | u871841829 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['N = int(input())\nA = list(map(int, input().split()))\n\nfrom collections import Counter\ncd = Counter(A)\n# A.sort()\n\nif N & 1:\n \n if cd[0] != 1:\n print(0)\n exit(0)\n ng = False\n\n for ix in range(2, N//2 + 1, 2):\n if cd[ix] != 2:\n ng = True\n break\n\n... | ['Wrong Answer', 'Accepted'] | ['s284971023', 's341527778'] | [20492.0, 20412.0] | [78.0, 78.0] | [661, 909] |
p03848 | u899975427 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['n = int(input())\ndp = [2]*n\ndp[0] = 1\nmod = 10**9+7\nan = [int(i) for i in input().split()]\n\nif n % 2 == 1:\n for i in an:\n if i % 2 == 1 or dp[i] == 0:\n print(0)\n exit()\n else:\n dp[i] -= 1\n print(2**((n-1)//2)//mod)\nelse:\n for i in an:\n if i % 2 == 0 or dp[i] == 0:\n pri... | ['Wrong Answer', 'Accepted'] | ['s238452193', 's077453079'] | [14648.0, 14580.0] | [74.0, 74.0] | [370, 368] |
p03848 | u919633157 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['# 2019/08/11\n\nfrom collections import Counter\n\nn=int(input())\na=list(map(int,input().split()))\n\nc=Counter(a)\n\nif c.most_common(1)[0][1]>2 or c[0]>1:\n print(0)\n exit()\n\nfor k,v in c.items():\n if k!=0 and v!=2:\n print(0)\n exit()\n if n%2==v%2:\n print(0)\n exit()\... | ['Wrong Answer', 'Accepted'] | ['s365380098', 's466571483'] | [14820.0, 14820.0] | [64.0, 79.0] | [324, 334] |
p03848 | u948524308 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['N,M=map(int,input().split())\nmod=10**9+7\na=[]\nfor i in range(M):\n a.append(int(input()))\n\n\nDP=[1]*(N+1)\n\nif 1 in a:\n DP[1]=0\n\nfor i in range(2,N+1):\n if i in a:\n DP[i]=0\n if DP[i-1]==0:\n print(0)\n exit()\n else:\n DP[i]=DP[i-1]+DP[i-2]\n D... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s438207495', 's606768624', 's836809101'] | [3064.0, 14820.0, 14008.0] | [17.0, 67.0, 97.0] | [327, 480, 458] |
p03848 | u979552932 | 2,000 | 262,144 | There are N people, conveniently numbered 1 through N. They were standing in a row yesterday, but now they are unsure of the order in which they were standing. However, each person remembered the following fact: the absolute difference of the number of the people who were standing to the left of that person, and the nu... | ['from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\nh = Counter()\nfor x in a:\n h[x] += 1\nf = True\nfor k, v in h..most_common():\n if n % 2 == 1 and k == 0:\n if v != 1:\n f = False\n break\n elif v != 2:\n f = False\n break\... | ['Runtime Error', 'Accepted'] | ['s692610192', 's078135778'] | [2940.0, 16096.0] | [17.0, 125.0] | [516, 510] |
p03856 | u018679195 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ['s=input()\ns=s.replace(\'eraser\',\'#\')\ns=s.replace(\'erase\',\'#\')\ns=s.replace(\'dreamer\',\'#\')\ns=s.replace(\'dream\')\nf=1\nfor it in s:\n if it !=\'#\':\n f=0\n break\n\nif f==1:\n print("YES")\nelse :\n print("NO")', 's=input()\ns=s.replace(\'eraser\',\'*\')\ns=s.replace(\'erase\',\'... | ['Runtime Error', 'Accepted'] | ['s573952995', 's971973221'] | [9180.0, 9164.0] | [27.0, 30.0] | [218, 215] |
p03856 | u038408819 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ["s = input()\ns = s[::-1]\nhoge = ['maerd', 'remaerd', 'esare', 'resare']\ni = 0\nj = 0\nwhile i < len(s):\n j += 1\n i = j\n ans = ''\n while j < len(s):\n ans += s[j]\n if len(ans) > 7:\n print('NO')\n quit()\n if ans in hoge:\n break\n else:\n... | ['Wrong Answer', 'Accepted'] | ['s619289214', 's488608938'] | [3188.0, 3188.0] | [78.0, 79.0] | [332, 333] |
p03856 | u102242691 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ['\ns = input()\nl = ["dream","dreamer","erase","eraser"]\n\nwhile len(s) > 0:\n for i in range(len(l)):\n if l[i] in s:\n s = s.replase(l[i],"")\n else:\n break\n \nif len(s) == 0:\n print("YES")\nelse:\n print("NO")\n', '\ns = input()\nl = ["eraser","erase","dre... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s766839335', 's850062014', 's857340203'] | [3188.0, 3316.0, 3188.0] | [17.0, 2104.0, 36.0] | [258, 258, 237] |
p03856 | u136231568 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ['s = input().strip()\nstrings = "eraser erase dreamer dream".split()\nexceptions = "dreameraser dreamerase".split()\nwhile 1:\n for string in strings:\n if s.startswith(string):\n if string == "dreamer":\n for exception in exceptions:\n if startswith(exception):\n s = s[len(exceptio... | ['Runtime Error', 'Accepted'] | ['s072498758', 's955053904'] | [3064.0, 3316.0] | [22.0, 98.0] | [403, 311] |
p03856 | u237362582 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ["S = input()\nrS = S[::-1]\nkeys = ['dream', 'dreamer', 'erase', 'eraser']\nreversed_keys = [keys[i][::-1] for i in range(len(keys))]\ni = 0\nprint(reversed_keys)\nwhile i < len(rS):\n if rS[i:i+5] in reversed_keys:\n i += 5\n elif rS[i:i+6] in reversed_keys:\n i += 6\n elif rS[i:i+7] in reverse... | ['Wrong Answer', 'Accepted'] | ['s962648127', 's623219470'] | [3188.0, 3188.0] | [30.0, 30.0] | [410, 390] |
p03856 | u271063202 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ["s = input()\nn = len(s)\nidx = 0\nwhile idx < n:\n if idx+5 <= n and s[idx:idx+5] == 'dream':\n idx += 5\n elif s[idx:idx+4] == 'eras':\n idx += 4\n else:\n break\n if idx+2 <= n and s[idx:idx+2] == 'er' and (idx+2 == n or s[idx+2:idx+3] != 'a'):\n idx += 2\nif idx == n:\n p... | ['Wrong Answer', 'Accepted'] | ['s072710668', 's494984464'] | [3188.0, 3188.0] | [17.0, 37.0] | [338, 433] |
p03856 | u280512618 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ["from collections import deque\n\ndef solve(s):\n que = deque()\n que.append(s)\n while len(que) > 0:\n top = que.pop()\n if top == '':\n return 'YES'\n\n if top[:5] == 'dream':\n if top[5:7] == 'er':\n que.append(s[:7])\n que.append(s[:5])\... | ['Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted'] | ['s061885079', 's092955090', 's345262493', 's423214975', 's439387299', 's611471005', 's892647273'] | [3444.0, 3572.0, 3188.0, 2940.0, 3444.0, 3444.0, 110880.0] | [2104.0, 2108.0, 18.0, 18.0, 2108.0, 2104.0, 166.0] | [497, 534, 214, 213, 514, 518, 534] |
p03856 | u284854859 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ['dreameraser', "s=list(input())\nn = len(s)\n\nc=0\nk=0\nwhile c==0:\n if k ==n:\n c = 1\n else:\n \n if k + 7 <= n-1 and s[k]=='d' and s[k+1] == 'r' and s[k+2] == 'e' and s[k+3] == 'a' and s[k+4] == 'm' and s[k+5] == 'e' and s[k+6] == 'r' and s[k+7] == 'a':\n k += 5\n elif... | ['Runtime Error', 'Accepted'] | ['s894227964', 's984251189'] | [2940.0, 4212.0] | [18.0, 54.0] | [11, 1112] |
p03856 | u375616706 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ['s = input()\n\ni = 0\nwhile s:\n str = s[i:i+5]\n if str == "dream" or str == "erase":\n i += 5\n elif str[i:i+2] == "er":\n i += 2\n else:\n print("NO")\n exit()\n\nans = "YES"\nprint(ans)\n', 'import sys\nsys.setrecursionlimit(10**9)\ns1 = "maerd"\ns2 = "remaerd"\ns3 = "esare... | ['Wrong Answer', 'Accepted'] | ['s554602156', 's853131780'] | [3188.0, 18140.0] | [18.0, 64.0] | [216, 504] |
p03856 | u398942100 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ["S = input().replace('eraser','').replace('erase','').replace('dreamer','').replace('dream','')\nif S == '':\n print('Yes')\nelse:\n print('No')", "S = input().replace('eraser','').replace('erase','').replace('dreamer','').replace('dream','')\nif S == '':\n print('YES')\nelse:\n print('NO')"] | ['Wrong Answer', 'Accepted'] | ['s378434884', 's392177239'] | [3188.0, 3188.0] | [19.0, 19.0] | [145, 145] |
p03856 | u405660020 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ['s=input()\ns=s.replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","")\nif s:\n print("NO")\nelse:\n print("YES")', 's=input()\ns=s.replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","")\nif s:\n print("NO")\nelse:\n print("YES")'] | ['Runtime Error', 'Accepted'] | ['s429548972', 's995387104'] | [3188.0, 3188.0] | [20.0, 19.0] | [143, 141] |
p03856 | u426108351 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ["s = list(input())\ns.reverse()\ns = ''.join(map(str, s))\ncount = 0\nword = ['maerd', 'remaerd', 'resare', 'esare']\n\nwhile count <= len(s)-8:\n counttemp = count\n for i in range(4):\n w = word[i]\n if s[count:count+len(w)] == w:\n count += len(w)\n if counttemp == count:\n break\nif s[count:] in w... | ['Wrong Answer', 'Accepted'] | ['s351418852', 's062849386'] | [4652.0, 4652.0] | [52.0, 52.0] | [349, 362] |
p03856 | u558528117 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ['import sys\n\ndef solve(s):\n sys.stderr.write(s)\n sys.stderr.write("\\n")\n\n while(len(s) >= 1):\n if s == "":\n return True\n elif s.startswith("maerd"):\n s = s[5:]\n elif s.startswith("remaerd"):\n s = s[7:]\n elif s.startswith("esare"):\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s120247655', 's468917985', 's966245761', 's023355238'] | [3316.0, 3188.0, 3188.0, 3444.0] | [18.0, 18.0, 17.0, 70.0] | [637, 559, 530, 623] |
p03856 | u765237551 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ['s = input()\n\ndef solve(s):\n i = 0\n n = len(s)\n\n while i < n:\n if s[i:i+5] == \'dream\':\n if s[i+5:i+7] != \'er\':\n i += 5\n elif i+7 < n and s[i+7] == \'a\':\n i += 5\n else:\n i += 7\n elif s[i:i+5] == \'era... | ['Runtime Error', 'Accepted'] | ['s817371347', 's314151717'] | [3188.0, 3188.0] | [28.0, 27.0] | [504, 516] |
p03856 | u780475861 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ["if not input().replace('eraser', '').replace('erase', '').replace('dream', '').replace('dreamer', ''):\n print('Yes')\nelse:\n print('No')", "if not input().replace('eraser', '').replace('erase', '').replace('dreamer', '').replace('dream', ''):\n print('YES')\nelse:\n print('NO')"] | ['Wrong Answer', 'Accepted'] | ['s755934755', 's393470762'] | [3188.0, 3188.0] | [19.0, 19.0] | [137, 137] |
p03856 | u816631826 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ['s=input(str())\nlst=["eraser","erase","dreamer","dream"]\nfor t in lst:\n s=s.replace(t,"")\nif s=="":\n print(\'NO\')\nelse:\n print(\'YES\')\n ', 's=input()\ns=s.replace(\'eraser\',\'\')\ns=s.replace(\'erase\',\'\')\ns=s.replace(\'dreamer\',\'\')\ns=s.replace(\'dream\',\'\')\nif s==\'\':\n print("YES... | ['Wrong Answer', 'Accepted'] | ['s050751933', 's783385442'] | [9196.0, 9056.0] | [29.0, 27.0] | [145, 158] |
p03856 | u875291233 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ['# coding: utf-8\n# Your code here!\nimport sys\nread = sys.stdin.read\nreadline = sys.stdin.readline\n\n#n,*a = map(int,readline().split())\n\n\ns = [*input()]\na = [*"dream"]\nb = [*"dreamer"]\nc = [*"erase"]\nd = [*"eraser"]\n\n\nwhile True:\n if not s:\n print("Yes")\n break\n elif s[-5:] == a:... | ['Wrong Answer', 'Accepted'] | ['s486448055', 's184292901'] | [9872.0, 9752.0] | [30.0, 45.0] | [636, 634] |
p03856 | u926678805 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ["s=input()\nd=['dream','dreamer','erase','eraser']\nwhile s:\n for m in d:\n if s.endswith(m):\n s=s.rstrip(m)\n break\n else:\n print('NO')\n exit()\nprint('YES')\n", "s=input()\nd=['dream','dreamer','erase','eraser']\nwhile s:\n for m in d:\n if s.endswith(m... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s004865863', 's060386965', 's015948965'] | [3188.0, 3188.0, 3188.0] | [18.0, 18.0, 75.0] | [202, 201, 202] |
p03856 | u932465688 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ["s = input()\ncopys = s\ns += 'r'\ni = 0\nt = ''\nwhile i <= len(s)-5:\n if s[i:i+5] == 'dream':\n if s[i+5] == 'r':\n i += 6\n t += 'dreamer'\n else:\n i += 5\n t += 'dream'\n elif s[i:i+5] == 'erase':\n if s[i+5] == 'r':\n i += 6\n t += 'eraser'\n else:\n i += 5\n ... | ['Wrong Answer', 'Accepted'] | ['s913003459', 's029437969'] | [3188.0, 3188.0] | [18.0, 30.0] | [382, 586] |
p03856 | u966695411 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ["S = input()\nfor i in ['eraser', 'erase', 'dreamer', 'dream']:\n S=S.replace(i, 'R')\nprint(['NO', 'YES'][len(s) == 1 and 'R' in s])", "S = input()\nfor i in ['eraser', 'erase', 'dreamer', 'dream']:\n S=S.replace(i, 'R')\ns = set(S)\nprint(['NO', 'YES'][len(s) == 1 and 'R' in s])"] | ['Runtime Error', 'Accepted'] | ['s475454272', 's494227109'] | [3316.0, 3188.0] | [25.0, 25.0] | [132, 143] |
p03856 | u973972117 | 2,000 | 262,144 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | ["S = input()\nN = len(S)\ni = 0\nwhile i < N:\n sig = 0\n S5 = S[i:i+5]\n if S5 == 'dream':\n sig = 1\n if S[i+5:i+7] == 'er' and S[i+7] != 'a':\n i += 2\n i += 5\n elif S5 == 'erase':\n sig = 1\n if S[i+5:i+6] == 'r':\n i += 1\n i += 5\n i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s184391707', 's480912085', 's673311285'] | [9156.0, 9136.0, 9108.0] | [39.0, 38.0, 40.0] | [411, 411, 415] |
p03864 | u023231878 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ["s=input();print(['Second','First'][(len(s)+(s[0]==s[-1]))%2])", "n, x = map(int, input().split(' '))\na = list(map(int, input().split(' ')))\nans = 0\nif a[0] > x:\n ans += a[0] - x\n a[0] = x\nfor i in range(1,len(a)):\n if a[i-1] + a[i] > x:\n ans += a[i-1] + a[i] - x\n a[i] = x - a[i-1]\npri... | ['Wrong Answer', 'Accepted'] | ['s548351944', 's737001158'] | [3060.0, 14132.0] | [17.0, 104.0] | [61, 250] |
p03864 | u039623862 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ["xs,ys,xt,yt = map(int, input().split())\nn = int(input())\nc = [(xs,ys, 0),(xt,yt,0)]\nfor i in range(n):\n x,y,r = map(int, input().split())\n c.append((x,y,r))\n\ndef circle_circle(ax,ay,ar,bx,by,br):\n d =((ax-bx)**2 + (ay-by)**2)**0.5\n return max(0, d-(ar+br))\n\ndef dijkstra(V, edges, root):\n im... | ['Runtime Error', 'Accepted'] | ['s228202447', 's264509195'] | [3316.0, 14548.0] | [23.0, 163.0] | [1140, 368] |
p03864 | u107077660 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['from math import sqrt\ninf = 10**10\nx_s, y_s, x_t, y_t = map(int, input().split())\nN = int(input())\nxyr = []\nfor i in range(N):\n\tx_i, y_i, r_i = map(int, input().split())\n\txyr.append((x_i, y_i, r_i))\np = (x_s, y_s)\ngoal = (x_t, y_t)\nans = 0\nwhile p != goal and xyr:\n\tD = inf\n\tfor i in range(N):\n\t\tx,... | ['Runtime Error', 'Accepted'] | ['s894489062', 's792358924'] | [3188.0, 14152.0] | [23.0, 142.0] | [621, 258] |
p03864 | u200239931 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['def getinputdata():\n\n \n array_result = []\n \n data = input()\n \n array_result.append(data.split(" "))\n\n flg = 1\n\n try:\n\n while flg:\n\n data = input()\n\n if(data != ""):\n \n array_result.append(data.split(" "))\n\n ... | ['Runtime Error', 'Accepted'] | ['s885741832', 's561271441'] | [14588.0, 14812.0] | [164.0, 162.0] | [849, 925] |
p03864 | u284854859 | 2,000 | 262,144 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | ['def dijkstra(s):\n \n \n d = [float("inf")] * n\n used = [False] * n\n d[s] = 0\n \n while True:\n v = -1\n \n for i in range(n):\n if (not used[i]) and (v == -1):\n v = i\n elif (not used[i]) and d[i] < d[v]:\n v = i\n ... | ['Runtime Error', 'Accepted'] | ['s335493707', 's948426895'] | [3064.0, 14540.0] | [18.0, 114.0] | [1060, 250] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.