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
|
---|---|---|---|---|---|---|---|---|---|---|
p03786 | u572142121 | 2,000 | 262,144 | Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature. | ['N=int(input())\nA=list(map(int,input().split()))\nB=sorted(A)\nimport numpy\nC=numpy.cumsum(B)\ncnt=1\nfor i in range(N-1):\n if C[-2-i]*2>=A[-1-i]:\n cnt+=1\n else:\n print(cnt)\n exit()\nprint(cnt)', 'N=int(input())\nA=list(map(int,input().split()))\nB=sorted(A)\nimport numpy\nC=numpy.cumsum(B)\ncnt=1\nfor i in range(N-1):\n if C[-2-i]*2>=B[-1-i]:\n cnt+=1\n else:\n print(cnt)\n exit()\nprint(cnt)'] | ['Wrong Answer', 'Accepted'] | ['s327730317', 's779323457'] | [18796.0, 18800.0] | [449.0, 435.0] | [198, 198] |
p03786 | u572193732 | 2,000 | 262,144 | Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature. | ['N = int(input())\nA = list(map(int, input().split()))\n\nset_A = set(A)\nif len(set_A) == 1:\n print(len(A))\n exit()\n \ntmp_slime = A[0]\ntmp_flag = True\nfor i in range(1, len(A)):\n if tmp_slime*2 >= A[i]:\n tmp_slime += A[i]\n else:\n tmp_flag = False\n break\nif tmp_flag:\n print(len(A))\n exit()\n\nA = sorted(A)\nlow = 0\nhigh = len(A)-1\nmid = (low + high) // 2\nwhile True:\n tmp = mid\n slime = sum(A[0:mid+1])\n flag = True\n for i in range(mid+1, len(A)):\n if slime*2 >= A[i]:\n slime += A[i]\n else:\n flag = False\n break\n if flag:\n high = mid\n mid = (low + high) // 2\n else:\n low = mid\n mid = (low + high) // 2\n if mid == tmp:\n break\n \nprint(len(A) - len(A[0:mid+1]))', 'N = int(input())\nA = list(map(int, input().split()))\n\nA = sorted(A)\n\nset_A = set(A)\nif len(set_A) == 1:\n print(len(A))\n exit()\n \ntmp_slime = A[0]\ntmp_flag = True\nfor i in range(1, len(A)):\n if tmp_slime*2 >= A[i]:\n tmp_slime += A[i]\n else:\n tmp_flag = False\n break\nif tmp_flag:\n print(len(A))\n exit()\n\nlow = 0\nhigh = len(A)-1\nmid = (low + high) // 2\nwhile True:\n tmp = mid\n slime = sum(A[0:mid+1])\n flag = True\n for i in range(mid+1, len(A)):\n if slime*2 >= A[i]:\n slime += A[i]\n else:\n flag = False\n break\n if flag:\n high = mid\n mid = (low + high) // 2\n else:\n low = mid\n mid = (low + high) // 2\n if mid == tmp:\n break\n \nprint(len(A) - len(A[0:mid+1]))\n'] | ['Wrong Answer', 'Accepted'] | ['s053383266', 's863783225'] | [14916.0, 15300.0] | [552.0, 597.0] | [800, 802] |
p03786 | u648212584 | 2,000 | 262,144 | Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature. | ['import sys\ninput = sys.stdin.readline\ndef main():\n\tN = int(input())\n\ta = list(map(int,input().split()))\n\ta.sort(reverse=True)\n\tsum_list = [a[0]]\n\tfor i in range(N-1):\n\t\tsum_list.append(sum_list[i]+a[i+1])\n\tcount = 1\n\tsum(a) = A\n\tfor i in range(N):\n\t\tif (A-sum_list[i])*2 >= a[i]:\n\t\t\tcount += 1\n\t\telse:\n\t\t\tbreak\n\n\tprint(count)\n\nif __name__ == "__main__":\n\tmain()\n', 'import sys\ninput = sys.stdin.readline\ndef main():\n\tN = int(input())\n\ta = list(map(int,input().split()))\n\ta.sort(reverse=True)\n\tsum_list = [a[0]]\n\tfor i in range(N-1):\n\t\tsum_list.append(sum_list[i]+a[i+1])\n\tcount = 1\n\tA = sum(a)\n\tfor i in range(N):\n\t\tif (A-sum_list[i])*2 >= a[i]:\n\t\t\tcount += 1\n\t\telse:\n\t\t\tbreak\n\n\tprint(count)\n\nif __name__ == "__main__":\n\tmain()'] | ['Runtime Error', 'Accepted'] | ['s748481918', 's464658350'] | [3064.0, 14276.0] | [17.0, 119.0] | [362, 361] |
p03786 | u683134447 | 2,000 | 262,144 | Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature. | ['import sys\nm = int(input())\nn = list(map(int,input().split()))\n\nfrag = 0\ncount = 0\nwhile(True):\n if frag == 0:\n for i in range(len(n)-1):\n if n[i]*2 < n[i+1]:\n frag = 1\n if frag == 0:\n print(len(n)-count)\n sys.exit()\n count += 1\n n.sort()\n n[0] += n[1]\n n.remove(n[1])\n frag2 = 0\n print(n)\n for i in range(len(n)-1):\n if n[i]*2 < n[i+1]:\n frag2 = 1\n if frag2 == 0:\n print(len(n))\n sys.exit()\n \n\n\n\n', 'm = int(input())\nn = list(map(int,input().split()))\n\nn.sort()\nSUM = 0\ncount = 0\nfor i in range(len(n)-1):\n SUM += n[i]\n if n[i+1] > SUM*2:\n count = i+1\nprint(len(n)-count)\n \n\n'] | ['Wrong Answer', 'Accepted'] | ['s014700107', 's266660832'] | [92904.0, 14308.0] | [2104.0, 109.0] | [513, 191] |
p03786 | u721970149 | 2,000 | 262,144 | Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature. | ['N = int(input())\nA = [int(x) for x in input().split()]\nA.sort()\n\nprint(A)\ntmp = A[0]\nans = 1\nfor i in range(1,N) :\n if A[i] <= tmp*2 :\n tmp += A[i]\n ans += 1\n else :\n tmp += A[i]\n ans = 1\n\nprint(ans)\n', 'N = int(input())\nA = [int(x) for x in input().split()]\nA.sort()\n\ntmp = A[0]\nans = 1\nfor i in range(1,N) :\n if A[i] <= tmp*2 :\n ans += 1\n else :\n ans = 1\n tmp += A[i]\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s917648760', 's417431825'] | [14308.0, 14304.0] | [133.0, 122.0] | [234, 201] |
p03786 | u789364190 | 2,000 | 262,144 | Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature. | ["n = int(input())\na = [int(x) for x in input().split(' ')]\n\na.sort()\ns = [a[0]]\nfor i in range(1, n):\n s.append(a[i - 1] + a[i])\n\nres = 1\nfor i in range(1, n):\n if s[-i] * 2 >= a[-i + 1]:\n res += 1\n else:\n break\n\nprint(res)\n", "n = int(input())\na = [int(x) for x in input().split(' ')]\n\na.sort()\ns = [a[0]]\nfor i in range(1, n):\n s.append(s[i - 1] + a[i])\n\nres = 1\nfor i in reversed(range(0, n - 1)):\n if s[i] * 2 >= a[i + 1]:\n res += 1\n else:\n break\n\nprint(res)\n"] | ['Wrong Answer', 'Accepted'] | ['s777011034', 's616060285'] | [14224.0, 14308.0] | [144.0, 143.0] | [232, 244] |
p03786 | u790710233 | 2,000 | 262,144 | Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature. | ['import heapq\nn = int(input())\nA = list(map(int, input().split()))\nheapq.heapify(A)\n\ncnt = 1\nprev = heapq.heappop(A)\nwhile A:\n x = heapq.heappop(A)\n if prev > x:\n heapq.heappush(A, prev)\n prev = x\n continue\n print(prev, x, A, cnt)\n if 2*prev < x:\n cnt = 1\n else:\n cnt += 1\n prev += x\n\nprint(cnt)\n', 'n = int(input())\nA = sorted(map(int, input().split()))\n\nt = 0\ns = A[0]\nfor i in range(1, n):\n if 2*s < A[i]:\n t = i\n s += A[i]\n\nprint(n-t)'] | ['Runtime Error', 'Accepted'] | ['s711158221', 's695739445'] | [143544.0, 14320.0] | [1764.0, 108.0] | [348, 151] |
p03786 | u888092736 | 2,000 | 262,144 | Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature. | ['from fractions import gcd\nfrom functools import reduce\n\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\ng = reduce(gcd, A)\nif K <= max(A) and K % g == 0:\n print("POSSIBLE")\nelse:\n print("IMPOSSIBLE")\n', 'from itertools import accumulate\n\n\nN, *A = map(int, open(0).read().split())\nA.sort()\nacc = list(accumulate(A))\nans = N\nfor i in range(N - 1):\n if 3 * acc[i] < acc[i + 1]:\n ans = N - i - 1\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s206249495', 's492660223'] | [5048.0, 20532.0] | [35.0, 89.0] | [228, 209] |
p03786 | u896741788 | 2,000 | 262,144 | Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature. | ['n=int(input())\nl=sorted(list(map(int,input().split())))\nans,s=0,0\nfor u in l:\n if 2*s>=u:ans+=1\n s+=u\nprint(ans)', 'n=int(input())\nl=sorted(list(map(int,input().split())))\nans,s=1,0\nfor u in l:\n if 2*s>=u:ans+=1\n else:ans=1\n s+=u\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s214126615', 's496586930'] | [14320.0, 14320.0] | [106.0, 102.0] | [114, 128] |
p03786 | u994521204 | 2,000 | 262,144 | Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature. | ['n=int(input())\nA=list(map(int,input().split()))\nsaisho=10**15\ncnt=0\nfor i in range(n):\n if A[i]<saisho/2:\n saisho=A[i]\n else:\n cnt+=1\nprint(cnt)', 'n=int(input())\nA=list(map(int,input().split()))\nA.sort()\ncnt=1\ncum=0\nfor i in range(n-1):\n cum+=A[i]\n if A[i+1]-2*cum<=0:\n cnt+=1\n else:\n cnt=1\nprint(cnt)'] | ['Wrong Answer', 'Accepted'] | ['s194215091', 's257699817'] | [14320.0, 14320.0] | [72.0, 122.0] | [165, 177] |
p03799 | u024340351 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['N, M= map(float, input().split())\nif N > round(M/2):\n\tprint(round(M/2))\nelse:\n\tc=N+(M-N*2)//4\n\tprint(c)\n\n\t', 'N, M= map(float, input().split())\nif N > round(M/2):\n\tprint(round(M/2))\nelse:\n\tc=N+(M-N*2)//4\n\tprint(int(c))\n'] | ['Wrong Answer', 'Accepted'] | ['s681615693', 's328540370'] | [2940.0, 2940.0] | [17.0, 17.0] | [106, 109] |
p03799 | u048176319 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['n,m = map(int, input().split())\n\nif n > (m+n)/3:\n print(m//2)\n exit()\n\nans = n\nm -= 2*n\nans += m//4', 'n,m = map(int, input().split())\n\nif n > (m+n)/3:\n print(m//2)\n exit()\n\nans = n\nm -= 2*n\nans += m//4\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s918854424', 's482098825'] | [2940.0, 2940.0] | [17.0, 17.0] | [105, 116] |
p03799 | u075304271 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['def solve():\n n, m = map(int, input().split())\n if m//2 <= n:\n print(m//2)\n else:\n print("ばーか")\n return 0\n \nif __name__ == "__main__":\n solve()\n', 'def solve():\n n, m = map(int, input().split())\n if m//2 <= n:\n print(m//2)\n else:\n ans = 0\n ans += n\n m = m-n*2\n ans += m//4\n print(ans)\n return 0\n \nif __name__ == "__main__":\n solve()\n'] | ['Wrong Answer', 'Accepted'] | ['s227080289', 's086865673'] | [2940.0, 2940.0] | [17.0, 17.0] | [161, 208] |
p03799 | u143051858 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['s,c = map(int,input().split())\nres = 0\nif s == 1 or c == 1:\n print(0)\n exit()\nif s*2 <= c:\n res += s\n c -= s*2\nelse:\n res += c//2\n c //= 2\nprint(res+c//4)', 's,c = map(int,input().split())\nres = 0\n\nif s*2 <= c:\n res += s\n c -= s*2\n res+= c\nelse:\n res += c//2\n c //= 2\nif c:\n res += m//4\nprint(res)', 's,c = map(int,input().split())\nres = 0\nif s*2 <= c:\n res = s\n c -= s*2\n s = 0\nelse:\n res += c//2\n c = 0\n\nif c:\n res += c//4\nprint(res)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s804665743', 's909983794', 's680269253'] | [9076.0, 9136.0, 9032.0] | [27.0, 25.0, 24.0] | [172, 157, 152] |
p03799 | u179169725 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['N,M=map(int,input().split())\nn1=min(N,M//2)\nprint(ans+(M-2*n1)//4)\n', 'N,M=map(int,input().split())\nn1=min(N,M//2)\nN-=n1\nM-=2*n1\nprint(ans+(M-2*n1)//4)\n', 'N,M=map(int,input().split())\nn1=min(N,M//2)\nprint(n1+(M-2*n1)//4)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s015264516', 's779741326', 's741163597'] | [9096.0, 9120.0, 9088.0] | [23.0, 20.0, 28.0] | [67, 81, 66] |
p03799 | u278356323 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ["# ARC069c\ndef main():\n import sys\n input = sys.stdin.readline\n sys.setrecursionlimit(10**6)\n\n n, m = map(int, input().split())\n if n > m*2:\n print(m//2+(n-m//2)//2)\n else:\n print(n)\n\n\nif __name__ == '__main__':\n main()\n", "# ARC069c\ndef main():\n import sys\n input = sys.stdin.readline\n sys.setrecursionlimit(10**6)\n\n n, m = map(int, input().split())\n if m > n*2:\n print(n+(m-n*2)//4)\n else:\n print(m//2)\n\n\nif __name__ == '__main__':\n main()\n"] | ['Wrong Answer', 'Accepted'] | ['s675986004', 's482799808'] | [2940.0, 2940.0] | [17.0, 17.0] | [254, 253] |
p03799 | u316386814 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['import sys\nsys.setrecursionlimit(10**7)\nINF = 10 ** 18\nMOD = 10 ** 9 + 7\ndef POW(x, y):\n if y == 0:\n return 1\n elif y == 1:\n return x\n elif y % 2 == 0:\n return POW(x, y // 2) ** 2 % MOD\n else:\n return POW(x, y // 2) ** 2 * x % MOD\ndef mod_factorial(x, y): return x * POW(y, MOD - 2) % MOD\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef II(): return int(sys.stdin.readline())\ndef SI(): return input()\nfrom functools import reduce\n\ndef main():\n N, M = LI()\n if N >= 2 * M:\n return M\n rem = 2 * M - N\n ans = M + rem // 3\n return ans\n\nprint(main())', 'import sys\nsys.setrecursionlimit(10**7)\nINF = 10 ** 18\nMOD = 10 ** 9 + 7\ndef POW(x, y):\n if y == 0:\n return 1\n elif y == 1:\n return x\n elif y % 2 == 0:\n return POW(x, y // 2) ** 2 % MOD\n else:\n return POW(x, y // 2) ** 2 * x % MOD\ndef mod_factorial(x, y): return x * POW(y, MOD - 2) % MOD\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef II(): return int(sys.stdin.readline())\ndef SI(): return input()\nfrom functools import reduce\n\ndef main():\n N, M = LI()\n if N >= M // 2:\n return M // 2\n rem = M - 2 * N\n ans = M // 2 + rem // 3\n return ans\n\nprint(main())', 'import sys\nsys.setrecursionlimit(10**7)\nINF = 10 ** 18\nMOD = 10 ** 9 + 7\ndef POW(x, y):\n if y == 0:\n return 1\n elif y == 1:\n return x\n elif y % 2 == 0:\n return POW(x, y // 2) ** 2 % MOD\n else:\n return POW(x, y // 2) ** 2 * x % MOD\ndef mod_factorial(x, y): return x * POW(y, MOD - 2) % MOD\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef II(): return int(sys.stdin.readline())\ndef SI(): return input()\nfrom functools import reduce\n\ndef main():\n N, M = LI()\n if N >= M // 2:\n return M // 2\n rem = M - 2 * N\n ans = N + rem // 4\n return ans\n\nprint(main())'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s762849055', 's851613878', 's435085624'] | [3572.0, 3572.0, 3572.0] | [22.0, 22.0, 23.0] | [808, 819, 814] |
p03799 | u333139319 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['[n,m] = [int(i) for i in input().split()]\nif n * 2 >= m:\n print(n)\nelse:\n if n >= 2:\n ans = n\n m = min(m - n * 2,0)\n ans += m//4\n print(ans)\n else:\n print(0)\n', '[n,m] = [int(i) for i in input().split()]\nif n * 2 >= m:\n print(n)\nelse:\n if m >= 2:\n ans = n\n m = min(m - n * 2,0)\n ans += m//4\n print(ans)\n else:\n print(0)\n', '[n,m] = [int(i) for i in input().split()]\nif n * 2 >= m:\n print(m // 2)\nelse:\n if m >= 2:\n ans = n\n m = max(m - n * 2,0)\n ans += m//4\n print(ans)\n else:\n print(0)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s329373314', 's461913703', 's529286745'] | [8976.0, 9100.0, 9056.0] | [26.0, 27.0, 27.0] | [202, 202, 207] |
p03799 | u535171899 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['import sys\nN, M = map(int, input().split())\nS = [0] * M\nC = [0] * M\nfor i in range(M):\n S[i], C[i] = map(int, input().split())\n\nfor i in range(1000):\n string = str(i)\n if len(string) != N:\n continue\n flag = True\n for j in range(M):\n if string[S[j] - 1] == str(C[j]):\n None\n else:\n flag = False\n break\n if flag:\n print(i)\n sys.exit(0)\nprint("-1")\n', 'n,m = map(int,input().split())\n\nif n*2>=m:\n print(m//2)\nelse:\n tmp=m-n*2\n print(n+tmp//4)'] | ['Runtime Error', 'Accepted'] | ['s033869511', 's250242238'] | [1407348.0, 2940.0] | [2128.0, 17.0] | [432, 98] |
p03799 | u593567568 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['N,M = map(int,inpu().split())\n\ndef solve(N,M):\n \n if M < N * 2:\n return N\n \n M -= N * 2\n \n ans = N + M // 3\n return ans\n\nprint(solve(N,M))\n', 'N,M = map(int,input().split())\n\ndef solve(N,M):\n \n if M < N * 2:\n return M // 2\n \n M -= N * 2\n \n ans = N + (M // 4)\n return ans\n\nprint(solve(N,M))\n'] | ['Runtime Error', 'Accepted'] | ['s002775365', 's754589037'] | [2940.0, 2940.0] | [17.0, 17.0] | [166, 174] |
p03799 | u622011073 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ["n=int(input());s=input();a=['SS','WS','SW','WW']\nfor i in range(n):\n for j in range(4):a[j]+='SW'[::-1 if s[i]=='o' else 1][a[j][i]==a[j][i+1]]\nfor i in range(4):\n if a[i][1]==a[i][n+1] and a[i][0] == a[i][n]:print(a[i][1:n+1]);exit()\nprint(-1)", 'n,m=map(int,input().split())\nprint(min((m+2*n),2*m)//2)', 'n,m=map(int,input().split());print((min(2*n,m)+m)//4)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s326157049', 's823665910', 's836166276'] | [3064.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0] | [250, 55, 53] |
p03799 | u637824361 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['N, M = map(int, input().split())\nans = 0\nif N > M//2:\n print(M//2)\nelse:\n p = M - 2*N\n print(N + p//4', 'N, M = map(int, input().split())\nans = 0\nif N > M//2:\n print(M//2)\nelse:\n p = M - 2*N\n print(N + p//4)'] | ['Runtime Error', 'Accepted'] | ['s610770009', 's460356569'] | [2940.0, 2940.0] | [17.0, 17.0] | [104, 105] |
p03799 | u655975843 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['import sys\nimport collections\nns = lambda: sys.stdin.readline().rstrip()\nni = lambda: int(ns())\nnm = lambda: map(int, sys.stdin.readline().split())\nnl = lambda: list(nm())\nnsl = lambda: map(str, sys.stdin.readline().split())\n\nn, m = nm()\nif m >= 2 * n:\n c = 2 * n - m\n print(n + (c // 4))\nelse:\n print(n)\n', 'import sys\nimport collections\nns = lambda: sys.stdin.readline().rstrip()\nni = lambda: int(ns())\nnm = lambda: map(int, sys.stdin.readline().split())\nnl = lambda: list(nm())\nnsl = lambda: map(str, sys.stdin.readline().split())\n\nn, m = nm()\nif m >= 2 * n:\n c = m - 2 * n\n print(n + (c // 4))\nelse:\n print(m // 2)\n'] | ['Wrong Answer', 'Accepted'] | ['s239167391', 's498583512'] | [3316.0, 3316.0] | [20.0, 21.0] | [314, 319] |
p03799 | u724742135 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['from sys import exit, stdin\nN, M = [int(_) for _ in stdin.readline().rstrip().split()]\nr = M-2*N\nif r <= 0:\n print(N//2)\nelse:\n pritnt(N+r//4)', 'from sys import exit, stdin\nN, M = [int(_) for _ in stdin.readline().rstrip().split()]\nr = M-2*N\nif r <= 0:\n print(M//2)\nelse:\n print(N+r//4)'] | ['Runtime Error', 'Accepted'] | ['s590546724', 's101849446'] | [2940.0, 2940.0] | [17.0, 17.0] | [148, 147] |
p03799 | u755962107 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | [' u, v = map(int, input().split())\n print(min(u//2, (2*u+v)//4))', 'u, v = map(int, input().split())\nprint(min(u//2, (2*u+v)//4)', 'u, v = map(int, input().split())\nif 2*u > v:\n print(v//2) \nelse:\n print((2*u+v)//4)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s579547290', 's656391621', 's751519959'] | [2940.0, 3064.0, 2940.0] | [18.0, 17.0, 17.0] | [69, 60, 87] |
p03799 | u820560680 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['n, m = map(int, input().split())\n\nk = max(m // 2, (n + m // 2) // 2)\nprint(k)\n', 'n, m = map(int, input().split())\n\nk = min(m // 2, (n + m // 2) // 2)\nprint(k)\n'] | ['Wrong Answer', 'Accepted'] | ['s760921215', 's630477850'] | [2940.0, 2940.0] | [17.0, 17.0] | [78, 78] |
p03799 | u880644800 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['def solve(s, c):\n """rv = min(Sr, Cr//2), where\n Sr = S + a\n Cr = C - 2a # a>=0, a is number of (2c->S) conversions\n thus\n rv = max(min(S + a, C//2 - a) for a in range(0, C//2))\n if a >=0, optimum is Sr == Cr//2, thus\n S + a == Cr//2 - a\n a = (C//2 - S) / 2\n """\n a = (c / 2 - s) / 2\n if a < 0:\n a = 0\n al = int(a)\n ar = int(a) + 1\n return max(min(s + a, c//2 - a) for a in (al, ar))\n\n\nif __name__ == "__main__":\n import sys\n S, C = sys.stdin.readline().split()\n print(solve(s, c))\n\n\ndef test_solve():\n assert solve(1, 2) == 1\n assert solve(0, 4) == 1\n assert solve(0, 1) == 0\n\n\ndef test_atcode():\n assert solve(1, 6) == 2\n assert solve(12345, 678901) == 175897', 'def solve(s, c):\n """rv = min(Sr, Cr//2), where\n Sr = S + a\n Cr = C - 2a # a>=0, a is number of (2c->S) conversions\n thus\n rv = max(min(S + a, C//2 - a) for a in range(0, C//2))\n if a >=0, optimum is Sr == Cr//2, thus\n S + a == Cr//2 - a\n a = (C//2 - S) / 2\n """\n a = (c / 2 - s) / 2\n if a < 0:\n a = 0\n al = int(a)\n ar = int(a) + 1\n return max(min(s + a, c//2 - a) for a in (al, ar))\n\n\nif __name__ == "__main__":\n import sys\n S, C = map(int, sys.stdin.readline().split())\n print(solve(S, C))\n\n\ndef test_solve():\n assert solve(1, 2) == 1\n assert solve(0, 4) == 1\n assert solve(0, 1) == 0\n\n\ndef test_atcode():\n assert solve(1, 6) == 2\n assert solve(12345, 678901) == 175897'] | ['Runtime Error', 'Accepted'] | ['s687644152', 's909862746'] | [3064.0, 3064.0] | [18.0, 17.0] | [798, 808] |
p03799 | u984276646 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['N, M = map(int, input().split())\nif 2 * N > M:\n print(M // 2)\nelse:\n C = M // 2\n n = (C - N) // 2\n print(max(min(S+n-1, C-n+1), min(S+n, C-n), min(S+n+1, C-n-1)))', 'N, M = map(int, input().split())\nif 2 * N > M:\n print(M // 2)\nelse:\n C = M // 2\n n = (C - N) // 2\n print(max(min(N+n-1, C-n+1), min(N+n, C-n), min(N+n+1, C-n-1)))\n'] | ['Runtime Error', 'Accepted'] | ['s289803883', 's108566118'] | [3060.0, 2940.0] | [17.0, 17.0] | [166, 167] |
p03799 | u994521204 | 2,000 | 262,144 | Snuke loves puzzles. Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below: Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces. Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces. | ['n,m=map(int, input().split())\np1=n\np2=m//2\nif p1>p2:\n \tprint(p2)\nelse:\n\tdelta=p2-p1\n print(delta//2+p1)', 'n,m=map(int,input().split())\np1=n\np2=m//2\nif p1>p2:\n \tprint(p2)\nelse:\n\tdelta=p2-p1\n print(delta//2+p1)', 'n,m=map(int,input().split())\np1=n\np2=m//2\nif p1>p2:\n \tprint(p2)\nelse:\n\tdelta=p2-p1\n print(delta//2+p1)\n', 'n,m=map(int,input().split())\np1=n\np2=m//2\nif p1>p2:\n print(p2)\nelse:\n delta=p2-p1\n print(delta//2+p1)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s083943727', 's383436807', 's418282455', 's141018239'] | [2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 18.0, 17.0, 17.0] | [106, 105, 106, 110] |
p03800 | u345966487 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['import sys\n\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninm = lambda: map(int, sys.stdin.readline().split())\ninl = lambda: list(inm())\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print("\\033[33m", *a, "\\033[0m", **dict(file=sys.stderr, **kw))\n\nN = ini()\nS = ins()\n\n\ndef flip(x):\n if x == "S":\n return "W"\n else:\n return "S"\n\n\ndef solve():\n for p in ["SS", "SW", "WS", "WW"]:\n buf = list(p)\n for i in range(1, N):\n if (buf[i] == "S" and S[i] == "o") or (buf[i] == "W" and S[i] == "x"):\n buf.append(buf[i - 1])\n else:\n buf.append(flip(buf[i - 1]))\n assert len(buf) == N + 1\n if buf[0] != buf[-1]:\n continue\n buf.pop()\n if S[1] == S[-1]:\n if (buf[0] == "S" and S[0] == "x") or (buf[0] == "W" and S[0] == "o"):\n continue\n else:\n if (buf[0] == "S" and S[0] == "o") or (buf[0] == "W" and S[0] == "x"):\n continue\n return "".join(buf)\n return -1\n\n\nprint(solve())\n', 'import sys\n\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninm = lambda: map(int, sys.stdin.readline().split())\ninl = lambda: list(inm())\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print("\\033[33m", *a, "\\033[0m", **dict(file=sys.stderr, **kw))\n\nN = ini()\nS = ins()\n\n\ndef flip(x):\n if x == "S":\n return "W"\n else:\n return "S"\n\n\ndef solve():\n for p in ["SS", "SW", "WS", "WW"]:\n buf = list(p)\n for i in range(1, N):\n if (buf[i] == "S" and S[i] == "o") or (buf[i] == "W" and S[i] == "x"):\n buf.append(buf[i - 1])\n else:\n buf.append(flip(buf[i - 1]))\n assert len(buf) == N + 1\n if buf[0] != buf[-1]:\n continue\n buf.pop()\n if buf[1] == buf[-1]:\n if (buf[0] == "S" and S[0] == "x") or (buf[0] == "W" and S[0] == "o"):\n continue\n else:\n if (buf[0] == "S" and S[0] == "o") or (buf[0] == "W" and S[0] == "x"):\n continue\n return "".join(buf)\n return -1\n\n\nprint(solve())\n'] | ['Wrong Answer', 'Accepted'] | ['s593969830', 's446607884'] | [9940.0, 10192.0] | [89.0, 122.0] | [1104, 1108] |
p03800 | u375616706 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\nN = int(input())\ns = input()[:-1]\nans = [1]*(N+2)\n\n\ndef print_ans(l: list):\n ret = ""\n for a in l[1:-1]:\n ret += "S" if a else "W"\n print(ret)\n\n\ndef next(ind: int, isSame: bool, isSheep: bool)->bool:\n # if isSame:\n # if isSheep:\n # return ans[ind-1]\n # else:\n # return not ans[ind-1]\n # else:\n # if isSheep:\n # return not ans[ind-1]\n # else:\n # return ans[ind-1]\n\n return (isSame == isSheep) ^ ans[ind-1]\n\n\ndef check(first: bool, last: bool)->list:\n ans[0] = last\n ans[1] = first\n for i in range(1, N+1):\n ans[i+1] = next(i, s[i-1] == "o", ans[i])\n\n return ans[0] == ans[N] and ans[1] == ans[N+1]\n\n\nfor first in [True, False]:\n for last in [True, False]:\n if check(first, last):\n print_ans(ans)\n exit()\nprint("-1")\n', '# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\nN = int(input())\ns = input()[:-1]\nans = [False]*(N+1)\n\n\ndef print_ans(l: list):\n \n ret = ""\n for a in l[1:]:\n ret += "S" if a else "W"\n print(ret)\n\n\ndef next(ind: int, isSame: bool, isSheep: bool)->bool:\n \n if isSame:\n if isSheep:\n return ans[ind-1]\n else:\n return not ans[ind-1]\n else:\n if isSheep:\n return not ans[ind-1]\n else:\n return ans[ind-1]\n\n\ndef check(start: bool, last: bool)->list:\n \n ans[0] = last\n ans[1] = start\n for i in range(1, N):\n ans[i+1] = next(i, s[i] == "o", ans[i])\n\n return ans[N] == ans[0]\n\n\nfor start in [True, False]:\n for last in [True, False]:\n if check(start, last):\n print_ans(ans)\n exit()\nprint("-1")\n', '# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\nN = int(input())\ns = input()[:-1]\nans = [1]*(N+2)\n\n\ndef print_ans(l: list):\n ret = ""\n for a in l[1:-1]:\n ret += "S" if a else "W"\n print(ret)\n\n\ndef next(ind: int, isSame: bool, isSheep: bool)->bool:\n # if isSame:\n # if isSheep:\n # return ans[ind-1]\n # else:\n # return not ans[ind-1]\n # else:\n # if isSheep:\n # return not ans[ind-1]\n # else:\n # return ans[ind-1]\n\n return not(isSame ^ isSheep) ^ ans[ind-1]\n\n\ndef check(first: bool, last: bool)->list:\n ans[0] = last\n ans[1] = first\n for i in range(1, N+1):\n ans[i+1] = next(i, s[i-1] == "o", ans[i])\n\n return ans[0] == ans[N] and ans[1] == ans[N+1]\n\n\nfor first in [True, False]:\n for last in [True, False]:\n if check(first, last):\n print_ans(ans)\n exit()\nprint("-1")\n', '# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\nN = int(input())\ns = input()[:-1]\nans = [1]*(N+2)\n\n\ndef print_ans(l: list):\n ret = ""\n for a in l[1:-1]:\n ret += "S" if a else "W"\n print(ret)\n\n\ndef next(ind: int, isSame: bool, isSheep: bool)->bool:\n # if isSame:\n # if isSheep:\n # return ans[ind-1]\n # else:\n # return not ans[ind-1]\n # else:\n # if isSheep:\n # return not ans[ind-1]\n # else:\n # return ans[ind-1]\n\n return isSame == isSheep ^ ans[ind-1]\n\n\ndef check(first: bool, last: bool)->list:\n ans[0] = last\n ans[1] = first\n for i in range(1, N+1):\n ans[i+1] = next(i, s[i-1] == "o", ans[i])\n\n return ans[0] == ans[N] and ans[1] == ans[N+1]\n\n\nfor first in [True, False]:\n for last in [True, False]:\n if check(first, last):\n print_ans(ans)\n exit()\nprint("-1")\n', '# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\nN = int(input())\ns = input()[:-1]\nans = [1]*(N+2)\n\n\ndef print_ans(l: list):\n ret = ""\n for a in l[1:-1]:\n ret += "S" if a else "W"\n print(ret)\n\n\ndef next(ind: int, isSame: bool, isSheep: bool)->bool:\n return isSame ^ isSheep ^ ans[ind-1]\n\n\ndef check(first: bool, last: bool)->list:\n ans[0] = last\n ans[1] = first\n for i in range(1, N+1):\n ans[i+1] = next(i, s[i-1] == "o", ans[i])\n\n return ans[0] == ans[N] and ans[1] == ans[N+1]\n\n\nfor first in [True, False]:\n for last in [True, False]:\n if check(first, last):\n print_ans(ans)\n exit()\nprint("-1")\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s191953489', 's355042289', 's389645912', 's537926153', 's784630857'] | [4852.0, 4852.0, 4852.0, 4852.0, 4852.0] | [176.0, 90.0, 164.0, 160.0, 176.0] | [962, 1263, 964, 960, 717] |
p03800 | u388927326 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['#!/usr/bin/env python3\n\ndef main():\n n = int(input())\n s = input()\n for d0 in ["S", "W"]:\n for d1 in ["S", "W"]:\n pat = wrap(n, s, d0, d1)\n if pat[0] == pat[n] and pat[1] == pat[n + 1]:\n res = "".join(pat[:n])\n print(res)\n return\n print("-1")\n\ndef wrap(n, s, d0, d1):\n ds = [d0, d1]\n for i in range(2, n + 2):\n d = get_dnext(ds[i - 2], ds[i - 1], s[i - 1])\n ds.append(d)\n assert len(ds) == n + 2\n return ds\n\ndef get_dnext(dpre, di, si):\n if di == "S" and si == "o":\n dnext = dpre\n elif di == "S" and si == "x":\n dnext = inv(dpre)\n elif di == "W" and si == "o":\n dnext = inv(dpre)\n elif di == "W" and si == "x":\n dnext = dpre\n else:\n raise Exception\n return dnext\n\ndef inv(d):\n return "W" if d == "S" else "S"\n\nmain()\n', '#!/usr/bin/env python3\n\ndef main():\n n = int(input())\n s = input()\n s = list(s)\n s.append(s[0])\n for d0 in ["S", "W"]:\n for d1 in ["S", "W"]:\n pat = wrap(n, s, d0, d1)\n if pat[0] == pat[n] and pat[1] == pat[n + 1]:\n res = "".join(pat[:n])\n print(res)\n return\n print("-1")\n\ndef wrap(n, s, d0, d1):\n ds = [d0, d1]\n for i in range(2, n + 2):\n d = get_dnext(ds[i - 2], ds[i - 1], s[i - 1])\n ds.append(d)\n assert len(ds) == n + 2\n return ds\n\ndef get_dnext(dpre, di, si):\n if di == "S" and si == "o":\n dnext = dpre\n elif di == "S" and si == "x":\n dnext = inv(dpre)\n elif di == "W" and si == "o":\n dnext = inv(dpre)\n elif di == "W" and si == "x":\n dnext = dpre\n else:\n raise Exception\n return dnext\n\ndef inv(d):\n return "W" if d == "S" else "S"\n\nmain()\n'] | ['Runtime Error', 'Accepted'] | ['s201384356', 's760660980'] | [4108.0, 5640.0] | [71.0, 205.0] | [885, 920] |
p03800 | u437638594 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['N = int(input())\ns = input()\n\nans = -1\n\ncandidate = [["S", "S"], ["S", "W"], ["W", "S"], ["W", "W"]]\n\nfor items in candidate:\n SW = [""] * N\n SW[0] = items[0]\n SW[1] = items[1]\n \n for i in range(1, N-1):\n if s[i] == "o":\n if SW[i] == "S":\n if SW[i-1] == "S":\n SW[i+1] = "S"\n else:\n SW[i+1] = "W"\n if SW[i] == "W":\n if SW[i-1] == "S":\n SW[i+1] = "W"\n else:\n SW[i+1] = "S"\n if s[i] == "x":\n if SW[i] == "S":\n if SW[i-1] == "S":\n SW[i+1] = "W"\n else:\n SW[i+1] = "S"\n if SW[i] == "W":\n if SW[i-1] == "S":\n SW[i+1] = "S"\n else:\n SW[i+1] = "W"\n \n for i in range(-1, 0):\n if s[i] == "o":\n if SW[i] == "S":\n if SW[i-1] == "S":\n tmp = "S"\n else:\n tmp = "W"\n if SW[i] == "W":\n if SW[i-1] == "S":\n tmp = "W"\n else:\n tmp = "S"\n if s[i] == "x":\n if SW[i] == "S":\n if SW[i-1] == "S":\n tmp = "W"\n else:\n tmp = "S"\n if SW[i] == "W":\n if SW[i-1] == "S":\n tmp = "S"\n else:\n tmp = "W" \n if tmp != SW[i]:\n break\n \n ans = "".join(SW)\n \nprint(ans)\n', 'N = int(input())\ns = input()\n\nans = -1\n\ncandidate = [["S", "S"], ["S", "W"], ["W", "S"], ["W", "W"]]\n\nfor items in candidate:\n SW = [""] * N\n SW[0] = items[0]\n SW[1] = items[1]\n \n for i in range(1, N-1):\n if s[i] == "o":\n if SW[i] == "S":\n if SW[i-1] == "S":\n SW[i+1] = "S"\n else:\n SW[i+1] = "W"\n if SW[i] == "W":\n if SW[i-1] == "S":\n SW[i+1] = "W"\n else:\n SW[i+1] = "S"\n if s[i] == "x":\n if SW[i] == "S":\n if SW[i-1] == "S":\n SW[i+1] = "W"\n else:\n SW[i+1] = "S"\n if SW[i] == "W":\n if SW[i-1] == "S":\n SW[i+1] = "S"\n else:\n SW[i+1] = "W"\n \n \n for i in range(-1, 0):\n if s[i] == "o":\n if SW[i] == "S":\n if SW[i-1] == "S":\n SW[i+1] = "S"\n else:\n SW[i+1] = "W"\n if SW[i] == "W":\n if SW[i-1] == "S":\n SW[i+1] = "W"\n else:\n SW[i+1] = "S"\n if s[i] == "x":\n if SW[i] == "S":\n if SW[i-1] == "S":\n SW[i+1] = "W"\n else:\n SW[i+1] = "S"\n if SW[i] == "W":\n if SW[i-1] == "S":\n SW[i+1] = "S"\n else:\n SW[i+1] = "W"\n \n if SW[0] == items[0] and SW[1] == items[1]:\n ans = "".join(SW)\n \nprint(ans)\n', 'N = int(input())\ns = input()\n\nans = -1\n\ncandidate = [["S", "S"], ["S", "W"], ["W", "S"], ["W", "W"]]\n\nfor items in candidate:\n SW = [""] * N\n SW[0] = items[0]\n SW[1] = items[1]\n \n for i in range(1, N-1):\n if s[i] == "o":\n if SW[i] == "S":\n if SW[i-1] == "S":\n SW[i+1] = "S"\n else:\n SW[i+1] = "W"\n if SW[i] == "W":\n if SW[i-1] == "S":\n SW[i+1] = "W"\n else:\n SW[i+1] = "S"\n if s[i] == "x":\n if SW[i] == "S":\n if SW[i-1] == "S":\n SW[i+1] = "W"\n else:\n SW[i+1] = "S"\n if SW[i] == "W":\n if SW[i-1] == "S":\n SW[i+1] = "S"\n else:\n SW[i+1] = "W"\n \n flag = True\n \n for i in range(-1, 0):\n if s[i] == "o":\n if SW[i] == "S":\n if SW[i-1] == "S":\n tmp = "S"\n else:\n tmp = "W"\n if SW[i] == "W":\n if SW[i-1] == "S":\n tmp = "W"\n else:\n tmp = "S"\n if s[i] == "x":\n if SW[i] == "S":\n if SW[i-1] == "S":\n tmp = "W"\n else:\n tmp = "S"\n if SW[i] == "W":\n if SW[i-1] == "S":\n tmp = "S"\n else:\n tmp = "W" \n if tmp != SW[i]:\n flag = False\n \n if flag:\n ans = "".join(SW)\n \nprint(ans)\n', 'n = int(input())\ns = input()\nans = ""\ndef next_animal(pre,now,letter):\n if pre == "S" and now == "S" and letter == "o":\n return "S"\n if pre == "S" and now == "S" and letter == "x":\n return "W"\n if pre == "S" and now == "W" and letter == "o":\n return "W"\n if pre == "S" and now == "W" and letter == "x":\n return "S"\n if pre == "W" and now == "S" and letter == "o":\n return "W"\n if pre == "W" and now == "S" and letter == "x":\n return "S"\n if pre == "W" and now == "W" and letter == "o":\n return "S"\n if pre == "W" and now == "W" and letter == "x":\n return "W"\n\nfor case in range(4):\n if case == 0:\n ans = "SS"\n if case == 1:\n ans = "SW"\n if case == 2:\n ans = "WS"\n if case == 3:\n ans = "WW"\n for i in range(1,n-1):\n next = next_animal(ans[-1],ans[-2],s[i])\n ans += next\n if ans[-1] == next_animal(ans[1],ans[0],s[0]) and ans[0] == next_animal(ans[-2],ans[-1],s[-1]):\n print(ans)\n exit()\n\nprint(-1)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s036633812', 's125362806', 's156547233', 's409883538'] | [5204.0, 5076.0, 5204.0, 3444.0] | [250.0, 258.0, 247.0, 266.0] | [1271, 1333, 1299, 1051] |
p03800 | u475503988 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ["N = int(input())\ns = input()\ns += s[0]\n\ndef isOK(x, y):\n lst = [-1] * (N+2)\n lst[0] = x\n lst[1] = y\n for i in range(1, N+1):\n if (s[i] == 'o') ^ (lst[i]): \n lst[i+1] = 1 - lst[i-1]\n else: \n lst[i+1] = lst[i-1]\n if lst[0] == lst[-2] and lst[1] == lst[-1]: \n return lst[:-2]\n else:\n return []\n\nfor x in range(2):\n for y in range(2):\n lst = isOK(x, y)\n if len(lst) > 0:\n break\n\nif len(lst) == 0:\n ans = -1\nelse:\n ans = ''\n for x in lst:\n if x:\n ans += 'S'\n else:\n ans += 'W'\nprint(ans)\n", "from itertools import product\nN = int(input())\ns = input()\ns += s[0]\n\ndef isOK(x, y):\n lst = [-1] * (N+2)\n lst[0] = x\n lst[1] = y\n for i in range(1, N+1):\n if (s[i] == 'o') ^ (lst[i]): \n lst[i+1] = 1 - lst[i-1]\n else: \n lst[i+1] = lst[i-1]\n if lst[0] == lst[-2] and lst[1] == lst[-1]: \n return lst[:-2]\n else:\n return []\n\nfor x, y in product([1,0], repeat=2):\n chk = isOK(x, y)\n if len(chk) > 0:\n break\n\nif len(chk) == 0:\n ans = -1\nelse:\n ans = ''\n for x in chk:\n if x:\n ans += 'S'\n else:\n ans += 'W'\nprint(ans)\n"] | ['Wrong Answer', 'Accepted'] | ['s306585800', 's871955273'] | [4852.0, 4836.0] | [122.0, 147.0] | [708, 722] |
p03800 | u518042385 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['n=int(input())\nw1=list(input())\ns="S"\nw="W"\no="o"\nx="x"\nl=[[s,s],[s,w],[w,w],[w,s]]\nfor j in range(4):\n for i in range(1,n):\n if w1[i]==o:\n if l[j][-1]==s:\n if l[j][-2]==s:\n l[j].append(s)\n else:\n l[j].append(w)\n else:\n if l[j][-2]==s:\n l[j].append(w)\n else:\n l[j].append(s)\n else:\n if l[j][-1]==s:\n if l[j][-2]==s:\n l[j].append(w)\n else:\n l[j].append(s)\n else:\n if l[j][-2]==s:\n l[j].append(s)\n else:\n l[j].append(w)\nb=False\nfor i in range(4):\n if l[i][0]==l[i][-1] and not b:\n del l[i][-1]\n if (l[i][1]==l[i][-1] and w[0]==o) or (l[i][1]!=l[i][-1] and w[0]==x):\n answer=l[i]\n b=True\n break\nif not b:\n print(-1)\nelse:\n print("".join(answer))', 'print(-1)', 'n=int(input())\nw1=list(input())\ns="S"\nw="W"\no="o"\nx="x"\nl=[[s,s],[s,w],[w,w],[w,s]]\nfor j in range(4):\n for i in range(1,n):\n if w1[i]==o:\n if l[j][-1]==s:\n if l[j][-2]==s:\n l[j].append(s)\n else:\n l[j].append(w)\n else:\n if l[j][-2]==s:\n l[j].append(w)\n else:\n l[j].append(s)\n else:\n if l[j][-1]==s:\n if l[j][-2]==s:\n l[j].append(w)\n else:\n l[j].append(s)\n else:\n if l[j][-2]==s:\n l[j].append(s)\n else:\n l[j].append(w)\nb=False\nfor i in range(4):\n if l[i][0]==l[i][-1] and not b:\n del l[i][-1]\n if l[i][0]==s:\n if (l[i][1]==l[i][-1] and w1[0]==o) or (l[i][1]!=l[i][-1] and w1[0]==x):\n answer=l[i]\n b=True\n break\n else:\n if (l[i][1]!=l[i][-1] and w1[0]==o) or (l[i][1]==l[i][-1] and w1[0]==x):\n answer=l[i]\n b=True\n break\nif not b:\n print(-1)\nelse:\n print("".join(answer))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s432458101', 's775118322', 's911487087'] | [7196.0, 2940.0, 7376.0] | [198.0, 17.0, 193.0] | [1003, 9, 1170] |
p03800 | u520276780 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['import sys\nn = int(input())\ns = input()\n\nL = ["SS","SW","WS","WW"]\nl= len(s)\n\n\nfor t in L: \n for i in range(1,l+1):\n if (s[(i+l)%l]=="x") ^ (t[-1] == "W"):\n if t[-2]=="S":\n t+= "W"\n else:\n t += "S"\n \n else:\n t += t[-2]\n if t[0:2]==t[-2:]:\n print(t)\n sys.exit()\nprint(-1)\n \n', 'import sys\nn = int(input())\ns = input()\n\nL = ["SS","SW","WS","WW"]\nl= len(s)\n\n\n\nfor t in L:\n \u3000tmp = t###\n for i in range(l):\n if (s[i]=="x") ^ (tmp[-1] == "W"):\n if tmp[-2]=="S":\n tmp+= "W"\n else:\n tmp += "S"\n \n else:\n tmp += tmp[-2]\n if tmp[:2]==tmp[-2:]:\n print(tmp)\n sys.exit()\nprint(-1)\n \n', 'import sys\nn = int(input())\ns = input()\n\nL = ["SS","SW","WS","WW"]\nl= len(s)\n\n\n\nfor t in L: \n for i in range(l):\n if (s[i]=="x") ^ (t[-1] == "W"):\n if t[-2]=="S":\n t+= "W"\n else:\n t += "S"\n \n else:\n t += t[-2]\n if t[:2]==t[-2:]:\n print(t)\n sys.exit()\nprint(-1)\n \n', 'import sys\nn = int(input())\ns = input()\n\nL = ["SS","SW","WS","WW"]\nl= len(s)\n\nfor t in L: \n for i in range(1,l+1):\n if (s[(i+l)%l]=="x") ^ (t[-1] == "W"):\n t += t[-2]\n else:\n if t[-2]=="S":\n t+= "W"\n else:\n t += "S"\n if t[0:2]==t[-2:]:\n print(t)\n sys.exit()\nprint(-1)\n \n', '\nimport sys\nn = int(input())\ns = input()\n\nL = ["SS","SW","WS","WW"]\nl= len(s)\n\n\n\nfor t in L:\n tmp = t###\n for i in range(l):\n if (s[i]=="x") ^ (tmp[-1] == "W"):\n if tmp[-2]=="S":\n tmp+= "W"\n else:\n tmp += "S"\n \n else:\n tmp += tmp[-2]\n if tmp[:2]==tmp[-2:]:\n print(tmp[1:-1])###\n sys.exit()\nprint(-1)\n \n'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s436237655', 's529909752', 's703511760', 's949936476', 's983628467'] | [3444.0, 2940.0, 3444.0, 3444.0, 3444.0] | [212.0, 17.0, 179.0, 197.0, 213.0] | [446, 532, 500, 371, 573] |
p03800 | u545368057 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['n = int(input())\ns = input()\n# S -> 0, W -> 1\nds = [(0,0),(0,1),(1,0),(1,1)]\n\nfor d0,d1 in ds:\n a = [d0,d1]\n for i in range(1,n-1):\n if s[i] == "o" and a[i] == 0:\n a.append(a[i-1])\n elif s[i] == "x" and a[i] == 0:\n a.append(a[i-1]^1)\n elif s[i] == "o" and a[i] == 1:\n a.append(a[i-1]^1)\n else:\n a.append(a[i-1])\n \n X = ["S","W"]\n print(a)\n if a[n-1] == 0 and s[n-1] == "x":\n if a[0] != a[n-2]:\n a = "".join([X[i] for i in a])\n print(a)\n exit()\n if a[n-1] == 0 and s[n-1] == "o":\n if a[0] == a[n-2]:\n a = "".join([X[i] for i in a])\n print(a)\n exit()\n if a[n-1] == 1 and s[n-1] == "x":\n if a[0] == a[n-2]:\n a = "".join([X[i] for i in a])\n print(a)\n exit()\n if a[n-1] == 1 and s[n-1] == "o":\n if a[0] != a[n-2]:\n a = "".join([X[i] for i in a])\n print(a)\n exit()\nprint(-1)', '\nn = int(input())\ns = input()\n# S -> 0, W -> 1\nds = [(0,0),(0,1),(1,0),(1,1)]\n\nfor d0,d1 in ds:\n a = [d0,d1]\n for i in range(1,n):\n if s[i] == "o" and a[i] == 0:\n a.append(a[i-1])\n elif s[i] == "x" and a[i] == 0:\n a.append(a[i-1]^1)\n elif s[i] == "o" and a[i] == 1:\n a.append(a[i-1]^1)\n else:\n a.append(a[i-1])\n \n X = ["S","W"]\n # print(a)\n if a[0] != a[-1]:continue\n a = a[:-1]\n if a[0] == 0 and s[0] == "x":\n if a[1] != a[-1]:\n a = "".join([X[i] for i in a])\n print(a)\n exit()\n if a[0] == 0 and s[0] == "o":\n if a[1] == a[-1]:\n a = "".join([X[i] for i in a])\n print(a)\n exit()\n if a[0] == 1 and s[0] == "x":\n if a[1] == a[-1]:\n a = "".join([X[i] for i in a])\n print(a)\n exit()\n if a[-0] == 1 and s[0] == "o":\n if a[1] != a[-1]:\n a = "".join([X[i] for i in a])\n print(a)\n exit()\nprint(-1)'] | ['Wrong Answer', 'Accepted'] | ['s927154575', 's041537630'] | [5652.0, 4948.0] | [133.0, 201.0] | [1065, 1347] |
p03800 | u600402037 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ["import sys\n\nstdin = sys.stdin\n \nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip() # ignore trailing spaces\n\nN = ri()\nS = rs()\nd = {'S': 'W', 'W': 'S'}\nfor x in ['SS', 'SW', 'WS', 'WW']:\n animals = x\n for i in range(N):\n if S[i] == 'o':\n if animals[i+1] == 'S':\n animals += animals[i]\n else:\n animals += d[animals[i]]\n else:\n if animals[i+1] == 'S':\n animals += d[animals[i]]\n else:\n animals += animals[i]\n if animals[0] == animals[-1]:\n print(animals[1:])\n exit()\n\nprint(-1)\n\n#08\n", "import sys\n\nstdin = sys.stdin\n \nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip() # ignore trailing spaces\n\nN = ri()\nS = rs()\nd = {'S': 'W', 'W': 'S'}\nfor x in ['SS', 'SW', 'WS', 'WW']:\n animals = x\n for i in range(N):\n if S[i] == 'o':\n if animals[i+1] == 'S':\n animals += animals[i]\n else:\n animals += d[animals[i]]\n else:\n if animals[i+1] == 'S':\n animals += d[animals[i]]\n else:\n animals += animals[i]\n if animals[0:2] == animals[-2:]:\n print(animals[1:-1])\n exit()\n\nprint(-1)\n\n#08\n"] | ['Wrong Answer', 'Accepted'] | ['s508693992', 's631421119'] | [3572.0, 3572.0] | [108.0, 195.0] | [688, 693] |
p03800 | u674959776 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['n=int(input())\ns=input()\n\ndef sheep(a,b):\n l=[0]*(n+1)\n l[0]=a\n l[1]=b\n for i in range(1,n):\n if s[i]=="o":\n if l[i]==0:\n l[i+1]=l[i-1]\n else:\n l[i+1]=(l[i-1]+1)%2\n else:\n if l[i]==0:\n l[i+1]=(l[i-1]+1)%2\n else:\n l[i+1]=l[i-1]\n if l[n]==l[0]:\n for i in range(n):\n if l[i]==0:\n print("S")\n else:\n print("W")\n exit()\n\n\nsheep(0,0)\nsheep(0,1)\nsheep(1,0)\nsheep(1,1)\nprint("-1")', 'n=int(input())\ns=input()\n\ndef sheep(a,b):\n l=[0]*(n+1)\n l[0]=a\n l[1]=b\n m=[]\n for i in range(1,n):\n if s[i]=="o":\n if l[i]==0:\n l[i+1]=l[i-1]\n else:\n l[i+1]=(l[i-1]+1)%2\n else:\n if l[i]==0:\n l[i+1]=(l[i-1]+1)%2\n else:\n l[i+1]=l[i-1]\n x=0\n if s[0]=="o":\n if l[0]==0:\n x=l[1]\n else:\n x=(l[1]+1)%2\n else:\n if l[0]==0:\n x=(l[1]+1)%2\n else:\n x=l[1]\n if l[n]==l[0] and x==l[n-1]:\n for i in range(n):\n if l[i]==0:\n m.append("S")\n else:\n m.append("W")\n print("".join(m))\n exit()\n\nsheep(0,0)\nsheep(0,1)\nsheep(1,0)\nsheep(1,1)\nprint("-1")'] | ['Wrong Answer', 'Accepted'] | ['s842808743', 's576760086'] | [10128.0, 10880.0] | [94.0, 113.0] | [571, 817] |
p03800 | u706159977 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['Menagerien = int(input())\ns = input()\na = "SS"\nct=1\nwhile ct<7: \n for i in range(n-1):\n p=a[i]\n q="A"\n if a[i]=="S":\n q="W"\n else:\n q="S"\n if a[i+1]=="S":\n if s[i+1] == "o":\n a=a+a[i]\n else:\n a=a+q\n else:\n if s[i+1] == "o":\n a=a+q\n else:\n a=a+a[i]\n if a[0]==a[n]:\n if a[0]=="S" and s[0]=="o" and a[n-1]==a[1]:\n print(a[0:n])\n break\n elif a[0]=="S" and s[0] !="o" and a[n-1]!=a[1]: \n print(a[0:n])\n break\n elif a[0]=="W" and s[0] =="o" and a[n-1]!=a[1]: \n print(a[0:n])\n break\n elif a[0]=="W" and s[0] !="o" and a[n-1]==a[1]: \n print(a[0:n])\n break\n else:\n ct=ct+1\n if ct==2:\n a="SW"\n elif ct==3:\n a="WS"\n elif ct==4:\n a="WW"\n else:\n print(-1)\n break\n else:\n ct=ct+1\n if ct==2:\n a="SW"\n elif ct==3:\n a="WS"\n elif ct==4:\n a="WW"\n else:\n print(-1)\n break', 'n = int(input())\ns = input()\na = "SS"\nct=1\nwhile ct<7: \n for i in range(n-1):\n p=a[i]\n q="A"\n if a[i]=="S":\n q="W"\n else:\n q="S"\n if a[i+1]=="S":\n if s[i+1] == "o":\n a=a+a[i]\n else:\n a=a+q\n else:\n if s[i+1] == "o":\n a=a+q\n else:\n a=a+a[i]\n if a[0]==a[n]:\n if a[0]=="S" and s[0]=="o" and a[n-1]==a[1]:\n print(a[0:n])\n break\n elif a[0]=="S" and s[0] !="o" and a[n-1]!=a[1]: \n print(a[0:n])\n break\n elif a[0]=="W" and s[0] =="o" and a[n-1]!=a[1]: \n print(a[0:n])\n break\n elif a[0]=="W" and s[0] !="o" and a[n-1]==a[1]: \n print(a[0:n])\n break\n else:\n ct=ct+1\n if ct==2:\n a="SW"\n elif ct==3:\n a="WS"\n elif ct==4:\n a="WW"\n else:\n print(-1)\n break\n else:\n ct=ct+1\n if ct==2:\n a="SW"\n elif ct==3:\n a="WS"\n elif ct==4:\n a="WW"\n else:\n print(-1)\n break'] | ['Runtime Error', 'Accepted'] | ['s960272077', 's438136918'] | [3444.0, 3700.0] | [17.0, 264.0] | [1247, 1274] |
p03800 | u742897895 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['n = int(input())\ns = input()\n\nans = ["SS", "SW", "WS", "WW"]\n\nfor i in range(4):\n for j in range(1, n + 1):\n if s[j - 1] == "o":\n if ans[i][j] == "S":\n if ans[i][j - 1] == "S":\n ans[i] += "S"\n else:\n ans[i] += "W"\n else:\n if ans[i][j - 1] == "S":\n ans[i] += "W"\n else:\n ans[i] += "S"\n else:\n if ans[i][j] == "S":\n if ans[i][j - 1] == "S":\n ans[i] += "W"\n else:\n ans[i] += "S"\n else:\n if ans[i][j - 1] == "S":\n ans[i] += "S"\n else:\n ans[i] += "W"\n print(ans)\n\n if ans[i][0] == ans[i][n] and ans[i][1] == ans[i][n + 1]:\n flag = True\n else:\n flag = False\n\n if flag:\n idx = i\n break\n\nif flag:\n print(ans[idx][1:n + 1])\nelse:\n print(-1)\n', 'n = int(input())\ns = input()\n\nans = ["SS", "SW", "WS", "WW"]\n\nfor i in range(4):\n for j in range(1, n + 1):\n if s[j - 1] == "o":\n if ans[i][j] == "S":\n if ans[i][j - 1] == "S":\n ans[i] += "S"\n else:\n ans[i] += "W"\n else:\n if ans[i][j - 1] == "S":\n ans[i] += "W"\n else:\n ans[i] += "S"\n else:\n if ans[i][j] == "S":\n if ans[i][j - 1] == "S":\n ans[i] += "W"\n else:\n ans[i] += "S"\n else:\n if ans[i][j - 1] == "S":\n ans[i] += "S"\n else:\n ans[i] += "W"\n\n if ans[i][0] == ans[i][n] and ans[i][1] == ans[i][n + 1]:\n flag = True\n else:\n flag = False\n\n if flag:\n idx = i\n break\n\nif flag:\n print(ans[idx][1:n + 1])\nelse:\n print(-1)\n'] | ['Wrong Answer', 'Accepted'] | ['s589854276', 's554234190'] | [5464.0, 3800.0] | [1252.0, 1202.0] | [1011, 996] |
p03800 | u761529120 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['def main():\n N = int(input())\n s = list(input())\n for t0,t1 in [(\'S\',\'S\'),(\'S\',\'W\'),(\'W\',\'S\'),(\'W\',\'W\')]:\n T = [\'S\'] * (N + 1)\n\n T[0] = t0\n T[1] = t1\n\n for i in range(1,N):\n if s[i] == \'o\':\n if T[i] == \'S\':\n T[i+1] = T[i-1]\n else:\n if T[i-1] == \'W\':\n T[i+1] = \'S\'\n else:\n T[i+1] = \'W\'\n else:\n if T[i] == \'W\':\n T[i+1] = T[i-1]\n else:\n if T[i-1] == \'W\':\n T[i+1] = \'S\'\n else:\n T[i+1] = \'W\'\n\n if T[-1] == T[0]:\n if T[0] == \'S\':\n if s[0] == \'o\' and T[-2] == T[1]:\n T.pop(-1)\n print(\'\'.join(T))\n elif s[0] == \'x\' and T[-2] != T[1]:\n T.pop(-1)\n print(\'\'.join(T))\n else:\n if s[0] == \'x\' and T[-2] == T[1]:\n T.pop(-1)\n print(\'\'.join(T))\n elif s[0] == \'o\' and T[-2] != T[1]:\n T.pop(-1)\n print(\'\'.join(T))\n\n\n print(-1)\n\n\n\nif __name__ == "__main__":\n main()', 'def main():\n N = int(input())\n s = list(input())\n for t0,t1 in [(\'S\',\'S\'),(\'S\',\'W\'),(\'W\',\'S\'),(\'W\',\'W\')]:\n T = [\'S\'] * (N + 1)\n\n T[0] = t0\n T[1] = t1\n\n for i in range(1,N):\n if s[i] == \'o\':\n if T[i] == \'S\':\n T[i+1] = T[i-1]\n else:\n if T[i-1] == \'W\':\n T[i+1] = \'S\'\n else:\n T[i+1] = \'W\'\n else:\n if T[i] == \'W\':\n T[i+1] = T[i-1]\n else:\n if T[i-1] == \'W\':\n T[i+1] = \'S\'\n else:\n T[i+1] = \'W\'\n\n if T[-1] == T[0]:\n if T[0] == \'S\':\n if s[0] == \'o\' and T[-2] == T[1]:\n T.pop(-1)\n print(\'\'.join(T))\n exit()\n elif s[0] == \'x\' and T[-2] != T[1]:\n T.pop(-1)\n print(\'\'.join(T))\n exit()\n else:\n if s[0] == \'x\' and T[-2] == T[1]:\n T.pop(-1)\n print(\'\'.join(T))\n exit()\n elif s[0] == \'o\' and T[-2] != T[1]:\n T.pop(-1)\n print(\'\'.join(T))\n exit()\n\n\n print(-1)\n\n\n\nif __name__ == "__main__":\n main()'] | ['Wrong Answer', 'Accepted'] | ['s025698770', 's961599666'] | [11396.0, 11300.0] | [97.0, 101.0] | [1317, 1425] |
p03800 | u843135954 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ["import sys\nstdin = sys.stdin\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nnn = lambda: list(stdin.readline().split())\nns = lambda: stdin.readline().rstrip()\n\nn = ni()\ns = ns()\na = [['S','S'],['S','W'],['W','S'],['W','W']]\n\nfor b in a:\n for i in range(1,n):\n c = 0 if b[i] == 'S' else 1\n d = 0 if s[i] == 'o' else 1\n e = b[i-1] if not c^d else 'W' if b[i-1] == 'S' else 'S'\n b.append(e)\n c = 0 if b[-1] == 'S' else 1\n d = 0 if s[-1] == 'o' else 1\n e = 0 if b[-2] == b[1] else 1\n if b[0] == b[-1] and c^d == e:\n print(''.join(b[:-1]))\n exit()\n\nprint(-1)", "import sys\nstdin = sys.stdin\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nnn = lambda: list(stdin.readline().split())\nns = lambda: stdin.readline().rstrip()\n\nn = ni()\ns = ns()\na = [['S','S'],['S','W'],['W','S'],['W','W']]\n\nfor b in a:\n for i in range(1,n):\n c = 0 if b[i] == 'S' else 1\n d = 0 if s[i] == 'o' else 1\n e = b[i-1] if not c^d else 'W' if b[i-1] == 'S' else 'S'\n b.append(e)\n c = 0 if b[0] == 'S' else 1\n d = 0 if s[0] == 'o' else 1\n e = 0 if b[-2] == b[1] else 1\n if b[0] == b[-1] and c^d == e:\n print(''.join(b[:-1]))\n exit()\n\nprint(-1)"] | ['Wrong Answer', 'Accepted'] | ['s745519832', 's552740480'] | [7160.0, 7184.0] | [249.0, 228.0] | [640, 638] |
p03800 | u879870653 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ['input()\nif input() == "ooxoox" :\n print("SWWSWS")\nelse :\n print("")', 'N = int(input())\nS = input()\n\n\nA = ["SS", "SW", "WS", "WW"]\n\nfor j in range(4) :\n t = A[j]\n for i in range(1,N) :\n if S[i] == "o" :\n if t[i] == "S" :\n if t[i-1] == "S" :\n t += "S"\n else :\n t += "W"\n else :\n if t[i-1] == "S" :\n t += "W"\n else :\n t += "S"\n else :\n if t[i] == "S" :\n if t[i-1] == "S" :\n t += "W"\n else :\n t += "S"\n else :\n if t[i-1] == "S" :\n t += "S"\n else :\n t += "W"\n \n if t[0] == t[-1] :\n if S[0] == "o" and t[0] == "S" and (t[-1] == t[1]) :\n print(t)\n break\n elif S[0] == "o" and (t[0] == "W") and (t[-1] != t[1]) :\n print(t)\n break\n if S[0] == "x" and t[0] == "S" and (t[-1] != t[1]) :\n print(t)\n break\n elif S[0] == "x" and (t[0] == "W") and (t[-1] == t[1]) :\n print(t)\n break\nelse :\n print(-1)\n', 'input()\nif input() == "ooxoox" :\n print("SWWWSW")\nelse :\n print("")', 'N = int(input())\nS = input()\n\n\nA = ["SS", "SW", "WS", "WW"]\n\nfor j in range(4) :\n t = A[j]\n for i in range(1,N) :\n if S[i] == "o" :\n if t[i] == "S" :\n if t[i-1] == "S" :\n t += "S"\n else :\n t += "W"\n else :\n if t[i-1] == "S" :\n t += "W"\n else :\n t += "S"\n else :\n if t[i] == "S" :\n if t[i-1] == "S" :\n t += "W"\n else :\n t += "S"\n else :\n if t[i-1] == "S" :\n t += "S"\n else :\n t += "W"\n \n if t[0] == t[-1] :\n if S[0] == "o" and t[0] == "S" and (t[-2] == t[1]) :\n print(t[:-1])\n break\n elif S[0] == "o" and (t[0] == "W") and (t[-2] != t[1]) :\n print(t[:-1])\n break\n if S[0] == "x" and t[0] == "S" and (t[-2] != t[1]) :\n print(t[:-1])\n break\n elif S[0] == "x" and (t[0] == "W") and (t[-2] == t[1]) :\n print(t[:-1])\n break\nelse :\n print(-1)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s468815812', 's712701372', 's843150018', 's364597817'] | [3188.0, 3572.0, 3188.0, 3700.0] | [17.0, 149.0, 18.0, 187.0] | [73, 1177, 73, 1197] |
p03800 | u952467214 | 2,000 | 262,144 | Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1. There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies. Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species. More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise. Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`. | ["import sys\nsys.setrecursionlimit(10 ** 7)\ninput = sys.stdin.readline\n\nn = int(input())\ns = input() \n\n\ndef dfs(now,ans):\n\n if now == n-1:\n if s[now] == 'o' and ans[now] == 'S':\n if ans[now-1] == ans[0]:\n return ans\n else: return '-1'\n elif s[now] == 'o' and ans[now] == 'W':\n if ans[now-1] != ans[0]:\n return ans\n else: return '-1'\n elif s[now] == 'x' and ans[now] == 'S':\n if ans[now-1] != ans[0]:\n return ans\n else: return '-1'\n elif s[now] == 'x' and ans[now] == 'W':\n if ans[now-1] == ans[0]:\n return ans\n else: return '-1'\n else:\n return '-1'\n\n if s[now] == 'o' and ans[now] == 'S':\n if ans[now-1] == 'S':\n ans[now+1]= 'S'\n return dfs(now+1,ans)\n else:\n ans[now+1]= 'W'\n return dfs(now+1,ans)\n elif s[now] == 'o' and ans[now] == 'W':\n if ans[now-1] == 'S':\n ans[now+1]= 'W'\n return dfs(now+1,ans)\n else:\n ans[now+1]= 'S'\n return dfs(now+1,ans)\n elif s[now] == 'x' and ans[now] == 'S':\n if ans[now-1] == 'S':\n ans[now+1]= 'W'\n return dfs(now+1,ans)\n else:\n ans[now+1]= 'S'\n return dfs(now+1,ans)\n elif s[now] == 'x' and ans[now] == 'W':\n if ans[now-1] == 'S':\n ans[now+1]= 'S'\n return dfs(now+1,ans)\n else:\n ans[now+1]= 'W'\n return dfs(now+1,ans)\n\nans = ['A']*n\nANS= ['a']*4\n\nif s[0]=='o':\n ans[:2]=['S','W']\n ans[-1]='W'\n ANS[0] = dfs(0,ans)[:]\n\n ans[:2]=['S','S']\n ans[-1]='S'\n ANS[1] = dfs(0,ans)[:]\n\n ans[:2]=['W','S']\n ans[-1]='W'\n ANS[2] = dfs(0,ans)[:]\n\n ans[:2]=['W','W']\n ans[-1]='S'\n ANS[3] = dfs(0,ans)[:]\n\nelse:\n ans[:2]=['S','S']\n ans[-1]='W'\n ANS[0] = dfs(0,ans)\n\n ans[:2]=['S','W']\n ans[-1]='S'\n ANS[1] = dfs(0,ans)\n\n ans[:2]=['W','S']\n ans[-1]='S'\n ANS[2] = dfs(0,ans)\n\n ans[:2]=['W','W']\n ans[-1]='W'\n ANS[3] = dfs(0,ans)\n\nfor i in range(4):\n if ANS[i] != '-1':\n print(*ANS[i],sep='')\n exit()\n\nprint(-1)\n", "import sys\nsys.setrecursionlimit(10 ** 7)\ninput = sys.stdin.readline\n\nn = int(input())\ns = input() \n\n\ndef dfs(now,ans):\n\n if now == n-1:\n if s[now] == 'o' and ans[now] == 'S':\n if ans[now-1] == ans[0]:\n return ans\n else: return '-1'\n elif s[now] == 'o' and ans[now] == 'W':\n if ans[now-1] != ans[0]:\n return ans\n else: return '-1'\n elif s[now] == 'x' and ans[now] == 'S':\n if ans[now-1] != ans[0]:\n return ans\n else: return '-1'\n elif s[now] == 'x' and ans[now] == 'W':\n if ans[now-1] == ans[0]:\n return ans\n else: return '-1'\n else:\n return '-1'\n\n if s[now] == 'o' and ans[now] == 'S':\n if ans[now-1] == 'S':\n ans[now+1]= 'S'\n return dfs(now+1,ans)\n else:\n ans[now+1]= 'W'\n return dfs(now+1,ans)\n elif s[now] == 'o' and ans[now] == 'W':\n if ans[now-1] == 'S':\n ans[now+1]= 'W'\n return dfs(now+1,ans)\n else:\n ans[now+1]= 'S'\n return dfs(now+1,ans)\n elif s[now] == 'x' and ans[now] == 'S':\n if ans[now-1] == 'S':\n ans[now+1]= 'W'\n return dfs(now+1,ans)\n else:\n ans[now+1]= 'S'\n return dfs(now+1,ans)\n elif s[now] == 'x' and ans[now] == 'W':\n if ans[now-1] == 'S':\n ans[now+1]= 'S'\n return dfs(now+1,ans)\n else:\n ans[now+1]= 'W'\n return dfs(now+1,ans)\n\nans = ['A']*n\nANS= ['a']*4\n\nif s[0]=='o':\n ans[:2]=['S','W']\n ans[-1]='W'\n ANS[0] = dfs(0,ans)[:]\n\n ans[:2]=['S','S']\n ans[-1]='S'\n ANS[1] = dfs(0,ans)[:]\n\n ans[:2]=['W','S']\n ans[-1]='W'\n ANS[2] = dfs(0,ans)[:]\n\n ans[:2]=['W','W']\n ans[-1]='S'\n ANS[3] = dfs(0,ans)[:]\n\nelse:\n ans[:2]=['S','S']\n ans[-1]='W'\n ANS[0] = dfs(0,ans)[:]\n\n ans[:2]=['S','W']\n ans[-1]='S'\n ANS[1] = dfs(0,ans)[:]\n\n ans[:2]=['W','S']\n ans[-1]='S'\n ANS[2] = dfs(0,ans)[:]\n\n ans[:2]=['W','W']\n ans[-1]='W'\n ANS[3] = dfs(0,ans)[:]\n\nfor i in range(4):\n if ANS[i] != '-1':\n print(*ANS[i],sep='')\n exit()\n\nprint(-1)\n\n", "n = int(input())\ns = input() \ns=s+s[0]\n\nans = ['X']*(n+2)\n\nans[0] = 'S'\nans[1] = 'S'\n\nfor zero, one in ['SS','SW','WS','WW']:\n ans[0] = zero\n ans[1] = one\n for i in range(1,n+1):\n if (s[i] == 'o' and ans[i]=='S') or (s[i] == 'x' and ans[i]=='W'):\n ans[i+1] = ans[i-1]\n else:\n ans[i+1] = 'S' if ans[i-1]=='W' else 'W'\n\n if ans[0:2] == ans[n:]:\n print(*ans[:n],sep='')\n exit()\n\nprint(-1)\n"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s043334481', 's333551636', 's805853512'] | [91524.0, 91516.0, 7008.0] | [548.0, 557.0, 219.0] | [2291, 2304, 485] |
p03801 | u218843509 | 2,000 | 262,144 | Snuke loves constructing integer sequences. There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones. Snuke will construct an integer sequence s of length Σa_i, as follows: 1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s. 2. Select a pile with one or more stones remaining, and remove a stone from that pile. 3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process. We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence? | ['class BIT():#1-indexed\n\tdef __init__(self, size):\n\t\tself.table = [0 for _ in range(size+2)]\n\t\tself.size = size\n\n\tdef b_sum(self, i):\n\t\ts = 0\n\t\twhile i > 0:\n\t\t\ts += self.table[i]\n\t\t\ti -= (i & -i)\n\t\treturn s\n\n\tdef b_add(self, i, x):\n\t\twhile i <= self.size:\n\t\t\tself.table[i] += x\n\t\t\ti += (i & -i)\n\t\treturn\n\nn = int(input())\na = list(map(int, input().split()))\nc = sorted(list(set(a)))\nnum = 2\nd = dict()\nfor i in range(len(c)):\n\td[c[i]] = i+1\ne = [d[a[i]] for i in range(n)]\n#print(a)\nb = BIT(n+2)\ngreater = [0 for _ in range(n)]\nfor i in range(n-1, -1, -1):\n\tgreater[i] = n-i - b.b_sum(e[i] - 1)\n\tb.b_add(e[i], 1)\nprint(greater)\nM = max(a)\ncur = 0\ns = 0\nfor i in range(n):\n\tif a[i] > cur:\n\t\tprint(greater[i] * (a[i] - cur))\n\t\tcur = a[i]\n\telse:\n\t\tprint(0)', 'n = int(input())\na = list(map(int, input().split()))\nb = sorted(list(set(a)))\na_to_i = dict()\nfor i in range(len(b)):\n\ta_to_i[b[i]] = i\n\na_count = [0 for _ in range(len(b))]\nfor x in a:\n\ta_count[a_to_i[x]] += 1\n\ncum_reversed = [a_count[-1]]\nfor i in range(len(b)-2, -1, -1):\n\tcum_reversed.append(cum_reversed[-1] + a_count[i])\n\ndominant = [-1 for _ in range(len(b))]\ni = 0\nfor j in range(n):\n\tif i == len(b):\n\t\tbreak\n\twhile a[j] >= b[i]:\n\t\tdominant[i] = j\n\t\ti += 1\n\t\tif i == len(b):\n\t\t\tbreak\nb.reverse()\nb.append(0)\ndominant.reverse()\n\nans = [0 for _ in range(n)]\n\nfor i in range(len(b)-1):\n\tans[dominant[i]] += (b[i] - b[i+1]) * cum_reversed[i]\n\nprint(*ans, sep="\\n")'] | ['Wrong Answer', 'Accepted'] | ['s818804949', 's030536700'] | [28144.0, 33628.0] | [721.0, 327.0] | [752, 668] |
p03801 | u281303342 | 2,000 | 262,144 | Snuke loves constructing integer sequences. There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones. Snuke will construct an integer sequence s of length Σa_i, as follows: 1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s. 2. Select a pile with one or more stones remaining, and remove a stone from that pile. 3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process. We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence? | ['from collections import Counter\nN = int(input())\nS = list(map(int,input().split()))\nT = []\nfor i in range(N):\n T.append((i,S[i]))\nU = sorted(T,key=lambda x:x[1], reverse=True)\n\nAns = [0]*N\nc,v = 0,10**10\n\nfor i in range(N-1):\n c+=1\n v = min(v,U[i][0])\n if U[i][1]==U[i+1][1]:\n continue\n else:\n Ans[v] += (U[i][1] - U[i+1][1])*c\nelse:\n Ans[0] += U[i+1][1]\n\nfor i in range(N):\n print(Ans[i])', 'from collections import Counter\nN = int(input())\nS = list(map(int,input().split()))\nT = []\nfor i in range(N):\n T.append((i,S[i]))\nU = sorted(T,key=lambda x:x[1], reverse=True)\n\nAns = [0]*N\nc,v = 0,10**10\n\nfor i in range(N-1):\n c+=1\n v = min(v,U[i][0])\n if U[i][1]==U[i+1][1]:\n continue\n else:\n Ans[v] += (U[i][1] - U[i+1][1])*c\nelse:\n Ans[0] = 0\n Ans[0] = sum(S) - sum(Ans)\n\nfor i in range(N):\n print(Ans[i])'] | ['Runtime Error', 'Accepted'] | ['s360023364', 's135538397'] | [23880.0, 23852.0] | [310.0, 281.0] | [424, 446] |
p03801 | u392319141 | 2,000 | 262,144 | Snuke loves constructing integer sequences. There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones. Snuke will construct an integer sequence s of length Σa_i, as follows: 1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s. 2. Select a pile with one or more stones remaining, and remove a stone from that pile. 3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process. We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence? | ["N = int(input())\nA = [(a, i) for i, a in enumerate(map(int, input().split()))]\nA.sort(reverse=True)\nA.append((0, 0))\n\nans = [0] * N\nnow = float('inf')\n\nfor j, (a, i) in enumerate(A[:N], start=1):\n now = min(now, i)\n ans[now] += j * (now - A[j][0])\n\nprint(*ans, sep='\\n')\n", "N = int(input())\nA = [(a, i) for i, a in enumerate(map(int, input().split()))]\nA.sort(reverse=True)\nA.append((0, 0))\n\nans = [0] * N\nnow = float('inf')\n\nfor j, (a, i) in enumerate(A[:N], start=1):\n now = min(now, a)\n ans[now] += j * (now - A[j][0])\n\nprint(*ans, sep='\\n')\n", "from heapq import heapify, heappop\n\nN = int(input())\nA = list(map(int, input().split()))\n\nque = [(-a, i + 1) for i, a in enumerate(A)]\nheapify(que)\n\nans = [0] * (N + 1)\ncnt = 0\nwhile que:\n a, now = heappop(que)\n cnt += 1\n ans[now] = -a * cnt\n\n while que and que[0][1] > now:\n a, _ = heappop(que)\n ans[now] += -a\n cnt += 1\n\n if que:\n ans[now] -= -que[0][0] * cnt\n\nprint(*ans[1:], sep='\\n')\n"] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s438995893', 's466352228', 's345069076'] | [23704.0, 24140.0, 23220.0] | [247.0, 145.0, 288.0] | [277, 277, 432] |
p03801 | u426108351 | 2,000 | 262,144 | Snuke loves constructing integer sequences. There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones. Snuke will construct an integer sequence s of length Σa_i, as follows: 1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s. 2. Select a pile with one or more stones remaining, and remove a stone from that pile. 3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process. We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence? | ['N = int(input())\na = list(map(int, input().split()))\nb = []\nfor i in range(N):\n b.append([a[i], i+1])\nb.sort(reverse = True)\nans = [0]*(N+1)\nmini = N+1\n\nfor i in range(N-1):\n mini = min(mini, b[i][1])\n if b[i+1][0] - b[i][0] < 0:\n ans[mini] += (b[i][0] - b[i+1][0])*(i+1)\n\nans[1] += N*min(b)\nfor i in range(N):\n print(ans[i+1])\n', 'N = int(input())\na = list(map(int, input().split()))\nb = []\nfor i in range(N):\n b.append([a[i], i+1])\nb.sort(reverse = True)\nans = [0]*(N+1)\nmini = N+1\n\nfor i in range(N-1):\n mini = min(mini, b[i][1])\n if b[i+1][0] - b[i][0] < 0:\n ans[mini] += (b[i][0] - b[i+1][0])*(i+1)\n\nans[1] += N*b[-1][0]\nfor i in range(N):\n print(ans[i+1])\n'] | ['Runtime Error', 'Accepted'] | ['s546916586', 's407456691'] | [26288.0, 25580.0] | [325.0, 347.0] | [347, 349] |
p03801 | u922449550 | 2,000 | 262,144 | Snuke loves constructing integer sequences. There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones. Snuke will construct an integer sequence s of length Σa_i, as follows: 1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s. 2. Select a pile with one or more stones remaining, and remove a stone from that pile. 3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process. We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence? | ["N = int(input())\nA = [0] + list(map(int, input().split()))\nB = [[a, i, 1] for i, a in enumerate(A)]\nC = sorted(B, reverse=True)\na_max, idx = 0, 0 # [value, idx]\nleft_max = [[0, 0] for i in range(N+1)] # [value, idx]\nfor i, a in enumerate(A):\n left_max[i] = [a_max, idx]\n if a > a_max:\n a_max, idx = a, i\n\nprint(left_max)\nans = [0] * (N+1)\nnext_i = C[0][1]\nprint(B)\nprint(C)\nfor _, i, _ in C:\n a, _, num = B[i]\n if i == next_i:\n next_a, next_i = left_max[i]\n now_i = i\n ans[i] += (a - next_a) * num\n B[next_i][2] += num\n else:\n ans[now_i] += (a - next_a) * num\n B[next_i][2] += num\n \n\nprint(*ans[1:], sep='\\n')", "N = int(input())\nA = [0] + list(map(int, input().split()))\n\n\nB = [[a, i, 1] for i, a in enumerate(A)]\nC = sorted(B, reverse=True)\n\n\n\na_max, idx = 0, 0 # [value, idx]\nleft_max = [[0, 0] for i in range(N+1)] # [value, idx]\nfor i, a in enumerate(A):\n left_max[i] = [a_max, idx]\n if a > a_max:\n a_max, idx = a, i\n\nans = [0] * (N+1)\nnext_i = C[0][1]\nfor _, i, _ in C: \n a, _, num = B[i] \n if i == next_i:\n next_a, next_i = left_max[i] \n now_i = i\n ans[i] += (a - next_a) * num \n B[next_i][2] += num \n else:\n ans[now_i] += (a - next_a) * num\n B[next_i][2] += num\n\nprint(*ans[1:], sep='\\n')"] | ['Wrong Answer', 'Accepted'] | ['s295690673', 's248832269'] | [51072.0, 44788.0] | [514.0, 384.0] | [638, 1144] |
p03801 | u969190727 | 2,000 | 262,144 | Snuke loves constructing integer sequences. There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones. Snuke will construct an integer sequence s of length Σa_i, as follows: 1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s. 2. Select a pile with one or more stones remaining, and remove a stone from that pile. 3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process. We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence? | ['import collections\nimport heapq\nn=int(input())\nA=[int(i) for i in input().split()]\nAns=[0]*n\nM=[0]\nfor i in range(n):\n M.append(max(M[-1],A[i]))\nD=collections.defaultdict(int)\nH=[]\nfor i in range(n):\n j=n-1-i\n if A[j]<=M[j]:\n heapq.heappush(H,-A[j])\n else:\n Ans[j]=(A[j]-M[j])*(D[A[j]]+1)\n D[M[j]]+=D[A[j]]+1\n ct=0\n while H:\n a=heapq.heappop(H)\n a=-a\n if a<=M[j]:\n heapq.heappush(H,-a)\n break\n else:\n Ans[j]+=a-M[j]\n D[M[j]]+=1\n\nfor a in Ans:\n print(Ans)\n', 'import collections\nimport heapq\nn=int(input())\nA=[int(i) for i in input().split()]\nAns=[0]*n\nM=[0]\nfor i in range(n):\n M.append(max(M[-1],A[i]))\nD=collections.defaultdict(int)\nH=[]\nfor i in range(n):\n j=n-1-i\n if A[j]<=M[j]:\n heapq.heappush(H,-A[j])\n else:\n Ans[j]=(A[j]-M[j])*(D[A[j]]+1)\n D[M[j]]+=D[A[j]]+1\n ct=0\n while H:\n a=heapq.heappop(H)\n a=-a\n if a<=M[j]:\n heapq.heappush(H,-a)\n break\n else:\n Ans[j]+=a-M[j]\n D[M[j]]+=1\n\nfor a in Ans:\n print(a)\n'] | ['Runtime Error', 'Accepted'] | ['s738202563', 's038732754'] | [155172.0, 25176.0] | [2104.0, 306.0] | [1014, 1012] |
p03803 | u006425112 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['import sys\n\na,b = map(int, sys.stdin.readline().split())\n\nif a == 1:\n a = 14\nif b == 1:\n b = 14:\n\nif a > b:\n print("Alice")\nelif a == b:\n print("Draw")\nelse:\n print("Bob")', 'import sys\n\na,b = map(int, sys.stdin.readline().split())\n\nif a == 1:\n a = 14\nif b == 1:\n b = 14\n\nif a > b:\n print("Alice")\nelif a == b:\n print("Draw")\nelse:\n print("Bob")'] | ['Runtime Error', 'Accepted'] | ['s706693712', 's949855662'] | [2940.0, 3060.0] | [17.0, 17.0] | [186, 185] |
p03803 | u007848713 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['\nalice = int(input())\nbob = int(input())\n\nif(alice == bob):\n print("Draw")\nelif(alice == 1 and bob == 1):\n print("Draw")\n \nelif(alice == 1):\n print("Alice")\nelif(bob == 1):\n print("Bob")\nelif(alice < bob):\n print("Bob")\nelif(alice > bob):\n print("Alice")', '# -*- coding: utf-8 -*-\n\nalice = int(input())\nbob = int(input())\n\nif(alice == bob):\n print("Draw)\n elif(alice == 1 and bob == 1):\n print("Draw")\n \n elif(alice == 1):\n print("Alice")\n elif(bob == 1):\n print("Bob")\n elif(alice < bob):\n print("Bob")\n elif(alice > bob):\n print("Alice")\n', '# -*- coding: utf-8 -*-\n\nalice = int(input())\nbob = int(input())\n\nif(alice == bob):\n print("Draw)\n elif(alice == 1 and bob == 1):\n print("Draw")\n \n elif(alice == 1):\n print("Alice")\n elif(bob == 1):\n print("Bob")\n elif(alice < bob):\n print("Bob")\n elif(alice > bob):\n print("Alice")\n', '# -*- coding: utf-8 -*-\n\nalice = int(input())\nbob = int(input())\n\nif(alice == bob):\n print("Draw)\nelif(alice == 1 and bob == 1):\n print("Draw")\n \nelif(alice == 1):\n print("Alice")\nelif(bob == 1):\n print("Bob")\nelif(alice < bob):\n print("Bob")\nelif(alice > bob):\n print("Alice")\n', '# -*- coding: utf-8 -*-\n\nalice = input().split()\nalice[0] = int(alice[0])\nalice[1] = int(alice[1])\nif(alice[0] == alice[1]):\n print("Draw")\nelif(alice[0] == 1):\n print("Alice")\nelif(alice[1] == 1):\n print("Bob")\nelif(alice[0] < alice[1]):\n print("Bob")\nelif(alice[0] > alice[1]):\n print("Alice")\n\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s038672146', 's297374173', 's320821773', 's345364886', 's278435294'] | [3060.0, 2940.0, 2940.0, 2940.0, 3064.0] | [17.0, 17.0, 16.0, 17.0, 17.0] | [275, 525, 483, 381, 394] |
p03803 | u010090035 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['a,b=map(int,input().split())\nif(a==b):\n print("Draw")\nelif(a<b or a==1):\n print("Alice")\nelse:\n print("Bob")', 'a,b=map(int,input().split())\nif(a==b):\n print("Draw")\nelif(b!=1 and (a>b or a==1)):\n print("Alice")\nelse:\n print("Bob")'] | ['Wrong Answer', 'Accepted'] | ['s363306080', 's000012139'] | [3060.0, 2940.0] | [17.0, 17.0] | [117, 128] |
p03803 | u017415492 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['a,b=map(int,input().split())\n#n=int(input())\n#s=input()\nif a==b:\n print("Draw")\nelif a>b and b!=1:\n print("alice")\nelif a>b:\n print("Bob")\nelif a<b and a!=1:\n print("Bob")\nelse:\n print("alice")', 'a,b=map(int,input().split())\n#n=int(input())\n#s=input()\nif a==b:\n print("Draw")\nelif a>b and a!=1:\n print("alice")\nelif a>b:\n print("Bob")\nelif a<b and a!=1:\n print("Bob")\nelse:\n print("alice")', 'a,b=map(int,input().split())\n#n=int(input())\n#s=input()\nif a==b:\n print("Draw")\nelif a>b and a!=1:\n print(a)\nelif a>b:\n print(b)\nelif a<b and a!=1:\n print(b)\nelse:\n print(a)', 'a,b=map(int,input().split())\n#n=int(input())\n#s=input()\nif a==b:\n print("Draw")\nelif a>b and b!=1:\n print("Alice")\nelif a>b:\n print("Bob")\nelif a<b and a!=1:\n print("Bob")\nelse:\n print("Alice")'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s202399769', 's790414690', 's794166618', 's870381177'] | [2940.0, 3064.0, 2940.0, 3060.0] | [17.0, 18.0, 17.0, 17.0] | [198, 198, 178, 198] |
p03803 | u020604402 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['N,M=map(int,input().split())\nL=[]\nS=[]\nfor i in range(N):\n x = input()\n l=[y for y in x]\n L.append(l)\nfor i in range(M):\n x = input()\n s=[y for y in x]\n S.append(s)\nflag = 0\nsum = 0\nfor i in range(N):\n for j in range(N):\n for k in range(M):\n for l in range(M):\n if i+k < N and j+l < N:\n if L[i+k][j+l] == S[k][l]:\n sum += 1\n if sum == M * M:\n flag = 1\n else:\n sum = 0\nif flag == 0:\n print("No")\nelse:\n print("Yes")\n', 'table=[2,3,4,5,6,7,8,9,10,11,12,13,1]\na,b=map(int,input().split())\nif a == b :\n print("Draw")\nelif table.index(a) < table.index(b):\n print("Bob")\nelif table.index(a) > table.index(b):\n print("Alice")\n'] | ['Runtime Error', 'Accepted'] | ['s142752450', 's538090855'] | [3064.0, 2940.0] | [19.0, 18.0] | [609, 209] |
p03803 | u027675217 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['a,b = int(input())\nif a>b:\n\tprint("Alice")\nelif a<b:\n\tprint("Bob")\nelse:\n\tprint("Draw")', 'a,b = map(int,input().split())\nif a==1:\n\ta=14\nif b==1:\n\tb=14\nif a>b:\n\tprint("Alice")\nelif a<b:\n\tprint("Bob")\nelse:\n\tprint("Draw")\n'] | ['Runtime Error', 'Accepted'] | ['s593748909', 's777767537'] | [2940.0, 2940.0] | [17.0, 17.0] | [87, 130] |
p03803 | u029000441 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['import sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nfrom collections import Counter, deque\nfrom collections import defaultdict\nfrom itertools import combinations, permutations, accumulate, groupby, product\nfrom bisect import bisect_left,bisect_right\nfrom heapq import heapify, heappop, heappush\nfrom math import floor, ceil\nfrom operator import itemgetter\ndef I(): return int(input())\ndef MI(): return map(int, input().split())\ndef LI(): return list(map(int, input().split()))\ndef LI2(): return [int(input()) for i in range(n)]\ndef MXI(): return [[LI()]for i in range(n)]\ninf = 10**17\nmod = 10**9 + 7\n\nst=[0,13,1,2,3,4,5,6,7,8,9,10,11,12]\na,b=MI()\nif st[a]>st[b]:\n print("Alice")\nif st[a]==st[b]:\n print("Draw")\nelse:\n print("Bob")', 'import sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nfrom collections import Counter, deque\nfrom collections import defaultdict\nfrom itertools import combinations, permutations, accumulate, groupby, product\nfrom bisect import bisect_left,bisect_right\nfrom heapq import heapify, heappop, heappush\nfrom math import floor, ceil\nfrom operator import itemgetter\ndef I(): return int(input())\ndef MI(): return map(int, input().split())\ndef LI(): return list(map(int, input().split()))\ndef LI2(): return [int(input()) for i in range(n)]\ndef MXI(): return [[LI()]for i in range(n)]\ninf = 10**17\nmod = 10**9 + 7\n \nst=[0,13,1,2,3,4,5,6,7,8,9,10,11,12]\na,b=MI()\nif st[a]>st[b]:\n print("Alice")\nif st[a]==st[b]:\n print("Draw")\nelse:\n print("Bob")', 'import sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nfrom collections import Counter, deque\nfrom collections import defaultdict\nfrom itertools import combinations, permutations, accumulate, groupby, product\nfrom bisect import bisect_left,bisect_right\nfrom heapq import heapify, heappop, heappush\nfrom math import floor, ceil\nfrom operator import itemgetter\ndef I(): return int(input())\ndef MI(): return map(int, input().split())\ndef LI(): return list(map(int, input().split()))\ndef LI2(): return [int(input()) for i in range(n)]\ndef MXI(): return [[LI()]for i in range(n)]\ninf = 10**17\nmod = 10**9 + 7\n \nst=[0,13,1,2,3,4,5,6,7,8,9,10,11,12]\na,b=MI()\nif st[a]>st[b]:\n print("Alice")\nelif st[a]==st[b]:\n print("Draw")\nelse:\n print("Bob")\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s557294072', 's666605830', 's193841443'] | [3316.0, 3316.0, 3316.0] | [21.0, 21.0, 28.0] | [755, 756, 759] |
p03803 | u030726788 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['a,b=map(int,input().split())\nif(a==b):\n print("Draw")\nelif(a<b):\n if(a==1):\n print("Alice")\n else:\n print("Bob")\nelse:\n print("Bob")', 'a,b=map(int,input().split())\nif(a==b):\n print("Draw")\nelif(a<b):\n if(a==1):\n print("Alice")\n else:\n print("Bob")\nelse:\n if(b==1):\n print("Alice")\n else:\n\tprint("Bob")\n', 'a,b=map(int,input().split())\nif(a==b):\n print("Draw")\nelif(a<b):\n if(a==1):\n print("Alice")\n else:\n print("Bob")\nelse:\n if(b==1):\n print("Alice")\n else:\n print("Bob")\n', 'a,b=map(int,input().split())\nif(a==b):\n print("Draw")\nelif(a<b):\n if(a==1):\n print("Alice")\n else:\n print("Bob")\nelse:\n if(b==1):\n print("Bob")\n else:\n print("Alice")\n'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s088157742', 's553977606', 's949344458', 's384381040'] | [3316.0, 2940.0, 2940.0, 2940.0] | [22.0, 18.0, 17.0, 17.0] | [142, 181, 184, 184] |
p03803 | u036190609 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['A, B = map(int, input().split()))\nif A == B:\n print("Draw")\nelif A == 1 and B != 1:\n print("Alice")\nelif B == 1 and A != 1:\n print("Bod")\nelif A > B:\n print("Alice")\nelse:\n print("Bob")', 'a, b = map(int, input().split())\nif a == b:\n print("Draw")\nelif a == 1:\n print("Alice")\nelif b == 1:\n print("Bob")\nelif a > b:\n print("Alice")\nelse:\n print("Bob")'] | ['Runtime Error', 'Accepted'] | ['s333119963', 's590448669'] | [2940.0, 2940.0] | [17.0, 17.0] | [200, 177] |
p03803 | u039360403 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["a,b=input().split()\na1=a.replace('1','14')\nb1=b.replace('1','14')\nprint('Alice' if a1<b1 else 'Bob' if a1>b1 else 'Draw')\n", "a,b=map(int,input().split())\nprint('Alice' if (a==1 or a>b) and b!=1 else 'Draw' if a==b else 'Bob')\n"] | ['Wrong Answer', 'Accepted'] | ['s747045846', 's454079658'] | [2940.0, 2940.0] | [17.0, 17.0] | [122, 101] |
p03803 | u052499405 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['a, b = [int(item) for item in input().split()]\nif a > b:\n print("Alice")\neiif a == b:\n print("Draw")\nelse:\n print("Bob")', 'a, b = [int(item) for item in input().split()]\nif a == 1:\n a += 100\nif b == 1:\n b += 100\n \nif a > b:\n print("Alice")\nelif a == b:\n print("Draw")\nelse:\n print("Bob")'] | ['Runtime Error', 'Accepted'] | ['s380541818', 's021344489'] | [2940.0, 3060.0] | [17.0, 17.0] | [123, 170] |
p03803 | u055687574 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['N, M = map(int, input().split())\n\nA = [input() for n in range(N)]\nB = [input() for m in range(M)]\n\nans = "Yes"\nfor a in A:\n for b in B:\n print(a, b)\n if b not in a:\n ans = "No"\nprint(ans)\n', 'N, M = map(int, input().split())\n\nA = [input() for n in range(N)]\nB = [input() for m in range(M)]\nfor a in A:\n cnt = 0\n for b in B:\n if b in a:\n cnt += 1\n else:\n cnt = 0\n if cnt == M:\n print("Yes")\n exit()\n\nprint("No")\n', 'a, b = map(int, input().split())\n\n\nif a == b:\n print("Draw")\nelif a == 1:\n print("Alice")\nelif b == 1:\n print("Bob")\nelif a > b:\n print("Alice")\nelif a < b:\n print("Bob")\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s001525751', 's279922568', 's828841871'] | [2940.0, 3060.0, 2940.0] | [17.0, 17.0, 17.0] | [216, 290, 186] |
p03803 | u062484507 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['N, M = map(int, input().split())\nA = [input() for i in range(N)]\nB = [input() for j in range(M)]\n\nans = True\nfor k in range(len(B)):\n if B[k] not in A[k]:\n ans = False\n break\nprint("Yes" if ans == True else "No")', "A, B = map(int, input().split())\nif A == B:\n ans = 'Draw'\nelif A == 1:\n ans = 'Alice'\nelif B == 1:\n ans = 'Bob'\nelif A > B:\n ans = 'Alice'\nelse:\n ans = 'Bob'\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s158340164', 's845740691'] | [3060.0, 2940.0] | [18.0, 17.0] | [229, 183] |
p03803 | u063346608 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['A,B = int(input().split())\n\nif A > B and B != 1:\n\tprint("Alice")\nelif A == B:\n\tprint("Draw")\nelif B > A and A != 1:\n\tprint("Bob")', 'A,B = map(int,input().split())\n\nif A > B and B != 1:\n\tprint("Alice")\nelif A > B and B == 1:\n\tprint("Bob")\n\nif B > A and A != 1:\n\tprint("Bob")\nelif B > A and A == 1:\n\tprint("Alice")\n\nif A == B:\n\tprint("Draw")'] | ['Runtime Error', 'Accepted'] | ['s470137794', 's868808672'] | [2940.0, 3060.0] | [17.0, 17.0] | [129, 207] |
p03803 | u065683101 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["def read():\n return int(input())\n\ndef reads(sep=None):\n return list(map(int, input().split(sep)))\n\ndef main():\n a, b = input()\n if a == 1:\n a = 14\n if b == 1:\n b = 14\n\n if a == b:\n print('Draw')\n elif a > b:\n print('Alice')\n else:\n print('Bob')\n \nmain()\n", "def read():\n return int(input())\n\ndef reads(sep=None):\n return list(map(int, input().split(sep)))\n\ndef main():\n a, b = reads()\n if a == 1:\n a = 14\n if b == 1:\n b = 14\n\n if a == b:\n print('Draw')\n elif a > b:\n print('Alice')\n else:\n print('Bob')\n \nmain()\n"] | ['Runtime Error', 'Accepted'] | ['s147620430', 's456820451'] | [3060.0, 3060.0] | [17.0, 17.0] | [313, 313] |
p03803 | u073852194 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["A, B = map(int, input().split())\nif A == B:\n\tprint('Draw)\nelif A == 1:\n\tpirnt('Alice')\nelif B == 1:\n\tprint('Bob')\nelif A > B:\n\tprint('Alice')\nelse:\n\tprint('Bob') ", "A, B = map(int, input().split())\nif A == B:\n\tprint('Draw')\nelif A == 1:\n\tprint('Alice')\nelif B == 1:\n\tprint('Bob')\nelif A > B:\n\tprint('Alice')\nelse:\n\tprint('Bob') "] | ['Runtime Error', 'Accepted'] | ['s693666579', 's928046887'] | [3060.0, 2940.0] | [18.0, 17.0] | [171, 163] |
p03803 | u076498277 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['N = int(input())\nbonus = N // 15 * 200\nprint(N * 800 - bonus)', 'A, B = map(int,input().split())\nif A == B:\n print("Draw")\nelif A > B or A == 1:\n if B == 1:\n print("Bob")\n else:\n print("Alice")\nelse:\n print("Bob")'] | ['Runtime Error', 'Accepted'] | ['s959870310', 's441296124'] | [2940.0, 2940.0] | [17.0, 17.0] | [61, 158] |
p03803 | u077019541 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['A,B = map(int,input().split())\nif 1 in A or 1 in B:\n if A==1 and B==1:\n print("Draw")\n elif A==1:\n print("Alice")\n else:\n print("Bob")\nelse:\n if A>B:\n print("Alice")\n elif B>A:\n print("Bob")\n else:\n print("Draw")', 'A,B = map(int,input().split())\nif A == 1 or B == 1:\n if A==1 and B==1:\n print("Draw")\n elif A==1:\n print("Alice")\n else:\n print("Bob")\nelse:\n if A>B:\n print("Alice")\n elif B>A:\n print("Bob")\n else:\n print("Draw")'] | ['Runtime Error', 'Accepted'] | ['s812809406', 's035801940'] | [3060.0, 3060.0] | [17.0, 17.0] | [272, 272] |
p03803 | u089376182 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["a, b = map(int, input().split())\nprint('Draw' if a==b else 'Alice' if (a==1)or(b!=1 and a>b)) else 'Bob')", "a, b = map(int, input().split())\nprint('Draw' if a==b else 'Alice' if (a==1)or(b!=1 and a>b) else 'Bob')\n"] | ['Runtime Error', 'Accepted'] | ['s386440352', 's954965872'] | [2940.0, 2940.0] | [17.0, 17.0] | [105, 105] |
p03803 | u093492951 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["import sys\nN, M = [int(i) for i in input().split()]\n\nA = [[i for i in input()] for j in range(N)]\nB = [[i for i in input()] for k in range(M)]\n\nfor i in range(N-M):\n for j in range(N-M):\n diff = 0\n\n for k in range(M):\n for l in range(M):\n if A[i+k][j+l] != B[k][l]:\n diff = 1\n break\n\n if diff == 1:\n break\n\n if diff == 0:\n print('Yes')\n sys.exit()\n\n\nprint('No')\n", "A , B = [int(i) for i in input().split()]\n\nif A == B:\n print('Draw')\nelif A == 1 or B == 1:\n if B != 1:\n print('Alice')\n else:\n print('Bob')\nelse:\n if A > B:\n print('Alice')\n else:\n print('Bob')\n"] | ['Runtime Error', 'Accepted'] | ['s201580389', 's019001536'] | [3064.0, 2940.0] | [18.0, 18.0] | [546, 238] |
p03803 | u093500767 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['a, b = input().stlip()\n\nif a==1:\n a = 14\nif b==1:\n b = 14\n\nif a>b:\n print("Alice")\nelif a<b:\n print("Bob")\nelse:\n print("Draw")', 'a, b = map(int, input().stlip())\n\nif a==1:\n a = 14\nif b==1:\n b = 14\n\nif a>b:\n print("Alice")\nelif a<b:\n print("Bob")\nelse:\n print("Draw")', 'a, b = map(int, input().split())\n\nif a==1:\n a = 14\nif b==1:\n b = 14\n\nif a>b:\n print("Alice")\nelif a<b:\n print("Bob")\nelse:\n print("Draw")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s270539999', 's721036419', 's597947205'] | [2940.0, 3060.0, 3060.0] | [17.0, 23.0, 17.0] | [142, 152, 152] |
p03803 | u094565093 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["N,M=map(int,input().split())\nA=[ list(input()) for i in range(N)]\nB=[ list(input()) for i in range(M)]\nans='Yes'\nfor i in range(N-M+1):\n for j in range(N-M+1):\n \n for k in range(i,i+M):\n for l in range(j,j+M):\n if A[k][l]!=B[k-i][l-j]:\n ans='No'\nprint(ans)\n", "A,B=input().split()\npoker=['2','3','4','5','6','7','8','9','10','11','12','13','1']\nif poker.index(A)<poker.index(B):\n print('Bob')\nelif poker.index(A)>poker.index(B):\n print('Alice')\nelse:\n print('Draw')"] | ['Runtime Error', 'Accepted'] | ['s836866332', 's122967499'] | [3060.0, 3060.0] | [17.0, 17.0] | [319, 213] |
p03803 | u095969144 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['\ndef one(x):\n if x == 1:\n ret = 14\n return ret\n else:\n ret = x\n return ret\n\na, b = map(int, int(input())\nif one(a) > one(b):\n print("Alice")\nelif one(a) < one(b):\n print("Bob")\nelse:\n print("Draw")\n', 'a, b = map(input().split())\nif a > b:\n print("Alice")\nelif a < b:\n print("Bob")\nelse:\n print("Draw")', '\ndef one(x):\n if x == 1:\n return 14\n else:\n return x\n\na, b = map(int, input().split())\nif one(a) > one(b):\n print("Alice")\nelif one(a) < one(b):\n print("Bob")\nelse:\n print("Draw")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s253982655', 's955492226', 's286495358'] | [2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0] | [241, 109, 208] |
p03803 | u098994567 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["\n\n#\n\n\n\n#\n\n#\n\n\n\n\n\n\n\ninput_alice, input_bob = map(int,input().split())\n\nresult = 'ret'\n\nif input_alice > input_bob:\n if input_bob == 1: \n result = 'Bob'\n else:\n result = 'Alis'\nelif input_alice < input_bob:\n if input_alice == 1: \n result = 'Alice'\n else:\n result = 'Bob'\nelse:\n result = 'Draw' \n\nprint(result)\n", "\n\n#\n\n\n\n#\n\n#\n\n\n\n\n\n\n\ninput_alice, input_bob = map(int,input().split())\n\nresult = 'ret'\n\nif input_alice > input_bob:\n if input_bob == 1: \n result = 'Bob'\n else:\n result = 'alis'\nelif input_alice < input_bob:\n if input_alice == 1: \n result = 'Alice'\n else:\n result = 'Bob'\nelse:\n result = 'Draw' \n\nprint(result)", "\n\n#\n\n\n\n#\n\n#\n\n\n\n\n\n\n\ninput_alice, input_bob = map(int,input().split())\n\nresult = 'ret' \n\nif input_alice > input_bob: \n if input_bob == 1:\n result = 'Bob' \n else:\n result = 'Alice'\nelif input_alice < input_bob: \n if input_alice == 1:\n result = 'Alice' \n else:\n result = 'Bob'\nelse:\n result = 'Draw' \n\nprint(result) \n"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s234916598', 's954832268', 's872334691'] | [9064.0, 9148.0, 8948.0] | [26.0, 34.0, 28.0] | [1626, 1625, 1721] |
p03803 | u102126195 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['A, B = map(int, input())\nif A == B:\n print("Draw")\nelif A == 1:\n print("Alice")\nelif B == 1:\n print("Bob")\nelse:\n if A < B:\n print("Bob")\n else:\n print("Alice")', 'A, B = map(int, input().split())\nif A == B:\n print("Draw")\nelif A == 1:\n print("Alice")\nelif B == 1:\n print("Bob")\nelse:\n if A < B:\n print("Bob")\n else:\n print("Alice")\n'] | ['Runtime Error', 'Accepted'] | ['s071784785', 's535527354'] | [2940.0, 2940.0] | [18.0, 17.0] | [171, 180] |
p03803 | u111365959 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["j = [2,3,4,5,6,7,8,9,10,11,12,13,1]\na,b = [int(x) for x in input().split()]\nif j.index(a) > j.rindex(b):\n print('Alice')\nelif j.index(a) < j.index(b):\n print('Bob')\nelse:\n print('Draw')\n", "a,b = [int(x) for x in input().split()]\nj = [2,3,4,5,6,7,8,9,10,11,12,13,1]\nif j.index(a) > j.rindex(b):\n print('Alice')\nelif j.index(a) < j.index(b):\n print('Bob')\nelse:\n print('Draw')\n", "j = [2,3,4,5,6,7,8,9,10,11,12,13,1]\na,b = [int(x) for x in input().split()]\nif j.rindex(a) < j.rindex(b):\n print('Alice')\nelif j.rindex(a) > j.rindex(b):\n print('Bob')\nelse:\n print('Draw')", "j = [2,3,4,5,6,7,8,9,10,11,12,13,1]\na,b = [int(x) for x in input().split()]\nif j.index(a) > j.rindex(b):\n print('Alice')\nelif j.rindex(a) < j.rindex(b):\n print('Bob')\nelse:\n print('Draw')\n", "a,b = [int(x) for x in input().split()]\nj = [2,3,4,5,6,7,8,9,10,11,12,13,1]\nif j.index(a) > j.index(b):\n print('Alice')\nelif j.index(a) < j.index(b):\n print('Bob')\nelse:\n print('Draw')\n"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s207442481', 's432893056', 's719751496', 's930176853', 's014210778'] | [2940.0, 3060.0, 3060.0, 3060.0, 3060.0] | [17.0, 18.0, 17.0, 17.0, 17.0] | [189, 189, 191, 191, 188] |
p03803 | u112902287 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['import sys\n\nn, m = map(int, input().split())\n\na = []\nfor i in range(n):\n a.append(list(input()))\n\nb = []\nfor i in range(m):\n b.append(list(input()))\n\nfor i in range(n-m+1):\n for j in range(n-m+1):\n for k in range(m):\n if k <= m-2:\n if a[i+k][j:j+m] == b[k]:\n continue\n else:\n break\n else:\n if a[i+k][j:j+m] == b[k]:\n print("Yes")\n sys.exit()\n else:\n break\n\nprint("No")\n\n\n ', 'a, b = map(int, input().split())\nl = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1]\n\nif l.index(a) > l.index(b):\n print("Alice")\nelif l.index(a) == l.index(b):\n print("Draw")\nelse:\n print("Bob")\n'] | ['Runtime Error', 'Accepted'] | ['s718087683', 's292734608'] | [3064.0, 3060.0] | [19.0, 17.0] | [568, 201] |
p03803 | u115877451 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | [' a,b = map(int,input().split())\n if a != 1 and b != 1:\n if a > b :\n print("Alice")\n elif a < b:\n print("Bob")\n else:\n print("Draw")\n elif a == 1 and b != 1:\n print("Alice")\n elif a != 1 and b == 1:\n print("Bob")\n else:\n print("Draw")', 'a,b = map(int,input().split())\nif a != 1 and b != 1:\n if a > b :\n \t print("Alice")\n elif a < b:\n print("Bob")\n else:\n print("Draw")\nelif a == 1 and b != 1:\n print("Alice")\nelif a != 1 and b == 1:\n print("Bob")\nelse:\n print("Draw")'] | ['Runtime Error', 'Accepted'] | ['s958292928', 's033515066'] | [2940.0, 3060.0] | [17.0, 18.0] | [323, 261] |
p03803 | u117193815 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['a,b = map(int, input())\nif a==1:\n print(\'Alice\')\nif b==1:\n print(\'Bob\')\nif a==b:\n print("Draw")\nif a>b:\n print("Alice")\nelse:\n print("Bob")', "A,B = map(int, input().split())\nif A==1:\n A=14\nif B==1:\n B=14\n\nif a>b:\n print('Alice')\nelif b>a:\n print('Bob')\nelse:\n print('Draw')", "A,B = map(int, input().split())\nif A==1:\n A=14\nif B==1:\n B=14\n\nif A>B:\n print('Alice')\nelif B>A:\n print('Bob')\nelse:\n print('Draw')"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s313758067', 's889139737', 's399904323'] | [2940.0, 3060.0, 2940.0] | [17.0, 18.0, 17.0] | [144, 136, 136] |
p03803 | u118211443 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['n,m=map(int,input().split())\na = []\nfor i in range(n):\n a.append(input())\nb = []\nfor i in range(m):\n b.append(input())\n\nok=False\ncf=[]\nfor i in range(n-m+1):\n for j in range(n-m+1):\n for l in range(m):\n cf.append(a[i+l][j:j+m])\n #print(cf)\n if cf==b:\n ok=True\n cf=[]\nprint("Yes"if ok else "No")', 'a,b=map(int,input().split())\nJ=0\nif (a==1 and b!=1):\n J=1\nelif (b==1 and a!=1):\n J=2\nelif a<b:\n J=2\nelif a>b:\n J=1\nprint("Alice" if J==1 else "Bob" if J==2 else "Draw")'] | ['Runtime Error', 'Accepted'] | ['s336055513', 's697967391'] | [3064.0, 2940.0] | [17.0, 18.0] | [345, 180] |
p03803 | u119226758 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['import math\n\nN, Ma, Mb = map(int,input().split())\nrate = Ma / Mb\na = [0] * N\nb = [0] * N\nc = [0] * N\nMA = 0\nMB = 0\nfor i in range(N):\n a[i], b[i], c[i] = map(int, input().split())\n MA += a[i]\n MB += b[i]\n\ndp = [[[math.inf for i in range(MB+1)] for j in range(MA+1)] for k in range(N+1)]\ndp[0][0][0] = 0\n\nfor it_N in range(N):\n for it_MA in range(MA+1):\n for it_MB in range(MB+1):\n if it_MA >= a[it_N] and it_MB >= b[it_N]:\n if dp[it_N][it_MA-a[it_N]][it_MB-b[it_N]] != math.inf:\n dp[it_N+1][it_MA][it_MB] = min(dp[it_N][it_MA-a[it_N]][it_MB-b[it_N]] + c[it_N], dp[it_N][it_MA][it_MB])\n else:\n dp[it_N+1][it_MA][it_MB]=dp[it_N][it_MA][it_MB]\n\n# for it_MA in range(MA+1):\n# for it_MB in range(MB+1):\n#print(it_N+1,it_MA,it_MB,dp[it_N+1][it_MA][it_MB])\n\n\nans = -1\nfor a in range(1, MA+1):\n for b in range(1, MB+1):\n print(a,b,dp[N][a][b])\n if a/b == rate and dp[N][a][b] != math.inf:\n if ans == -1:\n ans = dp[N][a][b]\n else:\n ans = min([dp[N][a][b], ans])\nprint(ans)\n', 'a, b = map(int,input().split())\nv = ""\nif a = b:\n v = "Draw"\nelif a == 1 or a > b:\n v = "Alice"\nelif b == 1 or a < b:\n v = "Bob"\nprint(v)\n', 'import math\n\nN, Ma, Mb = map(int,input().split())\nrate = Ma / Mb\na = [0] * N\nb = [0] * N\nc = [0] * N\nMA = 0\nMB = 0\nfor i in range(N):\n a[i], b[i], c[i] = map(int, input().split())\n MA += a[i]\n MB += b[i]\n\ndp = [[[math.inf for i in range(MB+1)] for j in range(MA+1)] for k in range(N+1)]\ndp[0][0][0] = 0\n\nfor it_N in range(N):\n for it_MA in range(MA+1):\n for it_MB in range(MB+1):\n if it_MA >= a[it_N] and it_MB >= b[it_N]:\n if dp[it_N][it_MA-a[it_N]][it_MB-b[it_N]] != math.inf:\n dp[it_N+1][it_MA][it_MB] = min(dp[it_N][it_MA-a[it_N]][it_MB-b[it_N]] + c[it_N], dp[it_N][it_MA][it_MB])\n else:\n dp[it_N+1][it_MA][it_MB]=dp[it_N][it_MA][it_MB]\n\n for it_MA in range(MA+1):\n for it_MB in range(MB+1):\n# print(it_N+1,it_MA,it_MB,dp[it_N+1][it_MA][it_MB])\n\n\nans = -1\nfor a in range(1, MA+1):\n for b in range(1, MB+1):\n print(a,b,dp[N][a][b])\n if a/b == rate and dp[N][a][b] != math.inf:\n if ans == -1:\n ans = dp[N][a][b]\n else:\n ans = min([dp[N][a][b], ans])\nprint(ans)\n', 'a, b = map(int,input().split())\nv = ""\nif a == b:\n v = "Draw"\nelif a == 1:\n v = "Alice"\nelif b == 1:\n v = "Bob"\nelif a > b:\n v = "Alice"\nelse:\n v = "Bob"\n\nprint(v)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s132094613', 's176001475', 's399974883', 's912738504'] | [3064.0, 2940.0, 3064.0, 2940.0] | [18.0, 17.0, 18.0, 19.0] | [1146, 147, 1156, 179] |
p03803 | u119655368 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['import itertools\nn, m = map(int, input().split())\nl = [list(map(int, input().split())) for i in range(m)]\nr = [[] for i in range(n + 1)]\nans = 0\nfor i in range(m):\n r[l[i][0]].append(l[i][1])\n r[l[i][1]].append(l[i][0])\np = []\nfor i in range(n):\n p.append(i + 1)\np = list(itertools.permutations(p))\nfor i in range(len(p)):\n check = True\n t = list(p[i])\n if t[0] != 1:\n check = False\n for j in range(len(t)-1):\n if not t[j + 1] in r[t[j]]:\n check = False\n if check:\n ans += 1\nprint(ans)', "a,b = map(int,input().split())\nif a == 1:\n a += 20\nif b == 1:\n b += 20\nif a == b:\n print('Draw')\nelif a > b:\n print('Alice')\nelse:\n print('Bob')"] | ['Runtime Error', 'Accepted'] | ['s531113424', 's500650873'] | [3064.0, 3060.0] | [18.0, 17.0] | [541, 149] |
p03803 | u120026978 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['a, b = int(input())\nif a == 1:\n a = 14\nelif b == 1:\n b = 14\n\nif a > b:\n print("Alice")\nelif a < b:\n print("Bob")\nelse:\n print("Draw")', 'a, b = map(int, input().split())\nif a == 1:\n a = 14\nif b == 1:\n b = 14\n\nif a > b:\n print("Alice")\nelif a < b:\n print("Bob")\nelse:\n print("Draw")'] | ['Runtime Error', 'Accepted'] | ['s025810221', 's699647273'] | [3060.0, 3060.0] | [17.0, 17.0] | [148, 159] |
p03803 | u125269142 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["a, b = map(int, input().split())\n\nif a < b:\n ans = 'Bob'\nelif a == b:\n ans = 'Draw'\nelse:\n a > b:\n ans = 'Alice'\nprint(ans)", "a, b = map(int, input().split())\n\nif a == 1:\n a += 13\nif b == 1:\n b += 13\n\nif a < b:\n ans = 'Bob'\nelif a == b:\n ans = 'Draw'\nelse:\n ans = 'Alice'\nprint(ans)\n"] | ['Runtime Error', 'Accepted'] | ['s925460706', 's817494567'] | [9020.0, 9080.0] | [23.0, 25.0] | [129, 162] |
p03803 | u127856129 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['s=[13,1,2,3,4,5,6,7,8,9,10,11,12]\na,b=map(int,input().split())\nif s[a-1]==s[b-1]:\n print("Draw")\nelif s[a-1]<s[b-1]\n print("Bob")\nelse:\n print("Alice")', 'a,b=map(int,input().split())\nif a==b:\n print("Draw")\nelif a>b:\n print("Bob")\nelse:\n print("Alice")', 's=[13,1,2,3,4,5,6,7,8,9,10,11,12]\na,b=map(int,input().split())\nif s[a-1]==s[b-1]:\n print("Draw")\nelif s[a-1]<s[b-1]:\n print("Bob")\nelse:\n print("Alice")\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s093013653', 's442730497', 's336863425'] | [2940.0, 2940.0, 3060.0] | [17.0, 18.0, 18.0] | [154, 101, 156] |
p03803 | u131264627 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['from itertools import permutations\nn, m = map(int, input().split())\nab = [[] for i in range(n)]\nfor i in range(m):\n a, b = map(lambda x: int(x) - 1, input().split())\n ab[a].append(b)\n ab[b].append(a)\ncnt = 0\nif n == 2:\n if 1 in ab[0]:\n print(1)\n else:\n print(0)\n exit()\nfor p in permutations(range(1, n)):\n if p[0] in ab[0]:\n flag = True\n for i in range(n - 2):\n if p[i + 1] not in ab[p[i]]:\n flag = False\n break\n if flag:\n cnt += 1\nprint(cnt)', "a, b = map(int, input().split())\nif a == b:\n print('Draw')\nelif (a > b and not b == 1) or a == 1:\n print('Alice')\nelse:\n print('Bob')"] | ['Runtime Error', 'Accepted'] | ['s187060340', 's597334727'] | [3064.0, 2940.0] | [18.0, 17.0] | [551, 142] |
p03803 | u135265051 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["# import math\n# import statistics\n#a=input()\n#b,c=int(input()),int(input())\n# c=[]\n\n# c.append(i)\ne1,e2 = map(int,input().split())\n#K = input()\n# f = list(map(int,input().split()))\n#g = [input() for _ in range(a)]\na=[2,3,4,5,6,7,8,9,10,11,12,13,1]\nif e1==e2:\n\tprint('Draw')\nelif a.index(e1)<a.index(e2):\n\tprint('Alice')\nelse:\n\tprint('Bob')", "# import math\n# import statistics\n#a=input()\n#b,c=int(input()),int(input())\n# c=[]\n\n# c.append(i)\ne1,e2 = map(int,input().split())\n#K = input()\n# f = list(map(int,input().split()))\n#g = [input() for _ in range(a)]\na=[2,3,4,5,6,7,8,9,10,11,12,13,1]\nif e1==e2:\n\tprint('Draw')\nelif a.index(e1)>a.index(e2):\n\tprint('Alice')\nelse:\n\tprint('Bob')"] | ['Wrong Answer', 'Accepted'] | ['s383630091', 's802556113'] | [9172.0, 9104.0] | [30.0, 26.0] | [355, 355] |
p03803 | u137228327 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["lst = map(int,input().split())\n\nif lst[0] > lst[1]:\n print('Alice')\nelif lst[0] < lst[1]:\n print('Bob')\nelse:\n print('Draw')\n\n", "lst = [14 if x == 1 else x for x in map(int,input().split())]\nif lst[1] != 1 and lst[0] > lst[1] :\n print('Alice')\nelif lst[0] != 1 and lst[0] < lst[1]:\n print('Bob')\nelse:\n print('Draw')\n "] | ['Runtime Error', 'Accepted'] | ['s512657134', 's457671454'] | [9012.0, 9108.0] | [20.0, 25.0] | [129, 196] |
p03803 | u140480594 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['A, B = list(map(int, input().split()))\ncards = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1]\nif cards.index(A) > cards.index(B) :\n print("Alice")\nif cards.index(B) > cards.index(A) :\n print("Bob")\nelse :\n print("Draw")', 'A, B = list(map(int, input().split()))\ncards = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1]\nif cards.index(A) > cards.index(B) :\n print("Alice")\nelif cards.index(B) > cards.index(A) :\n print("Bob")\nelse :\n print("Draw")'] | ['Wrong Answer', 'Accepted'] | ['s567333828', 's569014253'] | [3060.0, 3060.0] | [18.0, 17.0] | [219, 221] |
p03803 | u143492911 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['a,b=map(int,input().split())\nif a==1:\n print("Alice")\nelif b==1:\n print("Bob")\nelif a<b:\n print("Bob")\nelif:b<a\n print("Alice")\nelse:\n print("Draw")\n', 'a,b=map(int,input().split())\nif a==b:\n print("Draw")\nelif a==1:\n print("Alice")\nelif b==1:\n print("Bob")\nelif a<b:\n print("Bob")\nelse:\n print("Alice")'] | ['Runtime Error', 'Accepted'] | ['s935931329', 's645866726'] | [2940.0, 2940.0] | [17.0, 18.0] | [164, 165] |
p03803 | u144980750 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['a,b=map(int,input().split())\nif a==b:\n print("Draw")\nelif a==1:\n print("Alice")\nelif b==1:\n print("Bob")\nelif b<a:\n print("Alice")\nelse a<b:\n print("Bob")', 'a,b=map(int,input().split())\nif a==b:\n print("Draw")\nelif a==1:\n print("Alice")\nelif b==1:\n print("Bob")\nelif b<a:\n print("Alice")\nelse:\n print("Bob")'] | ['Runtime Error', 'Accepted'] | ['s648716804', 's705837512'] | [2940.0, 2940.0] | [17.0, 17.0] | [159, 155] |
p03803 | u147912476 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["A, B = map(int, input().split())\n\nif A == B:\n print('Draw')\nelif A == 1:\n print('Alice')\nelif B == 1:\n print('Bob')\nelif A < B:\n print('Alice')\nelif A > B:\n print('Bob')", "A, B = map(int, input().split())\n\nif A == B:\n print('Draw')\nelif A == 1:\n print('Alice')\nelif A == 1:\n print('Bob')\nelif A < B:\n print('Alice')\nelif A > B:\n print('Bob')", "A, B = map(int, input().split())\n\nif A == B:\n print('Draw')\nelif A == 1:\n print('Alice')\nelif B == 1:\n print('Bob')\nelif A > B:\n print('Alice')\nelif A < B:\n print('Bob')"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s221078211', 's342402488', 's213918602'] | [9052.0, 9108.0, 9128.0] | [29.0, 26.0, 29.0] | [184, 184, 184] |
p03803 | u150117535 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['if A == B:\n print("Draw")\nelif A == 1:\n print("Alice")\nelif B == 1:\n print("Bob")\nelif A > B:\n print("Alice")\nelse:\n print("Bob")', '(A,B) = [int(x) for x in input().split()]\nif A == B:\n print("Draw")\nelif A == 1:\n print("Alice")\nelif B == 1:\n print("Bob")\nelif A > B:\n print("Alice")\nelse:\n print("Bob")'] | ['Runtime Error', 'Accepted'] | ['s469298933', 's936856142'] | [2940.0, 3316.0] | [17.0, 25.0] | [144, 186] |
p03803 | u151625340 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["A,B = int(input())\nif A<B:\n if A == 1:\n print('Alice')\n else:\n print('Bob')\nelif A == B:\n print('Draw')\nelse:\n if B == 1:\n print('Bob')\n else:\n print('Alice')\n", "A,B = map(int,input().split())\nif A<B:\n if A == 1:\n print('Alice')\n else:\n print('Bob')\nelif A == B:\n print('Draw')\nelse:\n if B == 1:\n print('Bob')\n else:\n print('Alice')\n"] | ['Runtime Error', 'Accepted'] | ['s062200220', 's869354885'] | [2940.0, 2940.0] | [17.0, 17.0] | [202, 214] |
p03803 | u153902122 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["A,B=map(int,input().split())\nif A>B:\n if B!=2:\n print('Alice')\n else:\n print('Bob')\nif A==B:\n print('Draw')\nelse:\n if A==2:\n print('Alice')\n else:\n print('Bob')", "A,B=map(int,input().split())\nif A>B:\n if B==1:\n print('Bob')\n else:\n print('Alice')\nif A==B:\n print('Draw')\nif A<B:\n if A==1:\n print('Alice')\n else:\n print('Bob')"] | ['Wrong Answer', 'Accepted'] | ['s859857184', 's597878245'] | [2940.0, 3060.0] | [18.0, 17.0] | [177, 191] |
p03803 | u159717036 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["a,b=map(int,input().split())\nif a==1:\n a=100\nif b==1:\n b=100\nif a>b:\n print('Alise')\nelif a==b:\n print('Draw')\nelse:\n print('Bob')\n", "a,b=map(int,input().split())\nif a==1:\n a=100\nif b==1:\n b=100\nif a>b:\n print('Alice')\nelif a==b:\n print('Draw')\nelse:\n print('Bob')\n"] | ['Wrong Answer', 'Accepted'] | ['s490315790', 's440252825'] | [2940.0, 2940.0] | [17.0, 17.0] | [146, 146] |
p03803 | u164471280 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['# ACB054C\nn, m = map(int, input().split())\nL = [[] for i in range(n)]\n\nfor i in range(m):\n a, b = map(int, input().split())\n L[a-1].append(b-1)\n L[b-1].append(a-1)\n\nans = 0\ndef f(t, history):\n history[t] += 1\n his = history[:]\n global ans\n if sum(his) == n:\n ans += 1\n else:\n \n for i in L[t]:\n if his[i] == 0:\n f(i, his)\n \nf(0, [0]*n)\nprint(ans)\n', '# ACB054A\na, b = map(int, input().split())\nif a == b:\n print("Draw")\nelif a == 1:\n print("Alice")\nelif b == 1:\n print("Bob")\nelif a > b:\n print("Alice")\nelse:\n print("Bob")\n\n'] | ['Runtime Error', 'Accepted'] | ['s344440489', 's937730470'] | [3064.0, 2940.0] | [18.0, 17.0] | [428, 189] |
p03803 | u167254893 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ['A,B = map(int,input().split())\n\nif (A=1 and B!=1):\n print("Alice")\n \n \n\n\n\n\nif (A>B):\n print("Alice")\nelif(A<B):\n print("Bob")\nelif(A==B):\n print("Draw")\n \n', 'A,B = map(int,input().split())\n\nif (A==1 and B!=1):\n print("Alice")\n exit()\n elif(B==1 and A!=1):\n print("Bob") \n \n\n\n\n\nif (A>B):\n print("Alice")\nelif(A<B):\n print("Bob")\nelif(A==B):\n print("Draw")\n \n', 'A,B = map(int,input().split())\n\nif (A==1 and B!=1):\n print("Alice")\n exit()\n elif(B==1 and A!=1):\n print("Bob") \n \n\n\n\n\nif (A>B):\n print("Alice")\nelif(A<B):\n print("Bob")\nelif(A==B):\n print("Draw")\n \n', 'A,B = map(int,input().split())\n\nif (A==1 and B!=1):\n print("Alice")\n exit()\nelif(B==1 and A!=1):\n print("Bob") \n exit()\n\n\n\n\nif (A>B):\n print("Alice")\nelif(A<B):\n print("Bob")\nelif(A==B):\n print("Draw")\n \n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s084978853', 's768036862', 's983605763', 's981444511'] | [2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [176, 226, 226, 231] |
p03803 | u174536291 | 2,000 | 262,144 | Alice and Bob are playing _One Card Poker_. One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between `1` and `13`, inclusive. The _strength_ of a card is determined by the number written on it, as follows: Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong One Card Poker is played as follows: 1. Each player picks one card from the deck. The chosen card becomes the player's hand. 2. The players reveal their hands to each other. The player with the stronger card wins the game. If their cards are equally strong, the game is drawn. You are watching Alice and Bob playing the game, and can see their hands. The number written on Alice's card is A, and the number written on Bob's card is B. Write a program to determine the outcome of the game. | ["a, b = list(map(int, input().split()))\nif a == 1:\n a = 14\nelse:\n break\nif b == 1:\n b = 14\nelse:\n break\nif a > b:\n print('Alice')\nelif a == b:\n print('Draw')\nelse:\n print('Bob')\n", "a, b = list(map(int, input().split()))\nif a == 1:\n a = 14\nelse:\n a = a\nif b == 1:\n b = 14\nelse:\n b = b\nif a > b:\n print('Alice')\nelif a == b:\n print('Draw')\nelse:\n print('Bob')\n"] | ['Runtime Error', 'Accepted'] | ['s263203449', 's058272503'] | [8980.0, 9060.0] | [28.0, 32.0] | [184, 184] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.