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
p02815
u270681687
2,000
1,048,576
For two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows: * Consider repeating the following operation on S so that S will be equal to T. f(S, T) is the minimum possible total cost of those operations. * Change S_i (from 0 to 1 or vice versa). The cost of this operation is D \times C_i, where D is the number of integers j such that S_j \neq T_j (1 \leq j \leq N) just before this change. There are 2^N \times (2^N - 1) pairs (S, T) of different sequences of length N consisting of 0 and 1. Compute the sum of f(S, T) over all of those pairs, modulo (10^9+7).
['n = int(input())\nc = list(map(int, input().split()))\n\nmod = 10**9 + 7\nc.sort()\nans = 0\n\nfor i in range(n):\n ans += c[i] * pow(2, i, mod) % mod * pow(2, n-i-1, mod) % mod * (n-i) % mod\n ans %= mod\n\nprint(ans)', 'n = int(input())\nc = list(map(int, input().split()))\n\nmod = 10**9 + 7\nc.sort()\nans = 0\n\nfor i in range(n):\n ans += c[i] * pow(2, i, mod) % mod * (pow(2, n-i-1, mod) * (n-i) + pow(2, n-i, mod) ) % mod * pow(2, n, mod) % mod\n ans %= mod\n\nprint(ans)', 'n = int(input())\nc = list(map(int, input().split()))\n\nmod = 10**9 + 7\nc.sort()\nans = 0\n\nfor i in range(n):\n ans += c[i] * pow(2, i, mod) % mod * (pow(2, n-i-2+n, mod) * (n-i-1) + pow(2, n-i-1+n, mod)) % mod\n ans %= mod\n\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s330153782', 's816908250', 's431928360']
[26800.0, 26024.0, 26800.0]
[996.0, 1774.0, 1451.0]
[213, 252, 368]
p02815
u389910364
2,000
1,048,576
For two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows: * Consider repeating the following operation on S so that S will be equal to T. f(S, T) is the minimum possible total cost of those operations. * Change S_i (from 0 to 1 or vice versa). The cost of this operation is D \times C_i, where D is the number of integers j such that S_j \neq T_j (1 \leq j \leq N) just before this change. There are 2^N \times (2^N - 1) pairs (S, T) of different sequences of length N consisting of 0 and 1. Compute the sum of f(S, T) over all of those pairs, modulo (10^9+7).
['import bisect\nimport cmath\nimport heapq\nimport itertools\nimport math\nimport operator\nimport os\nimport re\nimport string\nimport sys\nfrom collections import Counter, deque, defaultdict\nfrom copy import deepcopy\nfrom decimal import Decimal\nfrom fractions import gcd\nfrom functools import lru_cache, reduce\nfrom operator import itemgetter, mul, add, xor\n\nimport numpy as np\n\n# from libs.debug import debug\n\nif os.getenv("LOCAL"):\n sys.stdin = open("_in.txt", "r")\n\nsys.setrecursionlimit(10 ** 9)\nINF = float("inf")\nIINF = 10 ** 18\nMOD = 10 ** 9 + 7\n# MOD = 998244353\n\n\nN = int(sys.stdin.buffer.readline())\nC = list(map(int, sys.stdin.buffer.readline().split()))\nC.sort()\n\n#\n# @debug\n\n# S = np.array(S, dtype=bool)\n# T = np.array(T, dtype=bool)\n# C = np.array(C, dtype=int)\n# costs = np.msort(C[S != T])\n\n#\n#\n# def test(N, C):\n# ans = 0\n# for s in itertools.product([True, False], repeat=N):\n# for t in itertools.product([True, False], repeat=N):\n# ans += f(s, t, C)\n# ans %= MOD\n# print(ans)\n#\n#\n# test(N, C)\n\n\n# R[0] = 0\n# R[1] = 1\n# for r in range(2, N + 1):\n# for c in range(N):\n# R[r, c] = R[r - 1][:c].sum()\n# print(R)\n# print(R * np.arange(N + 1)[:, None])\n# print(R * np.arange(N + 1)[:, None] * (2 ** np.arange(N)[::-1]))\n# print(R * np.arange(N + 1)[:, None] * (2 ** np.arange(N)[::-1]) * np.msort(C)[::-1])\n# print((R * np.arange(N + 1)[:, None] * (2 ** np.arange(N)[::-1]) * np.msort(C)[::-1]).sum())\n# print((R * np.arange(N + 1)[:, None] * (2 ** np.arange(N)[::-1]) * np.msort(C)[::-1]).sum() * (2 ** N))\n#\n# print()\n# print(R * np.arange(N + 1)[:, None] * (2 ** np.arange(N)[::-1]))\n# print((R * np.arange(N + 1)[:, None] * (2 ** np.arange(N)[::-1])).sum(axis=0))\n# print(np.diff((R * np.arange(N + 1)[:, None] * (2 ** np.arange(N)[::-1])).sum(axis=0)))\n\narr = np.full(N + 1, 2 ** (N - 2))\narr = arr.cumsum()[1:]\narr %= MOD\n# print(arr)\nans = arr * np.msort(C)[::-1]\nprint(int(ans.sum() * pow(2, N, MOD)) % MOD)\n\n\n', 'import os\nimport sys\n\nif os.getenv("LOCAL"):\n sys.stdin = open("_in.txt", "r")\n\nsys.setrecursionlimit(10 ** 9)\nINF = float("inf")\nIINF = 10 ** 18\nMOD = 10 ** 9 + 7\n# MOD = 998244353\n\n\nN = int(sys.stdin.buffer.readline())\nC = list(map(int, sys.stdin.buffer.readline().split()))\nC.sort(reverse=True)\n\nassert pow(2, MOD - 2, MOD) == 500000004\n\n\ndef div2(a):\n return a % MOD * 500000004 % MOD\n\n\npow2 = [1]\nfor _ in range(N):\n pow2.append(pow2[-1] * 2 % MOD)\n\n\n# (1+x)^k = kC0 * x^0 + kC1 * x^1 + kC2 * x^2 + ... + kCk * x^k\n# (1+x)^k * x = kC0 * x^1 + kC1 * x^2 + kC2 * x^3 + ... + kCk * x^(k+1)\n\n# kC0 * 1 + kC1 * 2 + kC2 * 3 + ... + kCk * (k+1)\ndef df(k):\n \n # https://mathtrain.jp/composite\n \n # f(x) = 1+x\n # g(x) = x^k\n # h(x) = x\n # g(f(x)) * h(x) = (1+x)^k * x\n # f\'(x) = 1\n # g\'(x) = kx^(k-1)\n # h\'(x) = 1\n # g\'(f(x)) = g\'(f(x)) * f\'(x) = k(1+x)^(k-1)\n # (g(f(x)) * h(x))\' = g\'(f(x)) * h(x) + g(f(x)) * h\'(x)\n # = k(1+x)^(k-1) + (1+x)^k\n \n \n # = (k + 2) / 2 * 2^k\n return div2((k + 2) * pow2[k])\n\n\nans = 0\nfor k in range(N):\n \n ans += df(k) * C[k] * pow2[N - k - 1]\n ans %= MOD\nprint(ans * pow2[N] % MOD)\n']
['Runtime Error', 'Accepted']
['s209296515', 's222878349']
[32008.0, 23316.0]
[282.0, 421.0]
[2119, 1605]
p02815
u532966492
2,000
1,048,576
For two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows: * Consider repeating the following operation on S so that S will be equal to T. f(S, T) is the minimum possible total cost of those operations. * Change S_i (from 0 to 1 or vice versa). The cost of this operation is D \times C_i, where D is the number of integers j such that S_j \neq T_j (1 \leq j \leq N) just before this change. There are 2^N \times (2^N - 1) pairs (S, T) of different sequences of length N consisting of 0 and 1. Compute the sum of f(S, T) over all of those pairs, modulo (10^9+7).
['def main():\n n=int(input())\n a=list(map(int,input().split()))\n mod=10**9+7\n if n==1:\n print(2*a[0]%mod)\n return\n a.sort(key=lambda x:-x)\n mod=10**9+7\n ans=sum([a[i]*(i+2))%mod for i in range(n)])\n ans=ans*pow(2,n,mod)*pow(2,n-2,mod)%mod\n print(ans)\n\nmain()', 'def main():\n n=int(input())\n a=list(map(int,input().split()))\n mod=10**9+7\n if n==1:\n print(2*a[0]%mod)\n return\n a.sort(key=lambda x:-x)\n mod=10**9+7\n ans=sum([a[i]*(i+2)%mod for i in range(n)])\n ans=ans*pow(2,n,mod)*pow(2,n-2,mod)%mod\n print(ans)\n\nmain()']
['Runtime Error', 'Accepted']
['s121306050', 's483387012']
[2940.0, 27108.0]
[17.0, 222.0]
[297, 296]
p02815
u535803878
2,000
1,048,576
For two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows: * Consider repeating the following operation on S so that S will be equal to T. f(S, T) is the minimum possible total cost of those operations. * Change S_i (from 0 to 1 or vice versa). The cost of this operation is D \times C_i, where D is the number of integers j such that S_j \neq T_j (1 \leq j \leq N) just before this change. There are 2^N \times (2^N - 1) pairs (S, T) of different sequences of length N consisting of 0 and 1. Compute the sum of f(S, T) over all of those pairs, modulo (10^9+7).
['import sys\ninput = lambda : sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nwrite = lambda x: sys.stdout.write(x+"\\n")\n\n\npp = [None]*n\nv = 1\nfor i in range(n):\n pp[i] = v\n v *= 2\n v %= M\n \nn = int(input())\na = list(map(int, input().split()))\na.sort()\na = a[::-1]\nM = 10**9+7\nans = 0\nans += a[0]*(pow(2, 0, M))*pow(2, n-1,M)\nfor i in range(1,n):\n num = a[i]\n ans += num*(pp[i] + i*pp[i-1])*pp[n-i-1]\n ans %= M\nans *= pow(2,n,M)\nans %= M\nprint(ans)', 'import sys\ninput = lambda : sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nwrite = lambda x: sys.stdout.write(x+"\\n")\n\n\nn = int(input())\na = list(map(int, input().split()))\n\npp = [None]*n\nv = 1\nfor i in range(n):\n pp[i] = v\n v *= 2\n v %= M\n\na.sort()\na = a[::-1]\nM = 10**9+7\nans = 0\nans += a[0]*(pow(2, 0, M))*pow(2, n-1,M)\nfor i in range(1,n):\n num = a[i]\n ans += num*(pp[i] + i*pp[i-1])*pp[n-i-1]\n ans %= M\nans *= pow(2,n,M)\nans %= M\nprint(ans)', 'import sys\ninput = lambda : sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nwrite = lambda x: sys.stdout.write(x+"\\n")\n\n\nn = int(input())\na = list(map(int, input().split()))\nM = 10**9+7\n\npp = [None]*n\nv = 1\nfor i in range(n):\n pp[i] = v\n v *= 2\n v %= M\n\na.sort()\na = a[::-1]\nans = 0\nans += a[0]*(pow(2, 0, M))*pow(2, n-1,M)\nfor i in range(1,n):\n num = a[i]\n ans += num*(pp[i] + i*pp[i-1])*pp[n-i-1]\n ans %= M\nans *= pow(2,n,M)\nans %= M\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s116862569', 's560971060', 's304724754']
[3064.0, 26024.0, 26024.0]
[17.0, 73.0, 382.0]
[489, 486, 486]
p02815
u648881683
2,000
1,048,576
For two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows: * Consider repeating the following operation on S so that S will be equal to T. f(S, T) is the minimum possible total cost of those operations. * Change S_i (from 0 to 1 or vice versa). The cost of this operation is D \times C_i, where D is the number of integers j such that S_j \neq T_j (1 \leq j \leq N) just before this change. There are 2^N \times (2^N - 1) pairs (S, T) of different sequences of length N consisting of 0 and 1. Compute the sum of f(S, T) over all of those pairs, modulo (10^9+7).
['N = int(input())\nC = list(map(int, input().split()))\n\na = 10**9+7\nC = list(reversed(sorted(C)))\n\ncount = 0\n\n# N=1 1\n# N=2 2, 3\n# N=3 4, 6, 8\n# N=4 8, 12, 16, 20\nfor i in range(0, N):\n count += C[i] * (2**(N-1) + 2**(N-2) * i)\n count %= a\n\nprint(count * 2**N % a)', 'N = int(input())\nC = list(map(int, input().split()))\n\na = 10**9+7\nC = list(reversed(sorted(C)))\n\ncount = 0\n\n# N=1 1\n# N=2 2, 3\n# N=3 4, 6, 8\n# N=4 8, 12, 16, 20\nfor i in range(0, N):\n count += C[i] * (2**(N-1) + 2**(N-2) * i)\n\nprint(count * 2**N % a)', 'N = int(input())\nC = list(map(int, input().split()))\n\na = 10**9+7\nC = list(reversed(sorted(C)))\n\ncount = 0\n\n# N=1 1\n# N=2 2, 3\n# N=3 4, 6, 8\n# N=4 8, 12, 16, 20\nfor i in range(0, N):\n count += C[i] * (2+i)\n\nprint(count * 4**(N-1) % a)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s305827944', 's558449057', 's904084146']
[27108.0, 26024.0, 27108.0]
[2105.0, 2105.0, 203.0]
[286, 271, 255]
p02815
u736524428
2,000
1,048,576
For two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows: * Consider repeating the following operation on S so that S will be equal to T. f(S, T) is the minimum possible total cost of those operations. * Change S_i (from 0 to 1 or vice versa). The cost of this operation is D \times C_i, where D is the number of integers j such that S_j \neq T_j (1 \leq j \leq N) just before this change. There are 2^N \times (2^N - 1) pairs (S, T) of different sequences of length N consisting of 0 and 1. Compute the sum of f(S, T) over all of those pairs, modulo (10^9+7).
['N = int(input())\nC = list(map(int, input().split()))\n\nC.sort()\n\nans = 0\n\nfor i in range(N):\n ans += C[i] * (N + 1 - i) * (2 ** (N - 2))\n ans %= 10 ** 9 + 7\n\nans *= 2 ** N\nans %= 10 ** 9 + 7\n\nprint(ans)', 'N = int(input())\nC = list(map(int, input().split()))\n\nC.sort()\n\nans = 0\n\nfor i in range(N):\n ans += C[i] * (N + 1 - i) * (2 ** (N - 2))\n ans %= 10 ** 9 + 7\n\nprint(ans * (2 ** N))', 'N = int(input())\nC = list(map(int, input().split()))\n\nC.sort()\n\nans = 0\n\nmod = 10 ** 9 + 7\n\npattern = (2 ** (N - 2)) % mod\n\nif N != 1:\n for i in range(N):\n c = C[i]\n ans += c * (N + 1 - i) * pattern\n ans %= mod\n ans *= 2 ** N\nelse:\n ans = C[0] * 2\n\nans %= mod\n\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s085516014', 's552434168', 's470416690']
[26176.0, 26024.0, 25768.0]
[2104.0, 2104.0, 246.0]
[207, 184, 302]
p02815
u780475861
2,000
1,048,576
For two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows: * Consider repeating the following operation on S so that S will be equal to T. f(S, T) is the minimum possible total cost of those operations. * Change S_i (from 0 to 1 or vice versa). The cost of this operation is D \times C_i, where D is the number of integers j such that S_j \neq T_j (1 \leq j \leq N) just before this change. There are 2^N \times (2^N - 1) pairs (S, T) of different sequences of length N consisting of 0 and 1. Compute the sum of f(S, T) over all of those pairs, modulo (10^9+7).
['import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nn, *clst = map(int, read().split())\nclst.sort(reverse=1)\nres=0\nq=2**(n-1)\nfor i in clst:\n res+=i*q\n q+=2**(n-2)\nprint(2**n*res)', 'import sys\nread = sys.stdin.buffer.read\n\nmod = 10**9 + 7\nn, *clst = map(int, read().split())\nclst.sort()\nres = sum((n + 2 - i) * item for i, item in enumerate(clst, 1))\nprint((4**(n - 1) * res) % mod)']
['Wrong Answer', 'Accepted']
['s161416981', 's895989879']
[21996.0, 21948.0]
[2104.0, 177.0]
[246, 200]
p02815
u905582793
2,000
1,048,576
For two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows: * Consider repeating the following operation on S so that S will be equal to T. f(S, T) is the minimum possible total cost of those operations. * Change S_i (from 0 to 1 or vice versa). The cost of this operation is D \times C_i, where D is the number of integers j such that S_j \neq T_j (1 \leq j \leq N) just before this change. There are 2^N \times (2^N - 1) pairs (S, T) of different sequences of length N consisting of 0 and 1. Compute the sum of f(S, T) over all of those pairs, modulo (10^9+7).
['import sys\ninput = sys.stdin.readline\nn = int(input())\nmod = 10**9+7\na = list(map(int,input().split()))\na.sort()\nans = 0\nconst = pow(2,n,mod)\nif n == 1:\n print(a[0]*3)\n exit()\nfor i in range(n):\n ans = (ans + a[i]*const*(pow(2,n-1,mod)+pow(2,n-2,mod)*(n-i-1))%mod)%mod\nprint(ans)', 'import sys\ninput = sys.stdin.readline\nn = int(input())\nmod = 10**9+7\na = list(map(int,input().split()))\na.sort()\nans = 0\nconst = pow(2,n,mod)\nif n == 1:\n print(a[0]*2%mod)\n exit()\nfor i in range(n):\n ans = (ans + a[i]*const*(pow(2,n-1,mod)+pow(2,n-2,mod)*(n-i-1))%mod)%mod\nprint(ans)']
['Wrong Answer', 'Accepted']
['s266801413', 's142061717']
[27116.0, 27116.0]
[1049.0, 1049.0]
[282, 286]
p02815
u934868410
2,000
1,048,576
For two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows: * Consider repeating the following operation on S so that S will be equal to T. f(S, T) is the minimum possible total cost of those operations. * Change S_i (from 0 to 1 or vice versa). The cost of this operation is D \times C_i, where D is the number of integers j such that S_j \neq T_j (1 \leq j \leq N) just before this change. There are 2^N \times (2^N - 1) pairs (S, T) of different sequences of length N consisting of 0 and 1. Compute the sum of f(S, T) over all of those pairs, modulo (10^9+7).
['n = int(input())\nc = sorted(list(map(int, input().split())),reverse=True)\nmod = 10**9 + 7\nans = 0\ntwo = [1]\nfor i in range(n*2):\n two += [(two[i]*2) % mod]\n\nfor i in range(n):\n ans += (i+1) * c[i]\n ans %= mod\nans *= two[2*n - 2]\nprint(ans%mod)', 'n = int(input())\nc = sorted(list(map(int, input().split())),reverse=True)\nmod = 10**9 + 7\nans = 0\ntwo = [1]\nfor i in range(n*2):\n two += [(two[i]*2) % mod]\n\nfor i in range(n):\n ans += (i+2) * c[i]\n ans %= mod\nans *= two[2*n - 2]\nprint(ans%mod)']
['Wrong Answer', 'Accepted']
['s964999672', 's215790984']
[29420.0, 29420.0]
[358.0, 351.0]
[246, 246]
p02816
u152589615
2,000
1,048,576
Given are two sequences a=\\{a_0,\ldots,a_{N-1}\\} and b=\\{b_0,\ldots,b_{N-1}\\} of N non-negative integers each. Snuke will choose an integer k such that 0 \leq k < N and an integer x not less than 0, to make a new sequence of length N, a'=\\{a_0',\ldots,a_{N-1}'\\}, as follows: * a_i'= a_{i+k \mod N}\ XOR \ x Find all pairs (k,x) such that a' will be equal to b. What is \mbox{ XOR }? The XOR of integers A and B, A \mbox{ XOR } B, is defined as follows: * When A \mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise. For example, 3 \mbox{ XOR } 5 = 6. (In base two: 011 \mbox{ XOR } 101 = 110.)
['# coding: utf-8\n\ndef main():\n\n\tN = 0\n\ta = []\n\tb = []\n\twith open("C:/Users/admin/Downloads/random_05") as f:\n\t\tN = int(f.readline())\n\t\ta = [int(x) for x in f.readline().split()]\n\t\tb = [int(x) for x in f.readline().split()]\n\n\t# N = int(input())\n\t# a = [int(x) for x in input().split()]\n\t# b = [int(x) for x in input().split()]\n\n\txor_a = [a[i] ^ a[(i+1) % N] for i in range(len(a))]\n\txor_b = [b[i] ^ b[(i+1) % N] for i in range(len(b))]\n\n\tkmp = KmpSearch(xor_a + xor_a, xor_b)\n\n\t# start = 0\n\t# ans = []\n\t# x = []\n\t# while True:\n\t# \tk = kmp.search(start)\n\t\n\t# \t\tbreak\n\t# \t# ans.append(k)\n\t\n\t# \t# x.append(a[0 + k] ^ b[0])\n\n\t# \tprint(str(k) + " " + str(a[0 + k] ^ b[0]))\n\n\tans = kmp.full_search()\n\tfor k in ans:\n\t\tprint(str(k) + " " + str(a[0 + k] ^ b[0]))\n\t\n\t# \tprint(str(ans[i]) + " " + str(x[i]))\n\nclass KmpSearch:\n\tdef __init__(self, target, pattern):\n\t\tself.target = target\n\t\tself.pattern = pattern\n\t\tself.__table = self.__create_kmp_table()\n\n\tdef search(self, start=0):\n\t\tif len(self.pattern) > len(self.target):\n\t\t\treturn -1\n\n\t\ti = start\n\t\tp = 0\n\t\twhile i < len(self.target):\n\t\t\tif self.pattern[p] == self.target[i]:\n\t\t\t\ti += 1\n\t\t\t\tp += 1\n\n\t\t\t\tif p == len(self.pattern):\n\t\t\t\t\treturn i - p\n\t\t\telif p == 0:\n\t\t\t\ti += 1\n\t\t\telse:\n\t\t\t\tp = self.__table[p]\n\n\t\treturn -1\n\n\tdef full_search(self):\n\t\tif len(self.pattern) > len(self.target):\n\t\t\treturn -1\n\n\t\tres = []\n\t\ti = 0\n\t\tp = 0\n\t\twhile i < len(self.target):\n\t\t\tif self.pattern[p] == self.target[i]:\n\t\t\t\ti += 1\n\t\t\t\tp += 1\n\n\t\t\t\tif p == len(self.pattern):\n\t\t\t\t\tres.append(i-p)\n\t\t\t\t\ti -= 1\n\t\t\t\t\tp = self.__table[p-1]\n\t\t\telif p == 0:\n\t\t\t\ti += 1\n\t\t\telse:\n\t\t\t\tp = self.__table[p]\n\n\t\treturn res\n\n\tdef __create_kmp_table(self):\n\t\ttable = [0 for x in range(len(self.pattern))]\n\n\t\tj = 0\n\t\tfor i in range(1, len(self.pattern)):\n\t\t\ttable[i] = j\n\t\t\tif self.pattern[j] == self.pattern[i]:\n\t\t\t\tj += 1\n\t\t\telse:\n\t\t\t\tj = 0\n\n\t\treturn table\n\nif __name__ == "__main__":\n\tmain()', '# coding: utf-8\n\ndef main():\n\n\tN = 0\n\ta = []\n\tb = []\n\twith open("C:/Users/admin/Downloads/random_05") as f:\n\t\tN = int(f.readline())\n\t\ta = [int(x) for x in f.readline().split()]\n\t\tb = [int(x) for x in f.readline().split()]\n\n\t# N = int(input())\n\t# a = [int(x) for x in input().split()]\n\t# b = [int(x) for x in input().split()]\n\n\txor_a = [a[i] ^ a[(i+1) % N] for i in range(len(a))]\n\txor_b = [b[i] ^ b[(i+1) % N] for i in range(len(b))]\n\n\tkmp = KmpSearch(xor_a + xor_a, xor_b)\n\n\t# start = 0\n\t# ans = []\n\t# x = []\n\t# while True:\n\t# \tk = kmp.search(start)\n\t\n\t# \t\tbreak\n\t# \t# ans.append(k)\n\t\n\t# \t# x.append(a[0 + k] ^ b[0])\n\n\t# \tprint(str(k) + " " + str(a[0 + k] ^ b[0]))\n\n\tans = kmp.full_search()\n\tfor k in ans:\n\t\tprint(str(k) + " " + str(a[0 + k] ^ b[0]))\n\t\n\t# \tprint(str(ans[i]) + " " + str(x[i]))\n\nclass KmpSearch:\n\tdef __init__(self, target, pattern):\n\t\tself.target = target\n\t\tself.pattern = pattern\n\t\tself.__table = self.__create_kmp_table()\n\n\tdef search(self, start=0):\n\t\tif len(self.pattern) > len(self.target):\n\t\t\treturn -1\n\n\t\ti = start\n\t\tp = 0\n\t\twhile i < len(self.target):\n\t\t\tif self.pattern[p] == self.target[i]:\n\t\t\t\ti += 1\n\t\t\t\tp += 1\n\n\t\t\t\tif p == len(self.pattern):\n\t\t\t\t\treturn i - p\n\t\t\telif p == 0:\n\t\t\t\ti += 1\n\t\t\telse:\n\t\t\t\tp = self.__table[p]\n\n\t\treturn -1\n\n\tdef full_search(self):\n\t\tif len(self.pattern) > len(self.target):\n\t\t\treturn -1\n\n\t\tres = []\n\t\ti = 0\n\t\tp = 0\n\t\twhile i < len(self.target):\n\t\t\tif self.pattern[p] == self.target[i]:\n\t\t\t\ti += 1\n\t\t\t\tp += 1\n\n\t\t\t\tif p == len(self.pattern):\n\t\t\t\t\tres.append(i-p)\n\t\t\t\t\ti -= 1\n\t\t\t\t\tp = self.__table[p-1]\n\t\t\telif p == 0:\n\t\t\t\ti += 1\n\t\t\telse:\n\t\t\t\tp = self.__table[p]\n\n\t\treturn res\n\n\tdef __create_kmp_table(self):\n\t\ttable = [0 for x in range(len(self.pattern))]\n\n\t\tj = 0\n\t\tfor i in range(1, len(self.pattern)):\n\t\t\ttable[i] = j\n\t\t\tif self.pattern[j] == self.pattern[i]:\n\t\t\t\tj += 1\n\t\t\telse:\n\t\t\t\tj = 0\n\n\t\treturn table\n\nif __name__ == "__main__":\n\tmain()', '# coding: utf-8\n\ndef main():\n\n\t# N = 0\n\t# a = []\n\t# b = []\n\t# with open("C:/Users/admin/Downloads/random_05") as f:\n\t# \tN = int(f.readline())\n\t# \ta = [int(x) for x in f.readline().split()]\n\t# \tb = [int(x) for x in f.readline().split()]\n\n\tN = int(input())\n\ta = [int(x) for x in input().split()]\n\tb = [int(x) for x in input().split()]\n\n\txor_a = [a[i] ^ a[(i+1) % N] for i in range(len(a))]\n\txor_b = [b[i] ^ b[(i+1) % N] for i in range(len(b))]\n\n\tkmp = KmpSearch(xor_a + xor_a, xor_b)\n\n\tans = kmp.full_search()\n\tfor k in ans:\n\t\tif k == len(a):\n\t\t\tbreak\n\t\tprint(str(k) + " " + str(a[0 + k] ^ b[0]))\n\nclass KmpSearch:\n\tdef __init__(self, target, pattern):\n\t\tself.target = target\n\t\tself.pattern = pattern\n\t\tself.__table = self.__create_kmp_table()\n\n\tdef full_search(self):\n\t\tif len(self.pattern) > len(self.target):\n\t\t\treturn -1\n\n\t\tres = []\n\t\ti = 0\n\t\tp = 0\n\t\twhile i < len(self.target):\n\t\t\tif self.pattern[p] == self.target[i]:\n\t\t\t\ti += 1\n\t\t\t\tp += 1\n\n\t\t\t\tif p == len(self.pattern):\n\t\t\t\t\tres.append(i-p)\n\t\t\t\t\ti -= 1\n\t\t\t\t\tp = self.__table[p-1]\n\t\t\telif p == 0:\n\t\t\t\ti += 1\n\t\t\telse:\n\t\t\t\tp = self.__table[p]\n\n\t\treturn res\n\n\tdef __create_kmp_table(self):\n\t\ttable = [0 for x in range(len(self.pattern))]\n\n\t\tj = 0\n\t\tfor i in range(1, len(self.pattern)):\n\t\t\ttable[i] = j\n\t\t\tif self.pattern[j] == self.pattern[i]:\n\t\t\t\tj += 1\n\t\t\telse:\n\t\t\t\tj = 0\n\n\t\treturn table\n\nif __name__ == "__main__":\n\tmain()']
['Runtime Error', 'Runtime Error', 'Accepted']
['s160361737', 's246433070', 's578983839']
[3192.0, 3192.0, 44752.0]
[18.0, 18.0, 805.0]
[1972, 1972, 1378]
p02816
u532966492
2,000
1,048,576
Given are two sequences a=\\{a_0,\ldots,a_{N-1}\\} and b=\\{b_0,\ldots,b_{N-1}\\} of N non-negative integers each. Snuke will choose an integer k such that 0 \leq k < N and an integer x not less than 0, to make a new sequence of length N, a'=\\{a_0',\ldots,a_{N-1}'\\}, as follows: * a_i'= a_{i+k \mod N}\ XOR \ x Find all pairs (k,x) such that a' will be equal to b. What is \mbox{ XOR }? The XOR of integers A and B, A \mbox{ XOR } B, is defined as follows: * When A \mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise. For example, 3 \mbox{ XOR } 5 = 6. (In base two: 011 \mbox{ XOR } 101 = 110.)
['def main():\n mod, pow3, p = 2**31-1, [1]*200001, 1\n i3 = pow(3, mod-2, mod)\n for i in range(1, 200001):\n pow3[i] = p = p*3 % mod\n\n def rolling_hash(seq):\n h = sum([(i+1)*j for i, j in zip(seq, pow3[:-1])]) % mod\n H0s = [0]*n\n for i, j in enumerate(seq):\n H0s[i] = h\n h = (h-j-1+(j+1)*pn)*i3 % mod\n return H0s\n\n n = int(input())\n a, b = list(map(int, input().split())), list(map(int, input().split()))\n pn, memo = pow3[n], []\n\n a1 = [a[i-1] ^ a[i] for i in range(n)]\n b1 = [b[i-1] ^ b[i] for i in range(n)]\n b_hash = sum([(i+1)*j for i, j in zip(b1, pow3[:-1])]) % mod\n A1 = rolling_hash(a1)\n for i, j in enumerate(A1):\n if j == b_hash:\n memo.append(i)\n a0 = a1[0]\n for i in memo:\n x = a0 ^ b1[i]\n print(i, x)\n\n\nmain()', 'def main():\n class rolling_hash():\n def __init__(self, sequence):\n self.sequence = sequence \n self.seq_size = len(self.sequence) の長さ\n self.mod = 2**61-1 # mod\n self.base = 3 \n self.Hash_0start = [0]*(self.seq_size+1) \n for i in range(self.seq_size):\n self.Hash_0start[i+1] = self.Hash_0start[i] + \\\n (self.sequence[i]+1)*pow(self.base, i, self.mod)\n\n def calc_hash(self, l, r): \n return ((self.Hash_0start[r] - self.Hash_0start[l])\n * pow(self.base, l*(self.mod-2), self.mod)) % self.mod\n\n n = int(input())\n a, b = list(map(int, input().split())), list(map(int, input().split()))\n memo = []\n\n a1 = rolling_hash([a[i-1] ^ a[i] for i in range(n)] +\n [a[i-1] ^ a[i] for i in range(n)])\n b_hash = rolling_hash([b[i-1] ^ b[i] for i in range(n)]).calc_hash(0, n)\n for i in range(n):\n if a1.calc_hash(i, i+n) == b_hash:\n memo.append(i)\n b0 = b[0]\n for i in memo:\n x = b0 ^ a[i]\n print(i, x)\n\n\nmain()', 'def main():\n def z_algo(S):\n n, i, j = len(S), 1, 0\n a = [0]*n\n a[0] = n\n while i < n:\n while i+j < n and S[i+j] == S[j]:\n j += 1\n if not j:\n i += 1\n continue\n a[i], k = j, 1\n while a[k] < j-k and i+k < n:\n a[i+k] = a[k]\n k += 1\n i += k\n j -= k\n return a\n\n n = int(input())\n a, b = list(map(int, input().split())), list(map(int, input().split()))\n a1 = [a[i-1] ^ a[i] for i in range(n)]\n z = z_algo([b[i-1] ^ b[i] for i in range(n)]+a1+a1)\n memo = []\n for i in range(n):\n if z[n+i] >= n:\n memo.append(i)\n b0 = b[0]\n for i in memo:\n print(i, b0 ^ a[i])\n\n\nmain()']
['Wrong Answer', 'Time Limit Exceeded', 'Accepted']
['s357266146', 's381482252', 's469366384']
[51272.0, 72356.0, 55820.0]
[535.0, 2108.0, 670.0]
[848, 1274, 788]
p02816
u663230781
2,000
1,048,576
Given are two sequences a=\\{a_0,\ldots,a_{N-1}\\} and b=\\{b_0,\ldots,b_{N-1}\\} of N non-negative integers each. Snuke will choose an integer k such that 0 \leq k < N and an integer x not less than 0, to make a new sequence of length N, a'=\\{a_0',\ldots,a_{N-1}'\\}, as follows: * a_i'= a_{i+k \mod N}\ XOR \ x Find all pairs (k,x) such that a' will be equal to b. What is \mbox{ XOR }? The XOR of integers A and B, A \mbox{ XOR } B, is defined as follows: * When A \mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise. For example, 3 \mbox{ XOR } 5 = 6. (In base two: 011 \mbox{ XOR } 101 = 110.)
['\ndef get_next_int():\n return int(float(input()))\ndef get_next_ints(delim=" "):\n return tuple([int(float(x)) for x in input().split(delim)])\ndef main():\n n = get_next_int()\n \n a = get_next_ints()\n b = get_next_ints()\n \n a_offsets = []\n b_offsets = []\n for i in range(n):\n a_offsets.append(str(a[i] ^ a[i-1]))\n b_offsets.append(str(b[i] ^ b[i-1]))\n #print(a_offsets)\n #print(b_offsets)\n a_text = " ".join(a_offsets)\n b_text = " ".join(b_offsets)\n target_text = a_text + " " + a_text\n \n start = 0\n while target_text.find(b_text, start) >= 0 and start <= len(a_text):\n start = target_text.find(b_text, start)\n #print(start)\n pos_diff = s[:start].count(" ")\n xor_diff = b[0] ^ a[pos_diff]\n print(pos_diff, xor_diff) \n start = start + 2\n \n \n\nif __name__ == \'__main__\':\n main()\nif __name__ == \'__jupyter__\':\n import doctest\n print(doctest.testmod())', 'def get_next_int():\n return int(input().rstrip("\\n"))\ndef get_next_ints(delim=" "):\n return tuple([int(x) for x in input().rstrip("\\n").split(delim)])\ndef main():\n n = get_next_int()\n \n a = get_next_ints()\n b = get_next_ints()\n \n a_offsets = []\n b_offsets = []\n for i in range(n):\n a_offsets.append(str(a[i] ^ a[i-1]))\n b_offsets.append(str(b[i] ^ b[i-1]))\n #print(a_offsets)\n #print(b_offsets)\n a_text = " ".join(a_offsets)\n b_text = " ".join(b_offsets)\n target_text = a_text + " " + a_text\n \n start = 0\n while target_text.find(b_text, start) >= 0 and start < len(a_text):\n start = target_text.find(b_text, start)\n #print(start)\n pos_diff = s[:start].count(" ")\n xor_diff = b[0] ^ a[pos_diff]\n print(pos_diff, xor_diff) \n start = start + 2\n\nif __name__ == \'__main__\':\n main()\n ', 'def get_next_int():\n return int(input().rstrip("\\n"))\n\n\ndef get_next_ints(delim=" "):\n return tuple([int(x) for x in input().rstrip("\\n").split(delim)])\n\n\ndef main():\n n = get_next_int()\n\n a = get_next_ints()\n b = get_next_ints()\n\n a_offsets = []\n b_offsets = []\n for i in range(n):\n a_offsets.append(str(a[i] ^ a[i - 1]))\n b_offsets.append(str(b[i] ^ b[i - 1]))\n #print(a_offsets)\n #print(b_offsets)\n a_text = " ".join(a_offsets)\n b_text = " ".join(b_offsets)\n target_text = a_text + " " + a_text\n start_pos = 0\n if target_text.find(b_text, start_pos) >= 0:\n fisrt_pos = target_text.find(b_text, start_pos)\n fisrt_pos_diff = target_text[:fisrt_pos].count(" ")\n fisrt_xor_diff = b[0] ^ a[fisrt_pos_diff]\n print(fisrt_pos_diff, fisrt_xor_diff)\n if target_text.find(b_text, fisrt_pos+1) >= 0:\n second_pos = target_text.find(b_text, fisrt_pos+1)\n second_pos_diff = target_text[:second_pos].count(" ")\n if second_pos_diff < len(a):\n second_xor_diff = b[0] ^ a[second_pos_diff]\n print(second_pos_diff, second_xor_diff)\n interval = (second_pos_diff - fisrt_pos_diff)\n remain = (n - second_pos_diff - 1) // (second_pos_diff - fisrt_pos_diff)\n for i in range(remain):\n print(second_pos_diff + interval * (i + 1), [fisrt_xor_diff,second_xor_diff ][i % 2])\n\nif __name__ == \'__main__\':\n main()\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s313531733', 's495428880', 's539119650']
[55688.0, 55816.0, 54356.0]
[336.0, 275.0, 547.0]
[974, 901, 1507]
p02816
u817041478
2,000
1,048,576
Given are two sequences a=\\{a_0,\ldots,a_{N-1}\\} and b=\\{b_0,\ldots,b_{N-1}\\} of N non-negative integers each. Snuke will choose an integer k such that 0 \leq k < N and an integer x not less than 0, to make a new sequence of length N, a'=\\{a_0',\ldots,a_{N-1}'\\}, as follows: * a_i'= a_{i+k \mod N}\ XOR \ x Find all pairs (k,x) such that a' will be equal to b. What is \mbox{ XOR }? The XOR of integers A and B, A \mbox{ XOR } B, is defined as follows: * When A \mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise. For example, 3 \mbox{ XOR } 5 = 6. (In base two: 011 \mbox{ XOR } 101 = 110.)
['\nCopy\nCopy\na = int(input())\nif a == 2:\n a1, a2 = map(int, input().split())\n b1, b2 = map(int, input().split())\n print()\nelif a == 3:\n a1, a2, a3 = map(int, input().split())\n b1, b2, b3 = map(int, input().split())\n print(1,3)\nelif a == 5:\n a1, a2, a3, a4, a5 = map(int, input().split())\n b1, b2, b3, b4, b5 = map(int, input().split())\n print(a1,a2)\n print(a1+1,a2)\n print(a1+2,a2)\n print(a1+3,a2)\n print(a1+4,a2)\nelif a == 6:\n a1, a2, a3, a4, a5, a6 = map(int, input().split())\n b1, b2, b3, b4, b5, b6 = map(int, input().split())\n print(2,2)\n print(5,5)\n', "import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\n\n\n\nN = int(readline())\n\nA = list(map(int,readline().split()))\nB = list(map(int,readline().split()))\n\ndef convert(A):\n return [x ^ y for x,y in zip(A,A[1:])] + [A[-1] ^ A[0]]\n\nC = convert(A); D = convert(B)\n\ndef Z_algorithm(S):\n \n N=len(S)\n arr = [0]*N\n arr[0] = N\n i,j = 1,0\n while i<N:\n while i+j<N and S[j]==S[i+j]:\n j += 1\n arr[i]=j\n if not j:\n i += 1\n continue\n k = 1\n while i+k<N and k+arr[k]<j:\n arr[i+k] = arr[k]\n k += 1\n i += k; j -= k\n return arr\n\nZ = Z_algorithm(D + [-1] + C + C)[N+1:N+N+1]\n\nK = [i for i,x in enumerate(Z) if x == N]\nX = [A[k] ^ B[0] for k in K]\n\nprint('\\n'.join('{} {}'.format(k,x) for k,x in zip(K,X)))\n"]
['Runtime Error', 'Accepted']
['s903629155', 's672052453']
[3064.0, 67024.0]
[18.0, 681.0]
[605, 973]
p02816
u922449550
2,000
1,048,576
Given are two sequences a=\\{a_0,\ldots,a_{N-1}\\} and b=\\{b_0,\ldots,b_{N-1}\\} of N non-negative integers each. Snuke will choose an integer k such that 0 \leq k < N and an integer x not less than 0, to make a new sequence of length N, a'=\\{a_0',\ldots,a_{N-1}'\\}, as follows: * a_i'= a_{i+k \mod N}\ XOR \ x Find all pairs (k,x) such that a' will be equal to b. What is \mbox{ XOR }? The XOR of integers A and B, A \mbox{ XOR } B, is defined as follows: * When A \mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise. For example, 3 \mbox{ XOR } 5 = 6. (In base two: 011 \mbox{ XOR } 101 = 110.)
['N = int(input())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\nC = [a1^a2 for a1, a2 in zip(A, A[1:])] + [A[0]^A[-1]]\nC = C + C\nD = [b1^b2 for b1, b2 in zip(B, B[1:])] + [B[0]^B[-1]]\n\nprint(C)\nprint(D)\n\nK = []\nk = 0\nwhile k < N:\n next_k = k\n is_first = True\n for i in range(N):\n if is_first and i>0 and C[k+i]==D[0]:\n next_k = k + i\n is_first = False\n if C[k+i] != D[i]:\n if next_k == k:\n k = k + i + 1\n else:\n if D[k+i-next_k] == C[k+i]:\n k = next_k\n else:\n k = k + i + 1\n break\n \n if i == N-1:\n K.append(k)\n if next_k == k:\n break\n else:\n k = next_k\n if len(K) == 2:\n diff = K[1] - K[0]\n while K[-1] < N:\n K.append(K[-1]+diff)\n \n _ = K.pop()\n break\n\nfor k in K:\n print(k, A[k]^B[0])', 'N = int(input())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\n\nC = [a1^a2 for a1, a2 in zip(A, A[1:])] + [A[0]^A[-1]]\nC = C + C\nD = [b1^b2 for b1, b2 in zip(B, B[1:])] + [B[0]^B[-1]]\n\nK = []\nk = 0\nwhile k < N:\n next_k = k\n is_first = True\n for i in range(N):\n if is_first and i>0 and C[k+i]==D[0]:\n next_k = k + i\n is_first = False\n if C[k+i] != D[i]:\n if next_k == k:\n k = k + i + 1\n else:\n if D[k+i-next_k] == C[k+i]:\n k = next_k\n else:\n k = k + i + 1\n break\n \n if i == N-1:\n K.append(k)\n if next_k == k:\n break\n else:\n k = next_k\n if len(K) == 2:\n diff = K[1] - K[0]\n while K[-1] < N:\n K.append(K[-1]+diff)\n \n _ = K.pop()\n break\n\nfor k in K:\n print(k, A[k]^B[0])']
['Wrong Answer', 'Accepted']
['s091931165', 's404961801']
[49740.0, 36560.0]
[569.0, 503.0]
[853, 834]
p02816
u927078824
2,000
1,048,576
Given are two sequences a=\\{a_0,\ldots,a_{N-1}\\} and b=\\{b_0,\ldots,b_{N-1}\\} of N non-negative integers each. Snuke will choose an integer k such that 0 \leq k < N and an integer x not less than 0, to make a new sequence of length N, a'=\\{a_0',\ldots,a_{N-1}'\\}, as follows: * a_i'= a_{i+k \mod N}\ XOR \ x Find all pairs (k,x) such that a' will be equal to b. What is \mbox{ XOR }? The XOR of integers A and B, A \mbox{ XOR } B, is defined as follows: * When A \mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise. For example, 3 \mbox{ XOR } 5 = 6. (In base two: 011 \mbox{ XOR } 101 = 110.)
["def xor_next(values):\n result = [0] * len(values)\n for i in range(len(values)):\n result[i] = values[i] ^ values[(i+1) % len(values)]\n return result\n\n\ndef make_mp_table(values):\n result = [-1] * (len(values) + 1)\n j = -1\n for i in range(len(values)):\n while j != -1 and values[j] != values[i]:\n j = result[j]\n j += 1\n result[i+1] = j\n return result\n\n\ndef mp_find(target, pattern, table):\n result = []\n j = 0\n for i in range(len(target)):\n while(j != -1 and pattern[j] != target[i]):\n j = table[j]\n j += 1\n if j == len(pattern):\n result.append(i-(j-1))\n j = table[j]\n return result\n\n\ndef main():\n n = int(input())\n a = list(map(int, input().split()))\n b = list(map(int, input().split()))\n\n xa = xor_next(a)\n xb = xor_next(b)\n mp_t = make_mp_table(xa)\n xb += xb\n res = mp_find(xb, xa, mp_t)\n print(res)\n res.sort(reverse=True)\n for i in range(len(res)):\n k = n-res[i]\n if(k >= n):\n continue\n x = a[k] ^ b[0]\n print(str(k) + ' ' + str(x))\n\n\nmain()\n", "def xor_next(values):\n result = [0] * len(values)\n for i in range(len(values)):\n result[i] = values[i] ^ values[(i+1) % len(values)]\n return result\n\n\ndef make_mp_table(values):\n result = [-1] * (len(values) + 1)\n j = -1\n for i in range(len(values)):\n while j != -1 and values[j] != values[i]:\n j = result[j]\n j += 1\n result[i+1] = j\n return result\n\n\ndef mp_find(target, pattern, table):\n result = []\n j = 0\n for i in range(len(target)):\n while(j != -1 and pattern[j] != target[i]):\n j = table[j]\n j += 1\n if j == len(pattern):\n result.append(i-(j-1))\n j = table[j]\n return result\n\n\ndef main():\n n = int(input())\n a = list(map(int, input().split()))\n b = list(map(int, input().split()))\n\n xa = xor_next(a)\n xb = xor_next(b)\n mp_t = make_mp_table(xa)\n xb += xb\n res = mp_find(xb, xa, mp_t)\n res.sort(reverse=True)\n for i in range(len(res)):\n k = n-res[i]\n if(k >= n):\n continue\n x = a[k] ^ b[0]\n print(str(k) + ' ' + str(x))\n\n\nmain()\n"]
['Wrong Answer', 'Accepted']
['s092081913', 's280836678']
[49016.0, 44408.0]
[600.0, 595.0]
[1142, 1127]
p02817
u000557170
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['# -*- coding: utf-8 -*-\n\nimport sys\nimport math\n\n\ndebug = False\n\ndef log(text):\n if debug:\n print(text)\n\ndef parse_input(lines_as_string = None):\n\n global debug\n lines = []\n if lines_as_string is None:\n debug = False\n # for line in sys.stdin:\n # lines.append(line)\n lines.append(input())\n else:\n debug = True\n lines = [e for e in lines_as_string.split("\\n")][1:-1]\n\n (s, t) = [e for e in lines[0].split(" ")]\n\n return (s, t)\n\n\ndef solve(s, t):\n\n\n return s + t\n\n\ndef main():\n \n result = solve(*parse_input())\n if isinstance(result, list):\n for r in result:\n print("%s" % r, sep=\'\')\n else:\n print("%s" % result, sep=\'\')\n\nif __name__ == \'__main__\':\n\n main()\n\t', '# -*- coding: utf-8 -*-\n\nimport sys\nimport math\n\n\ndebug = False\n\ndef log(text):\n if debug:\n print(text)\n\ndef parse_input(lines_as_string = None):\n\n global debug\n lines = []\n if lines_as_string is None:\n debug = False\n # for line in sys.stdin:\n # lines.append(line)\n lines.append(input())\n else:\n debug = True\n lines = [e for e in lines_as_string.split("\\n")][1:-1]\n\n (s, t) = [e for e in lines[0].split(" ")]\n\n return (s, t)\n\n\ndef solve(s, t):\n\n\n return t + s\n\n\ndef main():\n \n result = solve(*parse_input())\n if isinstance(result, list):\n for r in result:\n print("%s" % r, sep=\'\')\n else:\n print("%s" % result, sep=\'\')\n\nif __name__ == \'__main__\':\n\n main()\n\t']
['Wrong Answer', 'Accepted']
['s016298690', 's755600185']
[3064.0, 3064.0]
[17.0, 18.0]
[781, 781]
p02817
u000722083
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S_T = str(input())\nS = S_T.split(" ")[0]\nT = S_T.split(" ")[1]\nprint(T, S)\n', 'S_T = str(input())\nS = S_T.split(" ")[0]\nT = S_T.split(" ")[1]\nprint(T + S)\n\n']
['Wrong Answer', 'Accepted']
['s506189682', 's093082090']
[2940.0, 2940.0]
[17.0, 17.0]
[75, 77]
p02817
u000840710
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['a,b,k = (int(x) for x in input().split())\n\nif k >= a :\n if k >= b :\n if a + b >= k :\n a1 = 0\n b1 = b - k + a\n else :\n a1 = 0\n b1 = 0\n else :\n a1 = 0\n b1 = b - k + a\nelse :\n a1 = a - k\n b1 = b\n\nprint(a1,b1)', 'str1,str2 = input().split()\nstr3 = str2 + str1 \nprint(str3)']
['Runtime Error', 'Accepted']
['s791616112', 's390981146']
[3060.0, 2940.0]
[18.0, 17.0]
[241, 59]
p02817
u003019316
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["print(''.join(input().split()))", 'S, T = input().split()\nprint(T + S)']
['Wrong Answer', 'Accepted']
['s166676237', 's497425195']
[2940.0, 2940.0]
[19.0, 17.0]
[31, 35]
p02817
u004676431
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s = int(input())\nt = int(input())\nprint(t+s)', 's = input().split()\nprint(s[1]+s[0])']
['Runtime Error', 'Accepted']
['s677928856', 's783850350']
[2940.0, 2940.0]
[17.0, 17.0]
[44, 37]
p02817
u005782050
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s,t=input().split()\nprint=(t+S)', 's,t=input().split()\nprint(t+s)']
['Runtime Error', 'Accepted']
['s671820238', 's212412995']
[2940.0, 2940.0]
[17.0, 17.0]
[31, 30]
p02817
u007550226
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s=input()\nt=input()\nprint(t+s)', 's=input().split()\nprint(s[1]+s[0])']
['Runtime Error', 'Accepted']
['s252266685', 's886447961']
[2940.0, 2940.0]
[17.0, 17.0]
[30, 34]
p02817
u010178026
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s, t = input().split()\nprint(s+t)', 'a, b, k = map(int, input().split())\nif a >= k:\n a -= k\nelif a < k and a + b >= k:\n b = b - (k-a)\n a = 0\nelse:\n a = 0\n b = 0\nprint(a, b)', 'a, b, k = map(int, input().split())\nif a >= k:\n a -= k\nelif a + b >= k:\n b = b - (k-a)\n a = 0\nelse:\n a = 0\n b = 0\nprint(a, b)', 's, t = input().split()\nprint(t+s)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s273424742', 's459709354', 's929194935', 's472648533']
[2940.0, 2940.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0, 18.0]
[33, 150, 140, 33]
p02817
u010566167
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S = inout()\nT = input()\n\nprint(T + S)', 'S,T = input().split()\n\nprint(T + S)']
['Runtime Error', 'Accepted']
['s710641402', 's252566774']
[2940.0, 2940.0]
[17.0, 17.0]
[37, 35]
p02817
u013202780
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["print (''.join(input().split()))", "print (input().replace(' ',''))", 'x,y=input().split()\nprint (y+x)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s071159147', 's252526225', 's614022233']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[32, 31, 31]
p02817
u014333473
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["print(*input().split(),sep='')", "print(*input().split()[::-1],sep='')"]
['Wrong Answer', 'Accepted']
['s873237025', 's931117994']
[8996.0, 8852.0]
[23.0, 21.0]
[30, 36]
p02817
u015593272
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['def print_character(str1, str2):\n str outputWord\n outputWord = str1 + str2\n return(outputWord)\n', 'str1, str2 = input().strip()\n\nprint("".join((str1,str2)))', 'Str1, str2 = input().split()\nprint(str1+str2)', ' def print_character(str1, str2):\n str outputWord\n outputWord = str1 + str2\n print(outputWord)', 's = input()\nls = s.split()\nprint(ls[1] + ls[0])']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s106006836', 's276748621', 's334910233', 's906975974', 's371731051']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[98, 57, 45, 112, 47]
p02817
u016568601
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['A, B, K = map(int, input().split())\n\nif A >= K:\n A = A - K\n print(A, B)\n\nelif A + B >= K:\n B = A + B - K\n print(0, B)\n \nelse:\n print(0,0)', 'S, T = input().split()\nprint(T + S)']
['Runtime Error', 'Accepted']
['s866142329', 's884588827']
[3060.0, 2940.0]
[18.0, 17.0]
[145, 35]
p02817
u017624958
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['inputted = input().split()\nS = inputted[0] \nT = inputted[1]\n\nanswer = S + T\n\nprint(answer)\n', 'inputted = input().split()\nS = inputted[0] \nT = inputted[1]\n\nanswer = T + S\n\nprint(answer)\n']
['Wrong Answer', 'Accepted']
['s038946945', 's074897122']
[2940.0, 2940.0]
[17.0, 17.0]
[92, 91]
p02817
u018679195
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S = input()\nT = input()\nprint(T+S)\n#\n#\n#################################', "if __name__ == '__main__':\n S = input()\n T = input()\n print(T+S)", 'def stringconcant(S,T):\n a = S\n b = T\n c = a+b\n return c\n\nS= input()\nT= input()\na = stringconcant(S,T)\nprint(a)', '#---Strings\nS, T = map(str, input().split(" "))\nprint(T, S, sep="")\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s078741421', 's433456161', 's465507072', 's008332210']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[72, 73, 123, 68]
p02817
u020798319
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S, T= map(str, input().split())\nprint(S + T)', 'S , T = map(str, input().split())\nprint(T + S)']
['Wrong Answer', 'Accepted']
['s895830913', 's765613897']
[9048.0, 8996.0]
[28.0, 26.0]
[44, 46]
p02817
u020812754
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S, T = input().split()\nprint([T, S].join())', "S, T = (input().split())\n#print(S, T)\nprint(''.join([T, S]))"]
['Runtime Error', 'Accepted']
['s220397740', 's324510054']
[2940.0, 2940.0]
[17.0, 17.0]
[43, 60]
p02817
u021849254
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['a=input()\nb=input()\nprint(b+a)', 'a,b=map(str,input().split())\nprint(b+a)']
['Runtime Error', 'Accepted']
['s002762518', 's912659484']
[8948.0, 8948.0]
[26.0, 26.0]
[30, 39]
p02817
u022871813
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s, t = input().split()\nprint(s + t)\n', 's, t = input().split()\nprint(t + s)\n']
['Wrong Answer', 'Accepted']
['s058702944', 's977648684']
[2940.0, 2940.0]
[17.0, 17.0]
[36, 36]
p02817
u024450350
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["print(input().replace(' ', ''))", 's, t = input().split()\nprint(s + t)\n', 's, t = input().split()\nprint(t + s)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s245436241', 's976947369', 's316930006']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0]
[31, 36, 36]
p02817
u025287757
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['A, B, K = map(int, input().split())\nif K <= A:\n print(*[A-K, B])\nelif K <= A + B:\n print(*[0, B-(K-A)])\nelse:\n print(*[0, 0])\n', 'T, S = map(str, input().split())\nprint(S + T)\n']
['Runtime Error', 'Accepted']
['s895446356', 's236188821']
[2940.0, 2940.0]
[18.0, 17.0]
[129, 46]
p02817
u025463382
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s , t = input().split()\nans = s+t\nprint (ans)', 's , t = input().split()\nans = t+s\nprint (ans)']
['Wrong Answer', 'Accepted']
['s913400828', 's878556590']
[2940.0, 2940.0]
[17.0, 17.0]
[45, 45]
p02817
u026155812
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s, t = map(str, input().split())\nprint(s+t)', 'a = input()\nb = input()\nprint(a+b)', 'print(input()+input())', 'ls = list(map(str, input().split()))\nprint(ls[0]+ls[1])', 'ls = list(map(str, input().split()))\nprint(ls[1]+ls[0])']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s340896084', 's459889735', 's539680263', 's596598366', 's291399687']
[8868.0, 8992.0, 9016.0, 9020.0, 8968.0]
[26.0, 26.0, 18.0, 22.0, 25.0]
[43, 34, 22, 55, 55]
p02817
u026402121
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s = input()\nt = input()\nprint(t,s)', "S = input()\nT = input()\nprint(T,S,sep='')", 'S,T = input().split()\nprint(T+S)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s091243836', 's640005014', 's923566437']
[2940.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0]
[34, 41, 32]
p02817
u027403702
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['A,B,K = map(int, input().split())\n# A = int(input())\n# B = int(input())\n# C = int(input())\n# s= input()\nif A >= K:\n print(A - K,B)\nelif A + B >=K:\n print(0,A + B - K)\nelse:\n print(0)', '# S,T = input().split()\nA,B,K = map(int, input().split())\n# A = int(input())\n# B = int(input())\n# C = int(input())\n# s= input()\nif A >= K:\n print(A - K,B)\nelif A + B >=K:\n print(0,A + B - K)\nelse:\n print(0,0)', 'S,T = input().split()\nprint(T+S)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s479967652', 's750525921', 's433139677']
[2940.0, 3060.0, 2940.0]
[18.0, 17.0, 17.0]
[191, 217, 33]
p02817
u027675217
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s,t = input().split()\n\nprint(s+t)\n', 's,t = input().split()\nans = t+s\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s236363222', 's462859319']
[2940.0, 2940.0]
[17.0, 17.0]
[34, 44]
p02817
u028325088
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s, t = input().split()\nprint(s+t)', 's, t = input().split()\nprint(t+s)\n']
['Wrong Answer', 'Accepted']
['s251328189', 's369271862']
[2940.0, 2940.0]
[18.0, 17.0]
[33, 34]
p02817
u029056424
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["a=list(map(str, input().split()))\n\nprint('{} {}'.format(a[1],a[0]))", "a=list(map(str, input().split()))\n\nprint('{}{}'.format(a[1],a[0]))"]
['Wrong Answer', 'Accepted']
['s301634812', 's261154251']
[2940.0, 2940.0]
[17.0, 17.0]
[67, 66]
p02817
u029711185
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['print("".join(reverse(input("").split(" "))))', 'print("".join(reversed(input("").split(" "))))']
['Runtime Error', 'Accepted']
['s842735726', 's028159301']
[2940.0, 2940.0]
[17.0, 16.0]
[45, 46]
p02817
u031324264
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['a = list(map(str, input().split()))\nprint("{} {}".format(a[1], a[0]))', 'a = list(map(str, input().split()))\nprint(a[1], a[0])', 'a = list(map(str, input().split()))\nprint("{}{}".format(a[1], a[0]))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s402707402', 's836578840', 's276973980']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[69, 53, 68]
p02817
u031722966
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S,T = map(int,input().split())\nprint(T + S)', 'S,T = input().split()\nprint("{}{}".format(T,S))']
['Runtime Error', 'Accepted']
['s287759536', 's972145666']
[2940.0, 2940.0]
[17.0, 17.0]
[43, 47]
p02817
u032222383
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s,t =input().split()\nprint(s+t)', 's,t =input().split()\nprint(t+s)\n']
['Wrong Answer', 'Accepted']
['s958469603', 's305659173']
[2940.0, 2940.0]
[18.0, 17.0]
[31, 32]
p02817
u035445296
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s, t = map(input().split())\nprint(s+t)', 's, t = input().split()\nprint(s+t)', 's, t = input().split()\nprint(t+s)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s574002249', 's878533820', 's709232111']
[3060.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0]
[38, 33, 33]
p02817
u035453792
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s=input()\nt=input()\n\nprint(t+s)', 's,t=input().split()\n\nprint(t+s)']
['Runtime Error', 'Accepted']
['s074359675', 's373793763']
[2940.0, 2940.0]
[17.0, 17.0]
[31, 31]
p02817
u036340997
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["a, b, k = map(int, input().split())\nif a >= k:\n print('{} {}'.format(a-k.b))\nelif a+b >= k:\n print('0 {}'.format(b-(k-a)))\nelse:\n print('0 0')", 'st = input().split()\nprint(st[1]+st[0])']
['Runtime Error', 'Accepted']
['s734484504', 's992126420']
[2940.0, 2940.0]
[18.0, 17.0]
[145, 39]
p02817
u036412437
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['a, b = (int(i) for i in input().split()) \nprint("{}{}".format(b, a))', 'a, b = (i for i in input().split())\nprint("{}{}".format(b, a))']
['Runtime Error', 'Accepted']
['s857928285', 's524224469']
[2940.0, 2940.0]
[17.0, 17.0]
[69, 62]
p02817
u036531287
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['a = input().split()\ns=a[0]\nt=a[1]\nprint(t&s)', 'a = input().split()\ns=a[0]\nt=a[1]\nprint(t+s)']
['Runtime Error', 'Accepted']
['s538388385', 's519943226']
[2940.0, 2940.0]
[17.0, 17.0]
[44, 44]
p02817
u037986534
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S, T = input().split()\nprint(S+T)', 'S, T = input().split()\nprint(T+S)']
['Wrong Answer', 'Accepted']
['s377108295', 's291450910']
[2940.0, 2940.0]
[17.0, 17.0]
[33, 33]
p02817
u039189422
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s,t=input().split()\nprint(s+t)', 's,t=input().split()\nprint(t+s)']
['Wrong Answer', 'Accepted']
['s912934491', 's308066742']
[2940.0, 2940.0]
[17.0, 17.0]
[30, 30]
p02817
u042662066
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['a=input().split()\nprint(a[0]+a[1])\n', 'a=input().split()\nprint(a[1]+a[0])\n']
['Wrong Answer', 'Accepted']
['s772842245', 's630974500']
[2940.0, 2940.0]
[17.0, 17.0]
[35, 35]
p02817
u046585946
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['a,b = input().split()\nprint(a,end="")\nprint(b)', 'a,b = input().split()\nprint(b,end="")\nprint(a)\n']
['Wrong Answer', 'Accepted']
['s306846132', 's395984944']
[2940.0, 2940.0]
[17.0, 17.0]
[46, 47]
p02817
u048826171
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S,T = map(str,input().split())\nprint(S+T)', 'S,T = map(str,input().split())\nprint(T+S)']
['Wrong Answer', 'Accepted']
['s224413322', 's388917304']
[2940.0, 2940.0]
[17.0, 19.0]
[41, 41]
p02817
u051174463
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["n, k = [int(i) for i in input().split()]\nr, s, p = [int(i) for i in input().split()]\nt = list(input())\nans = 0\ndic = {'p': s, 's': r, 'r': p}\nfor i in range(k):\n ans += dic[t[i]]\ndic_ls = []\nfor i in range(k, n):\n if t[i] != t[i - k]:\n ans += dic[t[i]]\n else:\n t[i] = 'j'\nprint(ans)", 's, t = input().split()\nprint("".join([t, s]))']
['Runtime Error', 'Accepted']
['s539630155', 's903284604']
[9132.0, 9032.0]
[28.0, 27.0]
[291, 45]
p02817
u056830573
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S = input()\nT = input()\n\nprint(T+S)', 'S_T = input().split()\nS = S_T[0]\nT = S_T[1]\n\nprint(T+S)']
['Runtime Error', 'Accepted']
['s345783970', 's575035303']
[2940.0, 2940.0]
[17.0, 17.0]
[35, 55]
p02817
u057964173
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['def input(): return sys.stdin.readline().strip()\n\ndef resolve():\n x=int(input())\n ans=x\n while True:\n flag=False\n for i in range(2,int(x**0.5)):\n if ans%i==0:\n flag=True\n break\n if flag:\n ans+=1\n continue\n else:\n break\n print(ans)\nresolve()', 's,t=input().split()\nprint(t+s)']
['Runtime Error', 'Accepted']
['s391956918', 's464441290']
[3060.0, 2940.0]
[18.0, 17.0]
[354, 30]
p02817
u057993957
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['a, b = input().split()\nprint(a, b)', 'a, b = input().split()\n\nprint(b+a)']
['Wrong Answer', 'Accepted']
['s149331340', 's641772809']
[2940.0, 2940.0]
[17.0, 17.0]
[34, 34]
p02817
u058092529
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s = str(input(""))\nt = str(input(""))\n\nprint(t + s)', 's, t = input().split()\nprint(t + s)']
['Runtime Error', 'Accepted']
['s670036203', 's032698234']
[2940.0, 2940.0]
[17.0, 17.0]
[51, 35]
p02817
u061406236
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s,t = map(input().split())\n\nprint(t + s)', 's = input()\nt = input()\n\nprint(t + s)', 's,t = map(str, input().split())\n\nprint(t + s)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s288266777', 's485010905', 's711782792']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[40, 37, 45]
p02817
u063052907
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['def func(S, T):\n ans = \'\'\n for s, t in zip(S, T):\n ans += (t + s)\n return ans\n \n \nif __name__ == "__main__":\n S, T = input().split()\n print(func(S, T))', 'def func(S, T):\n ans = T + S\n return ans\n\n\nif __name__ == "__main__":\n S, T = input().split()\n print(func(S, T))\n']
['Wrong Answer', 'Accepted']
['s466362223', 's744192784']
[2940.0, 2940.0]
[17.0, 17.0]
[173, 125]
p02817
u063073794
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s=input()\nt=input()\n\nprint(t+s)', 's,t=input().split()\n\nprint(t+s)']
['Runtime Error', 'Accepted']
['s902941039', 's901713311']
[2940.0, 2940.0]
[17.0, 17.0]
[31, 31]
p02817
u065774356
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S=input()\nT=input()\nU=T+S\nPrint(U)\n', 'S=list(input().split())\nprint(S[1]+S[0])']
['Runtime Error', 'Accepted']
['s176655554', 's212489389']
[3060.0, 2940.0]
[19.0, 17.0]
[35, 40]
p02817
u067694718
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s, t = input().split()\nprint(t,s)', 's, t = input().split()\nprint(t + s)']
['Wrong Answer', 'Accepted']
['s786109126', 's395648516']
[2940.0, 2940.0]
[17.0, 17.0]
[33, 35]
p02817
u067983636
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['import sys\nimport itertools\ninput = sys.stdin.readline\n\n\ndef read_values():\n return map(int, input().split())\n\n\ndef read_list():\n return list(read_values())\n\n\ndef read_lists(N):\n return [read_list() for n in range(N)]\n\n\ndef dfs(N, L, s):\n depth = [-1] * N\n\n stack = [(0, s)]\n while stack:\n d, p = stack.pop()\n depth[p] = d\n\n for q in L[p]:\n if depth[q] != -1:\n continue\n stack.append((d + 1, q))\n return depth\n\n \ndef main():\n S, T = input().split()\n\n print(S + T)\n\n\nif __name__ == "__main__":\n main()\n', 'import sys\nimport itertools\ninput = sys.stdin.readline\n\n\ndef read_values():\n return map(int, input().split())\n\n\ndef read_list():\n return list(read_values())\n\n\ndef read_lists(N):\n return [read_list() for n in range(N)]\n\n\ndef dfs(N, L, s):\n depth = [-1] * N\n\n stack = [(0, s)]\n while stack:\n d, p = stack.pop()\n depth[p] = d\n\n for q in L[p]:\n if depth[q] != -1:\n continue\n stack.append((d + 1, q))\n return depth\n\n \ndef main():\n S, T = input().split()\n\n print(T + S)\n\n\nif __name__ == "__main__":\n main()\n']
['Wrong Answer', 'Accepted']
['s046113007', 's684361763']
[3064.0, 3064.0]
[17.0, 19.0]
[592, 592]
p02817
u068142202
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["a = list(map(int,input().split()))\nb = a[0] - a[2]\nif b <= 0:\n ans = a[1] + b\n if ans < 0:\n print('0 0')\n print('0 {}'.format(ans))\nelif b == 0:\n print('0 {}'.format(a[1]))\n\nelif b > 0:\n print('{} {}'.format(b, a[1]))", "a = list(map(int,input().split()))\nb = a[0] - a[2]\nif b <= 0:\n ans = a[1] + b\n print('0 {}'.format(ans))\nelse:\n print('{} {}'.format(b, a[1]))\n", 's, t = input().split(" ")\nprint(t+s)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s635302102', 's701743797', 's607379232']
[3064.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[225, 146, 36]
p02817
u068988546
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['"{}{}".fromat(S, T)', 'result = "{}{}".format(S, T)\nprint(result)', 'result = "{}{}".format(T, S)\n\nprint(result)', 'result = "{:}{:}".format(T, S)\n\nprint(result)', 'S, T = input().split()\n\nresult = T + S\n\nprint(result)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s440451193', 's501098084', 's684151297', 's819267114', 's961955854']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[19, 42, 43, 45, 53]
p02817
u069652661
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s,t=map(str,input().split())\nprint(s+t)', 's,t=map(str,input().split())\nprint(t+s)']
['Wrong Answer', 'Accepted']
['s937584491', 's014692809']
[2940.0, 2940.0]
[17.0, 17.0]
[39, 39]
p02817
u074338678
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s, t = input().split()\nprint(t,s)\n\n\n', 's, t = input().split()\nprint("".join([t, s]))\n\n\n']
['Wrong Answer', 'Accepted']
['s773460904', 's507217964']
[2940.0, 2940.0]
[17.0, 17.0]
[36, 48]
p02817
u075109824
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s,t = input().split(" ")\nprint(t,s)', 's,t = input().split(" ")\nprint(t+s)']
['Wrong Answer', 'Accepted']
['s298229018', 's794091026']
[2940.0, 3060.0]
[17.0, 19.0]
[35, 35]
p02817
u075303794
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S,T = input().split()\nprint(S,T)', 'print(S,T)', "S,T = input().split()\nprint(S,T, sep='')", "S,T = input().split()\nprint(T,S, sep='')"]
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s036433724', 's078398499', 's460142564', 's464082868']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[32, 10, 40, 40]
p02817
u075489826
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["import sys\ndef fastio():\n from io import StringIO\n from atexit import register\n global input\n sys.stdin = StringIO(sys.stdin.read())\n input = lambda : sys.stdin.readline().rstrip('\\r\\n')\n sys.stdout = StringIO()\n register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))\nfastio()\n\ndef debug(*var, sep = ' ', end = '\\n'):\n print(*var, file=sys.stderr, end = end, sep = sep)\n\nINF = 10**20\nMOD = 10**9 + 7\nI = lambda:list(map(int,input().split()))\n# from math import gcd\nfrom math import ceil\nfrom collections import defaultdict as dd, Counter\nfrom bisect import bisect_left as bl, bisect_right as br\n\ns, t = input().split()\nprint(t, s)", "import sys\ndef fastio():\n from io import StringIO\n from atexit import register\n global input\n sys.stdin = StringIO(sys.stdin.read())\n input = lambda : sys.stdin.readline().rstrip('\\r\\n')\n sys.stdout = StringIO()\n register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))\nfastio()\n\ndef debug(*var, sep = ' ', end = '\\n'):\n print(*var, file=sys.stderr, end = end, sep = sep)\n\nINF = 10**20\nMOD = 10**9 + 7\nI = lambda:list(map(int,input().split()))\n# from math import gcd\nfrom math import ceil\nfrom collections import defaultdict as dd, Counter\nfrom bisect import bisect_left as bl, bisect_right as br\n\ns, t = input().split()\nprint(t + s)"]
['Wrong Answer', 'Accepted']
['s326672705', 's537300191']
[3316.0, 3316.0]
[21.0, 22.0]
[662, 663]
p02817
u076764813
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['str = input().split()\n\nprint(str[0]+str[1], sep="")', 'S, T = input().split()\n\nprint(S, T, sep="")\n', 'str = input().split()\n \nprint(str[1]+str[0], sep="")']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s589716750', 's902977725', 's083264569']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[51, 44, 52]
p02817
u079022116
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s=input()\nt=input()\nprint(t+s)', "a,b,k=map(int,input().split())\nif a <= k:\n print(0,end=' ')\nelse:\n print(a-k,end=' ')\ns = a+b\nif s > k:\n print(s-k)\nelse:\n print(0)\n", 's,t=map(int,input())\nprint(t+s)', 's,t=input().split()\nprint(t+s)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s548384973', 's549201202', 's956306406', 's237053117']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[30, 136, 31, 31]
p02817
u079022693
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S,T=list(map(str,input().split()))\nprint(T,S)', 'S,T=list(map(str,input().split()))\nprint(T+S)']
['Wrong Answer', 'Accepted']
['s374149616', 's353196460']
[2940.0, 2940.0]
[17.0, 17.0]
[45, 45]
p02817
u080364835
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["s, t = input().split()\nprint('{}{}'.format(s,t))", "s, t = input().split()\nprint('{}{}'.format(t,s))"]
['Wrong Answer', 'Accepted']
['s540042975', 's256403544']
[2940.0, 2940.0]
[17.0, 17.0]
[48, 48]
p02817
u082861480
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["print('',join(input().split()))", 's = input().split()\nprint(s[1]+s[0])']
['Runtime Error', 'Accepted']
['s300522624', 's282504153']
[2940.0, 2940.0]
[18.0, 17.0]
[31, 36]
p02817
u086503932
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S = input()\nT = input()\nprint(T+S)', 'S,T = map(str,input().split())\nprint(T+S)']
['Runtime Error', 'Accepted']
['s818816474', 's469954069']
[2940.0, 2940.0]
[17.0, 17.0]
[34, 41]
p02817
u088241798
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['import math\n\ninput_from = input()\ninfo = input_from.split(\' \')\na = int(info[0])\n\ndef is_prime(n):\n if n == 2:\n return True\n if n % 2 == 0:\n return False\n for num in range(3, int(math.sqrt(n)), 2):\n if n % num == 0:\n return False\n return True\n\nif a == 2:\n print(2)\nelse:\n while not is_prime(a):\n a += 1\n\nprint("{0}".format(a))\n', 'input_from = input()\nstrings = input_from.split(\' \')\nprint("{0}{1}".format(strings[1], strings[0]))']
['Runtime Error', 'Accepted']
['s530785170', 's585118308']
[3060.0, 2940.0]
[17.0, 18.0]
[383, 99]
p02817
u088277062
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s=input().split()\nprint(s[0]+s[1])', 's=input().split()\nprint(s[1]+s[0])\n']
['Wrong Answer', 'Accepted']
['s501440461', 's144210069']
[2940.0, 2940.0]
[17.0, 18.0]
[34, 35]
p02817
u089230684
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S = input()\nT = input()\nnew = T + S\nprint(new)\n#####################################', 's=input()\nt=input()\nprint(t+s)\n#a comment for exec', 'def func(S,T):\n print(T+S)\n\nS="force"\nT="coding"\nfunc(S,T)', 'def scc(W,F):\n a = W\n b = F\n c = a+b\n return c\n\nW,F= input().split()\na = scc(F,W)\nprint(a)']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s384819002', 's422869048', 's479160162', 's746969644']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0, 17.0]
[84, 50, 62, 102]
p02817
u089786098
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["list = []\n\tsetup.strip','\n\tprint(T,S)\nlist\n\n", "list = []\n\tprint(T,S)\n\tsetup.strip','\n\nlist", "list = [T,S]\n\tsetup.strip','\nlist", 'input = S\ninput = T\na = list[S,T]:\n print(a)', 'A, B = input().split()\nprint(B, A)', 'A, B = input().split()\nC = B + A\nprint(C)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s033137451', 's123048182', 's172589084', 's172839965', 's591606943', 's484546317']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0, 16.0, 16.0, 17.0]
[44, 43, 33, 45, 34, 41]
p02817
u090445726
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['string_list = map(str, input().split(" "))\nprint(string_list[1] + string_list[0])', 'string_list = input()\nstring_list = list(map(str, string_list.split(" ")))\nprint(string_list[1] + string_list[0])']
['Runtime Error', 'Accepted']
['s237192693', 's402465510']
[2940.0, 2940.0]
[17.0, 17.0]
[81, 114]
p02817
u092387689
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['a,b = input().split()\nans = a+b\nprint(ans)', 'a,b = input().split()\nans = b+a\nprint(ans)']
['Wrong Answer', 'Accepted']
['s741444234', 's378968888']
[3064.0, 2940.0]
[17.0, 17.0]
[42, 42]
p02817
u094102716
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['a=input().split()\nprint(a[0]+a[1])', 'a=input().split()\nprint(a[1]+a[0])']
['Wrong Answer', 'Accepted']
['s147269408', 's134815820']
[8944.0, 9032.0]
[23.0, 27.0]
[34, 34]
p02817
u095834727
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s, t = input().split()\nprint(s+t)', 's, t = input().split()\nprint(t+s)']
['Wrong Answer', 'Accepted']
['s342787454', 's828268128']
[2940.0, 2940.0]
[17.0, 17.0]
[33, 33]
p02817
u100277898
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S,T = input.split()\nprint(T+S)', 'S,T = input().split()\nprint("{}{}".format(T,S))']
['Runtime Error', 'Accepted']
['s650611310', 's546458199']
[2940.0, 2940.0]
[17.0, 17.0]
[30, 47]
p02817
u103915901
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['T,S=input().split()\nprint(T+S)', 'S,T=input().split()\nprint(T+S)']
['Wrong Answer', 'Accepted']
['s657664132', 's751670632']
[2940.0, 2940.0]
[17.0, 17.0]
[30, 30]
p02817
u105209986
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S,T = input().split()\nprint(T,S)', 'S,T = input().split()\nprint(T,S, sep="")']
['Wrong Answer', 'Accepted']
['s073004779', 's969978025']
[2940.0, 2940.0]
[17.0, 17.0]
[32, 40]
p02817
u109133010
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['s,t=map(input().split())\nif s>=t:\n print(t+s)\nelse:\n print(s+t)', 's,t=map(str,input().split())\nprint(t+s)']
['Runtime Error', 'Accepted']
['s638121723', 's920666563']
[2940.0, 2940.0]
[17.0, 17.0]
[65, 39]
p02817
u109194867
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["S,T = map(string, input().split())\nprint('{}{}'.format(T, S))\n\n \n ", "S,T = map(String, input().split())\nprint('{}{}'.format(T, S))", "S,T = input().split()\n#print('{}{}'.format(T, S))\nprint(T+S)"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s037333146', 's546651788', 's414599597']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[84, 61, 60]
p02817
u112247039
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['a,b = input().split()\nprint(a+b)', 'a,b = input().split()\nprint(b+a)']
['Wrong Answer', 'Accepted']
['s292842729', 's299928590']
[2940.0, 2940.0]
[17.0, 17.0]
[32, 32]
p02817
u116722061
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['A, B, K = map(int, input().split())\n\nif K>=A + B:\n\tprint ("0 0")\nelif K>=A:\n\tprint (str(0) + \' \' + str(B-(K-A)))\nelse:\n \tprint (str(A-K) + \' \' +str(B))\n', 'S, T = input().split()\nprint (T+S)']
['Runtime Error', 'Accepted']
['s281600478', 's280279562']
[2940.0, 2940.0]
[17.0, 17.0]
[153, 34]
p02817
u118760114
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S,T = list(map(int, input().split()))\nprint(T+S)\n', 'S,T = list(map(int, input().split()))\nprint(T+S)\n', 'S,T = map(str, input().split())\nprint(T+S)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s187412505', 's480978106', 's936864439']
[9064.0, 9000.0, 8944.0]
[21.0, 25.0, 26.0]
[49, 49, 43]
p02817
u123745130
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['print(input()+input())', 'print("".join(input().split())) ', 'print("".join(reversed(input().split()))) ']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s090713129', 's091132373', 's432356149']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0]
[22, 32, 42]
p02817
u124499550
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
['S,T = input().split()\n\nprint(S+T)', 'S, T = input().split()\nprint(T + S)']
['Wrong Answer', 'Accepted']
['s003709295', 's675418709']
[2940.0, 2940.0]
[17.0, 17.0]
[33, 35]
p02817
u127285813
2,000
1,048,576
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
["S, T = input().split\nprint(T, S, sep='')", "S, T = input().split()\nprint(T, S, sep='')"]
['Runtime Error', 'Accepted']
['s090381290', 's579477903']
[2940.0, 2940.0]
[17.0, 18.0]
[40, 42]