output_description
stringlengths
15
956
submission_id
stringlengths
10
10
status
stringclasses
3 values
problem_id
stringlengths
6
6
input_description
stringlengths
9
2.55k
attempt
stringlengths
1
13.7k
problem_description
stringlengths
7
5.24k
samples
stringlengths
2
2.72k
Print the answer. * * *
s237159924
Runtime Error
p03156
Input is given from Standard Input in the following format: N A B P_1 P_2 ... P_N
n = int(input()) a, b = list(map(int, input().split())) p = list(map(int, input().split())) cnta = 0 cntb = 0 cnt c = 0 for pi in p: if pi <= a: cnta += 1 elif pi <= b: cntb += 1 else: cntc += 1 ans = min(cnta, cntb, cntc) print(ans)
Statement You have written N problems to hold programming contests. The i-th problem will have a score of P_i points if used in a contest. With these problems, you would like to hold as many contests as possible under the following condition: * A contest has three problems. The first problem has a score not greater than A points, the second has a score between A + 1 and B points (inclusive), and the third has a score not less than B + 1 points. The same problem should not be used in multiple contests. At most how many contests can be held?
[{"input": "7\n 5 15\n 1 10 16 2 7 20 12", "output": "2\n \n\nTwo contests can be held by putting the first, second, third problems and the\nfourth, fifth, sixth problems together.\n\n* * *"}, {"input": "8\n 3 8\n 5 5 5 10 10 10 15 20", "output": "0\n \n\nNo contest can be held, because there is no problem with a score of A = 3 or\nless.\n\n* * *"}, {"input": "3\n 5 6\n 5 6 10", "output": "1"}]
Print a_i and a_j that you selected, with a space in between. * * *
s668469974
Runtime Error
p03382
Input is given from Standard Input in the following format: n a_1 a_2 ... a_n
input() da = list(map(int,input().split())) x = max(da) y = x + 1 for i in x if i == x: continue if abs(x/2 - i ) <= (x/2 - y): y = i print(x,y)
Statement Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
[{"input": "5\n 6 9 4 2 11", "output": "11 6\n \n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n * \\rm{comb}(4,2)=6\n * \\rm{comb}(6,2)=15\n * \\rm{comb}(6,4)=15\n * \\rm{comb}(9,2)=36\n * \\rm{comb}(9,4)=126\n * \\rm{comb}(9,6)=84\n * \\rm{comb}(11,2)=55\n * \\rm{comb}(11,4)=330\n * \\rm{comb}(11,6)=462\n * \\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\n* * *"}, {"input": "2\n 100 0", "output": "100 0"}]
Print a_i and a_j that you selected, with a space in between. * * *
s894894297
Runtime Error
p03382
Input is given from Standard Input in the following format: n a_1 a_2 ... a_n
input() da = list(map(int,input().split())) x = max(da) y = x + 1 for i in x: if i == x: continue if abs(x/2 - i ) <= abs(x/2 - y): y = i print(x,y)
Statement Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
[{"input": "5\n 6 9 4 2 11", "output": "11 6\n \n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n * \\rm{comb}(4,2)=6\n * \\rm{comb}(6,2)=15\n * \\rm{comb}(6,4)=15\n * \\rm{comb}(9,2)=36\n * \\rm{comb}(9,4)=126\n * \\rm{comb}(9,6)=84\n * \\rm{comb}(11,2)=55\n * \\rm{comb}(11,4)=330\n * \\rm{comb}(11,6)=462\n * \\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\n* * *"}, {"input": "2\n 100 0", "output": "100 0"}]
Print a_i and a_j that you selected, with a space in between. * * *
s587863398
Accepted
p03382
Input is given from Standard Input in the following format: n a_1 a_2 ... a_n
n = int(input()) alist = list(sorted(map(int, input().split()))) maxa = alist[-1] halfa = maxa / 2 mina = maxa a2 = 0 for a in alist: if abs(halfa - a2) > abs(halfa - a): a2 = a print(maxa, a2)
Statement Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
[{"input": "5\n 6 9 4 2 11", "output": "11 6\n \n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n * \\rm{comb}(4,2)=6\n * \\rm{comb}(6,2)=15\n * \\rm{comb}(6,4)=15\n * \\rm{comb}(9,2)=36\n * \\rm{comb}(9,4)=126\n * \\rm{comb}(9,6)=84\n * \\rm{comb}(11,2)=55\n * \\rm{comb}(11,4)=330\n * \\rm{comb}(11,6)=462\n * \\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\n* * *"}, {"input": "2\n 100 0", "output": "100 0"}]
Print a_i and a_j that you selected, with a space in between. * * *
s265642628
Accepted
p03382
Input is given from Standard Input in the following format: n a_1 a_2 ... a_n
import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**15 mod = 10**9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()] def LF(): return [float(x) for x in sys.stdin.readline().split()] def LS(): return sys.stdin.readline().split() def I(): return int(sys.stdin.readline()) def F(): return float(sys.stdin.readline()) def S(): return input() def pf(s): return print(s, flush=True) def main(): n = I() a = LI() t = max(a) m = -1 r = -1 for c in a: if min(c, t - c) > m and c != t: r = c m = min(c, t - c) return "{} {}".format(t, r) print(main())
Statement Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
[{"input": "5\n 6 9 4 2 11", "output": "11 6\n \n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n * \\rm{comb}(4,2)=6\n * \\rm{comb}(6,2)=15\n * \\rm{comb}(6,4)=15\n * \\rm{comb}(9,2)=36\n * \\rm{comb}(9,4)=126\n * \\rm{comb}(9,6)=84\n * \\rm{comb}(11,2)=55\n * \\rm{comb}(11,4)=330\n * \\rm{comb}(11,6)=462\n * \\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\n* * *"}, {"input": "2\n 100 0", "output": "100 0"}]
Print a_i and a_j that you selected, with a space in between. * * *
s243102492
Accepted
p03382
Input is given from Standard Input in the following format: n a_1 a_2 ... a_n
n = int(input()) Alist = list(map(int, input().split())) Alist.sort() n = Alist[-1] if n % 2 == 0: R = n // 2 r = Alist[0] rmin = 10**9 for i in Alist: if abs(i - R) < rmin: r = i rmin = abs(r - R) else: R1 = (1 + n) // 2 R2 = (n - 1) // 2 r = Alist[0] rmin = 10**9 for i in Alist: if abs(i - R1) < rmin or abs(i - R2) < rmin: r = i rmin = min(abs(r - R1), abs(r - R2)) print(n, r)
Statement Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
[{"input": "5\n 6 9 4 2 11", "output": "11 6\n \n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n * \\rm{comb}(4,2)=6\n * \\rm{comb}(6,2)=15\n * \\rm{comb}(6,4)=15\n * \\rm{comb}(9,2)=36\n * \\rm{comb}(9,4)=126\n * \\rm{comb}(9,6)=84\n * \\rm{comb}(11,2)=55\n * \\rm{comb}(11,4)=330\n * \\rm{comb}(11,6)=462\n * \\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\n* * *"}, {"input": "2\n 100 0", "output": "100 0"}]
Print a_i and a_j that you selected, with a space in between. * * *
s408644551
Accepted
p03382
Input is given from Standard Input in the following format: n a_1 a_2 ... a_n
from sys import exit, setrecursionlimit, stderr from functools import reduce from itertools import * from collections import defaultdict from bisect import * def read(): return int(input()) def reads(): return [int(x) for x in input().split()] n = read() a = sorted(reads()) x = a.pop() y = sorted((abs(x - 2 * p), p) for p in a)[0][1] print(x, y)
Statement Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
[{"input": "5\n 6 9 4 2 11", "output": "11 6\n \n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n * \\rm{comb}(4,2)=6\n * \\rm{comb}(6,2)=15\n * \\rm{comb}(6,4)=15\n * \\rm{comb}(9,2)=36\n * \\rm{comb}(9,4)=126\n * \\rm{comb}(9,6)=84\n * \\rm{comb}(11,2)=55\n * \\rm{comb}(11,4)=330\n * \\rm{comb}(11,6)=462\n * \\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\n* * *"}, {"input": "2\n 100 0", "output": "100 0"}]
Print a_i and a_j that you selected, with a space in between. * * *
s626310954
Accepted
p03382
Input is given from Standard Input in the following format: n a_1 a_2 ... a_n
def find(A): A = sorted(A) MAX = A[-1] mid = MAX / 2 MIN = MAX need = -1 for i in range(len(A) - 1): if abs(A[i] - mid) < MIN: need = A[i] MIN = abs(A[i] - mid) return (MAX, need) input() x, y = find(list(map(int, input().strip().split(" ")))) print("{} {}".format(x, y))
Statement Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
[{"input": "5\n 6 9 4 2 11", "output": "11 6\n \n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n * \\rm{comb}(4,2)=6\n * \\rm{comb}(6,2)=15\n * \\rm{comb}(6,4)=15\n * \\rm{comb}(9,2)=36\n * \\rm{comb}(9,4)=126\n * \\rm{comb}(9,6)=84\n * \\rm{comb}(11,2)=55\n * \\rm{comb}(11,4)=330\n * \\rm{comb}(11,6)=462\n * \\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\n* * *"}, {"input": "2\n 100 0", "output": "100 0"}]
Print a_i and a_j that you selected, with a space in between. * * *
s413052301
Runtime Error
p03382
Input is given from Standard Input in the following format: n a_1 a_2 ... a_n
def C(n, r): # combination top = 1 bot1 = 1 bot2 = 1 for i in range(n): top *= i + 1 for i in range(r): bot1 *= i + 1 for i in range(n - r): bot2 *= i + 1 return int(top / (bot1 * bot2)) n = int(input()) a = list(map(int, input().split())) ############################################################## a.sort() num = 1 for i in range(1, len(a)): j = 0 while j < a.index(a[i]): c = C(a[i], a[j]) if c >= num: num = c l = a[i] r = a[j] j += 1 print(l, r)
Statement Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
[{"input": "5\n 6 9 4 2 11", "output": "11 6\n \n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n * \\rm{comb}(4,2)=6\n * \\rm{comb}(6,2)=15\n * \\rm{comb}(6,4)=15\n * \\rm{comb}(9,2)=36\n * \\rm{comb}(9,4)=126\n * \\rm{comb}(9,6)=84\n * \\rm{comb}(11,2)=55\n * \\rm{comb}(11,4)=330\n * \\rm{comb}(11,6)=462\n * \\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\n* * *"}, {"input": "2\n 100 0", "output": "100 0"}]
Print a_i and a_j that you selected, with a space in between. * * *
s180548914
Wrong Answer
p03382
Input is given from Standard Input in the following format: n a_1 a_2 ... a_n
def Fc(n, r): t = 1 for i in range(int(n - r)): t = t * (n - i) return t def Comb(n, r): return int(Fc(n, r) / Fc(r, 0)) N = int(input()) a = list(map(int, input().strip().split(" "))) asort = sorted(a) maxn = [0, -1, -1] # 現在の最大値,n,r for i in range(N - 1): n = asort[N - i - 1] if n % 2 == 0: medn = n / 2 else: medn = (n + 1) / 2 if maxn[0] > Comb(n, medn): # どうやっても越えられないならブレイク break flg = True r_ = medn # rの候補 rp = medn + 1 rm = medn - 1 while flg: if r_ in a: r = r_ flg = False elif rp in a: r = rp flg = False elif rm in a: r = rm flg = False rp += 1 rm -= 1 if Comb(n, r) > maxn[0]: maxn[0] = Comb(n, r) maxn[1] = n maxn[2] = r n = maxn[1] r = int(maxn[2]) print(str(n) + " " + str(r))
Statement Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
[{"input": "5\n 6 9 4 2 11", "output": "11 6\n \n\n\\rm{comb}(a_i,a_j) for each possible selection is as follows:\n\n * \\rm{comb}(4,2)=6\n * \\rm{comb}(6,2)=15\n * \\rm{comb}(6,4)=15\n * \\rm{comb}(9,2)=36\n * \\rm{comb}(9,4)=126\n * \\rm{comb}(9,6)=84\n * \\rm{comb}(11,2)=55\n * \\rm{comb}(11,4)=330\n * \\rm{comb}(11,6)=462\n * \\rm{comb}(11,9)=55\n\nThus, we should print 11 and 6.\n\n* * *"}, {"input": "2\n 100 0", "output": "100 0"}]
Output the number of possible distinct patterns.
s550096832
Accepted
p00957
The input consists of a single test case in the following format. $l$ $k$ Here, the maximum possible total thickness of disks in a pole is $l$ cm, and the thickness of the thick disks is $k$ cm. $l$ and $k$ are integers satisfying $1 \leq l \leq 100$ and $2 \leq k \leq 10$.
l, k = [int(i) for i in input().split()] INIT = 0 tableB = [INIT] * 110 tableW = [INIT] * 110 tableW[0] = 1 for i in range(1, l + 1): tableB[i] += tableW[i - 1] if i - k >= 0: tableB[i] += tableW[i - k] tableW[i + 1] = tableB[i] print(sum(tableB)) # print(tableB)
A Secret of Chocolate Poles Wendy, the master of a chocolate shop, is thinking of displaying poles of chocolate disks in the showcase. She can use three kinds of chocolate disks: white thin disks, dark thin disks, and dark thick disks. The thin disks are $1$ cm thick, and the thick disks are $k$ cm thick. Disks will be piled in glass cylinders. Each pole should satisfy the following conditions for her secret mission, which we cannot tell. * A pole should consist of at least one disk. * The total thickness of disks in a pole should be less than or equal to $l$ cm. * The top disk and the bottom disk of a pole should be dark. * A disk directly upon a white disk should be dark and vice versa. As examples, six side views of poles are drawn in Figure A.1. These are the only possible side views she can make when $l = 5$ and $k = 3$. ![](https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ICPCAsia2017_chocolatePoles) Figure A.1. Six chocolate poles corresponding to Sample Input 1 Your task is to count the number of distinct side views she can make for given $l$ and $k$ to help her accomplish her secret mission.
[{"input": "5 3", "output": "6"}, {"input": "9 10", "output": "5"}, {"input": "10 10", "output": "6"}, {"input": "20 5", "output": "86"}, {"input": "100 2", "output": "3626169232670"}]
Output the number of possible distinct patterns.
s458684250
Wrong Answer
p00957
The input consists of a single test case in the following format. $l$ $k$ Here, the maximum possible total thickness of disks in a pole is $l$ cm, and the thickness of the thick disks is $k$ cm. $l$ and $k$ are integers satisfying $1 \leq l \leq 100$ and $2 \leq k \leq 10$.
import math def combinations_count(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) def main(): l = list(map(int, input().split())) combinate_a = [] combinate_b = [] ans = 0 for a in range(l[0]): for b in range(l[0]): if (l[1] + 1) * a + 2 * b <= l[0] + 1: combinate_a.append(a) combinate_b.append(b) if (l[1] + 1) * a + 2 * b > l[0] + 1: break for i in range(1, len(combinate_a)): if combinate_a[i] == 0: ans += 1 else: ans += combinations_count(combinate_a[i] + combinate_b[i], combinate_a[i]) print(ans) if __name__ == "__main__": main()
A Secret of Chocolate Poles Wendy, the master of a chocolate shop, is thinking of displaying poles of chocolate disks in the showcase. She can use three kinds of chocolate disks: white thin disks, dark thin disks, and dark thick disks. The thin disks are $1$ cm thick, and the thick disks are $k$ cm thick. Disks will be piled in glass cylinders. Each pole should satisfy the following conditions for her secret mission, which we cannot tell. * A pole should consist of at least one disk. * The total thickness of disks in a pole should be less than or equal to $l$ cm. * The top disk and the bottom disk of a pole should be dark. * A disk directly upon a white disk should be dark and vice versa. As examples, six side views of poles are drawn in Figure A.1. These are the only possible side views she can make when $l = 5$ and $k = 3$. ![](https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ICPCAsia2017_chocolatePoles) Figure A.1. Six chocolate poles corresponding to Sample Input 1 Your task is to count the number of distinct side views she can make for given $l$ and $k$ to help her accomplish her secret mission.
[{"input": "5 3", "output": "6"}, {"input": "9 10", "output": "5"}, {"input": "10 10", "output": "6"}, {"input": "20 5", "output": "86"}, {"input": "100 2", "output": "3626169232670"}]
Print 26 integers in a line with spaces in between. The i-th integer should be the number of the occurrences of the i-th letter in the lowercase English alphabet from the l-th character through the r-th character of f^{10^{100}} (S). * * *
s824525942
Runtime Error
p03678
Input is given from Standard Input in the following format: S l r
#!/usr/bin/env python3 M = 10**9 + 7 a = ord("a") def check_cycle(t, p): len_t = len(t) if len_t % p != 0: return False pre = t[:p] for i in range(p, len_t, p): if t[i : i + p] != pre: return False return True def solve_cycle(t, l, r): len_t = len(t) ql = (l - 1) // len_t rl = (l - 1) % len_t qr = r // len_t rr = r % len_t ans = [0] * 26 for ch in t: ans[ord(ch) - a] += 1 for j in range(26): ans[j] *= qr - ql for ch in t[: rr + 1]: ans[ord(ch) - a] += 1 for ch in t[: rl + 1]: ans[ord(ch) - a] -= 1 return ans def calc_part(tp, tm, len_p, len_m, dp0, dp1, r, ir): num_p = 0 num_m = 0 for i in range(ir, -1, -1): n = dp0[i] * len_p + dp1[i] * len_m if n <= r: num_p += dp0[i] num_m += dp1[i] r -= n vec = [0] * 26 tr = tp if len_p + len_m < r: num_p += 1 num_m += 1 r -= len_p + len_m elif len_p < r: num_p += 1 r -= len_p tr = tm for ch in tp: vec[ord(ch) - a] += num_p for ch in tm: vec[ord(ch) - a] += num_m for ch in tr[:r]: vec[ord(ch) - a] += 1 return vec def solve_part(t, len_p, l, r): len_t = len(t) len_m = len_t - 2 * len_p dp0 = [0] * 121 dp1 = [0] * 121 dp0[0] = 2 dp1[0] = 1 for i in range(1, 121): dp0[i] = dp0[i - 1] + dp1[i - 1] dp1[i] = dp0[i - 1] n = dp0[i] * len_p + dp1[i] * len_m if l - 1 <= n: il = i - 1 if r <= n: ir = i - 1 break vec_l = calc_part( t[:len_p], t[len_p : len_p + len_m], len_p, len_m, dp0, dp1, l - 1, il ) vec_r = calc_part( t[:len_p], t[len_p : len_p + len_m], len_p, len_m, dp0, dp1, r, ir ) ans = [vec_r[j] - vec_l[j] for j in range(26)] return ans def solve(s, l, r): t = s[: len(s) // 2] len_t = len(t) if len_t == 1: return solve_cycle(t, l, r) len_p = 0 ph = 0 sh = 0 base = 1 for i in range(len_t // 2): ph *= 26 ph += ord(s[i]) - a ph %= M sh += base * (ord(s[-1 - i]) - a) sh %= M if ph == sh: if check_cycle(t, i + 1): return sovle_cycle(t[: i + 1], l, r) elif t[: i + 1] == t[-1 - i :]: len_p = i + 1 base *= 26 if len_p == 0: return solve_cycle(t, l, r) return solve_part(t, len_p, l, r) def main(): s = input() l, r = input().split() l = int(l) r = int(r) print(" ".join(list(map(str, solve(s, l, r))))) if __name__ == "__main__": main()
Statement We will call a string that can be obtained by concatenating two equal strings an _even_ string. For example, `xyzxyz` and `aaaaaa` are even, while `ababab` and `xyzxy` are not. For a non-empty string S, we will define f(S) as the shortest even string that can be obtained by appending one or more characters to the end of S. For example, f(`abaaba`)=`abaababaab`. It can be shown that f(S) is uniquely determined for a non-empty string S. You are given an even string S consisting of lowercase English letters. For each letter in the lowercase English alphabet, find the number of its occurrences from the l-th character through the r-th character of f^{10^{100}} (S). Here, f^{10^{100}} (S) is the string f(f(f( ... f(S) ... ))) obtained by applying f to S 10^{100} times.
[{"input": "abaaba\n 6 10", "output": "3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n \n\nSince f(`abaaba`)=`abaababaab`, the first ten characters in f^{10^{100}}(S) is\nalso `abaababaab`. Thus, the sixth through the tenth characters are `abaab`.\nIn this string, `a` appears three times, `b` appears twice and no other\nletters appear, and thus the output should be 3 and 2 followed by twenty-four\n0s.\n\n* * *"}, {"input": "xx\n 1 1000000000000000000", "output": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000000000000000000 0 0\n \n\n* * *"}, {"input": "vgxgpuamkvgxgvgxgpuamkvgxg\n 1 1000000000000000000", "output": "87167725689669676 0 0 0 0 0 282080685775825810 0 0 0 87167725689669676 0 87167725689669676 0 0 87167725689669676 0 0 0 0 87167725689669676 141040342887912905 0 141040342887912905 0 0"}]
Print 26 integers in a line with spaces in between. The i-th integer should be the number of the occurrences of the i-th letter in the lowercase English alphabet from the l-th character through the r-th character of f^{10^{100}} (S). * * *
s591373932
Wrong Answer
p03678
Input is given from Standard Input in the following format: S l r
def getSS(S): helfLength = int(len(S) / 2) + 1 while S[: int(len(S[helfLength:]))] != S[helfLength:]: helfLength += 1 return S[:helfLength] * 2 result = "" S = input() SS = S lr = [int(i) for i in input().split()] i = 0 while i < 10: SS = getSS(SS) i += 1 cList = [chr(i) for i in range(97, 97 + 26)] for c in cList: result += str(SS[lr[0] - 1 : lr[1]].count(c)) + " " print(result.rstrip())
Statement We will call a string that can be obtained by concatenating two equal strings an _even_ string. For example, `xyzxyz` and `aaaaaa` are even, while `ababab` and `xyzxy` are not. For a non-empty string S, we will define f(S) as the shortest even string that can be obtained by appending one or more characters to the end of S. For example, f(`abaaba`)=`abaababaab`. It can be shown that f(S) is uniquely determined for a non-empty string S. You are given an even string S consisting of lowercase English letters. For each letter in the lowercase English alphabet, find the number of its occurrences from the l-th character through the r-th character of f^{10^{100}} (S). Here, f^{10^{100}} (S) is the string f(f(f( ... f(S) ... ))) obtained by applying f to S 10^{100} times.
[{"input": "abaaba\n 6 10", "output": "3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n \n\nSince f(`abaaba`)=`abaababaab`, the first ten characters in f^{10^{100}}(S) is\nalso `abaababaab`. Thus, the sixth through the tenth characters are `abaab`.\nIn this string, `a` appears three times, `b` appears twice and no other\nletters appear, and thus the output should be 3 and 2 followed by twenty-four\n0s.\n\n* * *"}, {"input": "xx\n 1 1000000000000000000", "output": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000000000000000000 0 0\n \n\n* * *"}, {"input": "vgxgpuamkvgxgvgxgpuamkvgxg\n 1 1000000000000000000", "output": "87167725689669676 0 0 0 0 0 282080685775825810 0 0 0 87167725689669676 0 87167725689669676 0 0 87167725689669676 0 0 0 0 87167725689669676 141040342887912905 0 141040342887912905 0 0"}]
Print 26 integers in a line with spaces in between. The i-th integer should be the number of the occurrences of the i-th letter in the lowercase English alphabet from the l-th character through the r-th character of f^{10^{100}} (S). * * *
s159334156
Wrong Answer
p03678
Input is given from Standard Input in the following format: S l r
S = input() helfLength = int(len(S) / 2) + 1 while S[: int(len(S[helfLength:]))] != S[helfLength:]: helfLength += 1 print(helfLength * 2)
Statement We will call a string that can be obtained by concatenating two equal strings an _even_ string. For example, `xyzxyz` and `aaaaaa` are even, while `ababab` and `xyzxy` are not. For a non-empty string S, we will define f(S) as the shortest even string that can be obtained by appending one or more characters to the end of S. For example, f(`abaaba`)=`abaababaab`. It can be shown that f(S) is uniquely determined for a non-empty string S. You are given an even string S consisting of lowercase English letters. For each letter in the lowercase English alphabet, find the number of its occurrences from the l-th character through the r-th character of f^{10^{100}} (S). Here, f^{10^{100}} (S) is the string f(f(f( ... f(S) ... ))) obtained by applying f to S 10^{100} times.
[{"input": "abaaba\n 6 10", "output": "3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n \n\nSince f(`abaaba`)=`abaababaab`, the first ten characters in f^{10^{100}}(S) is\nalso `abaababaab`. Thus, the sixth through the tenth characters are `abaab`.\nIn this string, `a` appears three times, `b` appears twice and no other\nletters appear, and thus the output should be 3 and 2 followed by twenty-four\n0s.\n\n* * *"}, {"input": "xx\n 1 1000000000000000000", "output": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000000000000000000 0 0\n \n\n* * *"}, {"input": "vgxgpuamkvgxgvgxgpuamkvgxg\n 1 1000000000000000000", "output": "87167725689669676 0 0 0 0 0 282080685775825810 0 0 0 87167725689669676 0 87167725689669676 0 0 87167725689669676 0 0 0 0 87167725689669676 141040342887912905 0 141040342887912905 0 0"}]
Print Q lines. The j-th line (1 \leq j \leq Q) should contain the minimum number of days that Tak needs to travel from the a_j-th hotel to the b_j-th hotel. * * *
s912778606
Wrong Answer
p04017
The input is given from Standard Input in the following format: N x_1 x_2 ... x_N L Q a_1 b_1 a_2 b_2 : a_Q b_Q
n, *x = map(int, open(0).read().split()) d = [0] + [10**9] * ~-n l = x[n] i = t = 0 for j, y in enumerate(x[1:n], 1): t = y - x[i] while t > l: i += 1 t = y - x[i] print(i, j, t) d[j] = d[i] + 1 for a, b in zip(x[n + 2 :: 2], x[n + 3 :: 2]): print(abs(d[a - 1] - d[b - 1]) or 1)
Statement N hotels are located on a straight line. The coordinate of the i-th hotel (1 \leq i \leq N) is x_i. Tak the traveler has the following two personal principles: * He never travels a distance of more than L in a single day. * He never sleeps in the open. That is, he must stay at a hotel at the end of a day. You are given Q queries. The j-th (1 \leq j \leq Q) query is described by two distinct integers a_j and b_j. For each query, find the minimum number of days that Tak needs to travel from the a_j-th hotel to the b_j-th hotel following his principles. It is guaranteed that he can always travel from the a_j-th hotel to the b_j-th hotel, in any given input.
[{"input": "9\n 1 3 6 13 15 18 19 29 31\n 10\n 4\n 1 8\n 7 3\n 6 7\n 8 5", "output": "4\n 2\n 1\n 2\n \n\nFor the 1-st query, he can travel from the 1-st hotel to the 8-th hotel in 4\ndays, as follows:\n\n * Day 1: Travel from the 1-st hotel to the 2-nd hotel. The distance traveled is 2.\n * Day 2: Travel from the 2-nd hotel to the 4-th hotel. The distance traveled is 10.\n * Day 3: Travel from the 4-th hotel to the 7-th hotel. The distance traveled is 6.\n * Day 4: Travel from the 7-th hotel to the 8-th hotel. The distance traveled is 10."}]
Print Q lines. The j-th line (1 \leq j \leq Q) should contain the minimum number of days that Tak needs to travel from the a_j-th hotel to the b_j-th hotel. * * *
s762043426
Wrong Answer
p04017
The input is given from Standard Input in the following format: N x_1 x_2 ... x_N L Q a_1 b_1 a_2 b_2 : a_Q b_Q
# coding: utf-8 num_N = int(input()) l_pos = list(map(int, input().split())) num_L = int(input()) num_Q = int(input()) l_que = [list(map(int, input().split())) for __ in range(num_Q)] # dp[k][i] = i番目のホテルからk ** 2日以内に到達可能な最右のホテル番号 dp = [[0] * (num_N + 1) for __ in range(num_N + 1)] for i in range(1, num_N + 1): max_ind = 0 for ind, pos in enumerate(l_pos): if l_pos[i - 1] + num_L >= pos: max_ind = max(max_ind, ind) dp[0][i] = max_ind + 1 k = 0 while True: for i in range(1, num_N + 1): dp[k + 1][i] = dp[k][dp[k][i]] if dp[k + 1][1] == dp[k + 1][num_N]: break k += 1 def solve(num_a, num_b): if num_a > num_b: num_a, num_b = num_b, num_a num_k = 0 while True: if dp[num_k][num_a] >= num_b: break num_k += 1 return int(2**num_k) for que in l_que: print(solve(que[0], que[1]))
Statement N hotels are located on a straight line. The coordinate of the i-th hotel (1 \leq i \leq N) is x_i. Tak the traveler has the following two personal principles: * He never travels a distance of more than L in a single day. * He never sleeps in the open. That is, he must stay at a hotel at the end of a day. You are given Q queries. The j-th (1 \leq j \leq Q) query is described by two distinct integers a_j and b_j. For each query, find the minimum number of days that Tak needs to travel from the a_j-th hotel to the b_j-th hotel following his principles. It is guaranteed that he can always travel from the a_j-th hotel to the b_j-th hotel, in any given input.
[{"input": "9\n 1 3 6 13 15 18 19 29 31\n 10\n 4\n 1 8\n 7 3\n 6 7\n 8 5", "output": "4\n 2\n 1\n 2\n \n\nFor the 1-st query, he can travel from the 1-st hotel to the 8-th hotel in 4\ndays, as follows:\n\n * Day 1: Travel from the 1-st hotel to the 2-nd hotel. The distance traveled is 2.\n * Day 2: Travel from the 2-nd hotel to the 4-th hotel. The distance traveled is 10.\n * Day 3: Travel from the 4-th hotel to the 7-th hotel. The distance traveled is 6.\n * Day 4: Travel from the 7-th hotel to the 8-th hotel. The distance traveled is 10."}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s863568787
Accepted
p03228
Input is given from Standard Input in the following format: A B K
#!/usr/bin/env python3 import sys from typing import ( Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union, ) # import time # import math # import numpy as np # import scipy.sparse.csgraph as cs # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall # import random # random, uniform, randint, randrange, shuffle, sample # import string # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits # import re # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s) # from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]). # from collections import deque # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate() # from collections import defaultdict # subclass of dict. defaultdict(facroty) # from collections import Counter # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter) # from datetime import date, datetime # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj # from datetime.datetime import strptime # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj # from datetime import timedelta # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available. # from copy import copy, deepcopy # use deepcopy to copy multi-dimentional matrix without reference # from functools import reduce # reduce(f, iter[, init]) # from functools import lru_cache # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed) # from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn). # from heapq import nlargest, nsmallest # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn). # from itertools import count, cycle, repeat # count(start[,step]), cycle(iter), repeat(elm[,n]) # from itertools import groupby # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])] # from itertools import starmap # starmap(pow, [[2,5], [3,2]]) returns [32, 9] # from itertools import product, permutations # product(iter, repeat=n), permutations(iter[,r]) # from itertools import combinations, combinations_with_replacement # from itertools import accumulate # accumulate(iter[, f]) # from operator import itemgetter # itemgetter(1), itemgetter('key') # from fractions import Fraction # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10) def main(): mod = 1000000007 # 10^9+7 inf = float("inf") # sys.float_info.max = 1.79e+308 # inf = 2 ** 63 - 1 # (for fast JIT compile in PyPy) 9.22e+18 sys.setrecursionlimit(10**6) # 1000 -> 1000000 def input(): return sys.stdin.readline().rstrip() def ii(): return int(input()) def isp(): return input().split() def mi(): return map(int, input().split()) def mi_0(): return map(lambda x: int(x) - 1, input().split()) def lmi(): return list(map(int, input().split())) def lmi_0(): return list(map(lambda x: int(x) - 1, input().split())) def li(): return list(input()) def simu(a, b, k): turn = True while k > 0: # print(a, b, k) if turn: tmp = a // 2 a = tmp b += tmp else: tmp = b // 2 b = tmp a += tmp k -= 1 turn = not turn return a, b a, b, k = mi() x, y = simu(a, b, k) print(f"{x} {y}") if __name__ == "__main__": main()
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s269176563
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
A, B, K = input().split() A = int(A) B = int(B) K = int(K) for i = 0; i < K; i++: if i % 2 == 0: B += A /2 A /= 2 else: A += B / 2 B /= 2 print(A + " " + B)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s053268224
Accepted
p03228
Input is given from Standard Input in the following format: A B K
def b_exchange(A, B, K): takahashi_cookie = A aoki_cookie = B turn = 0 while turn < K: if turn % 2 == 0: if takahashi_cookie % 2 == 1: takahashi_cookie -= 1 takahashi_cookie //= 2 aoki_cookie += takahashi_cookie else: if aoki_cookie % 2 == 1: aoki_cookie -= 1 aoki_cookie //= 2 takahashi_cookie += aoki_cookie turn += 1 ans = "{0} {1}".format(takahashi_cookie, aoki_cookie) return ans A, B, K = [int(i) for i in input().split()] print(b_exchange(A, B, K))
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s042782340
Accepted
p03228
Input is given from Standard Input in the following format: A B K
p = {1: 0, -1: 0} p[1], p[-1], k = map(int, input().rstrip().split()) i = 1 for _ in range(k): p[i] //= 2 p[i * -1] += p[i] i *= -1 print(p[1], p[-1])
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s257704330
Accepted
p03228
Input is given from Standard Input in the following format: A B K
*x, K = map(int, input().split()) for i in ([0, 1] * K)[:K]: x[i] //= 2 x[~i] += x[i] print(*x)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s739777105
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
a, b, k = [ int(v) for v in input().split() ] for i in range(k): if i % 2 == 0: a = a // 2 b += a // 2 else: a += b // 2 b = b // 2 print(a,b)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s279398774
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
A,B,K = map(int(),input().rstrip().split()) for i in range(K): if i % 2 == 0: B = B + A/2 A = A/2 else: A = A + B/2 B=B/2 print (A,B)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s460848035
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
A, B, K = map(int, input().split()) If K%2!=0: if A%2!=0; A-=1 B+=A//2 else: if B%2!=0; B-=1 A+=B//2 print(A, B)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s703277421
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
data = input().split() A = int(data[0]) B = int(data[1]) K = int(data[2]) while K >= 1: if A % 2 == 0: B += A / 2 else: A -= 1 B += A / 2 K-- print(A + " " + B)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s205698689
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
a, b, c = (int(i) for i in input().split()) for i in range(c) if(i%2==0): a=a//2 b=b+a//2 else: b=b//2 a=a+b//2 print(a,b)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s935693737
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
A, B, K = map(int, input().split()) for i in range(K): if i%2 ==0 : if A%2 != 0; A-=1 B+=A//2 A=A//2 else: if B%2 !=0 ; B-=1 A+=B//2 B=B//2 print(A, B)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s329154866
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
A, B, K = map(int, input().split()) for _ in range(K): if K%2!=0: if A%2!=0; A-=1 B+=A//2 else: if B%2!=0; B-=1 A+=B//2 print(A, B)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s616625939
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
A, B, K = map(int, input().split()) for i in range(K): if i%2==0: if A%2!=0; A-=1 B+=A//2 else: if B%2!=0; B-=1 A+=B//2 print(A, B)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s084326902
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
A, B, K = map(int, input().split()) for i in range(K): if i%2!=0: if A%2!=0; A-=1 B+=A//2 A=A//2 else: if B%2!=0; B-=1 A+=B//2 B=B//2 print(A, B)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s698897867
Wrong Answer
p03228
Input is given from Standard Input in the following format: A B K
Anm, Bnm, Cou = map(int, input().split(" ")) for i in range(Cou): if (Anm) % 2 == 1: Anm -= 1 Anm = Anm / 2 Bnm += Anm if (Bnm) % 2 == 1: Bnm -= 1 Bnm = Bnm / 2 Anm += Bnm print(round(Anm), round(Bnm))
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s554028584
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
A, B, K = map(int, input().split()) for i in range(K): if i%2!=0: if A%2!=0; A-=1 B+=A//2 else: if B%2!=0; B-=1 A+=B//2 print(A, B)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total. * * *
s405437225
Runtime Error
p03228
Input is given from Standard Input in the following format: A B K
A, B, K = input().split() A = int(A) B = int(B) K = int(K) while K >= 1 && A >= 1 && B >= 1: if A % 2 == 0: B += A / 2 A = A / 2 else: A -= 1 B += A / 2 A = A / 2 if B % 2 == 0: A += B / 2 B = B /2 else: B -= 1 A += B / 2 B = B /2 K -= 1 print(A + " " + B)
Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi: * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person. Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.
[{"input": "5 4 2", "output": "5 3\n \n\nThe process will go as follows:\n\n * In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n * Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n * Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\n* * *"}, {"input": "3 3 3", "output": "1 3\n \n\n* * *"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}]
Print N lines. The i-th line is for scenario of replacing the rook at (X_i, Y_i) with your king. This line should contain one integer: the minimum number of moves to beat M_i rooks where M_i denotes the maximum possible number of beaten rooks in this scenario (in infinite time). * * *
s344221580
Wrong Answer
p02593
Input is given from Standard Input in the following format. N X_1 Y_1 X_2 Y_2 \vdots X_N Y_N
print("わかりましぇん")
Statement You are given positions (X_i, Y_i) of N enemy rooks on an infinite chessboard. No two rooks attack each other (at most one rook per row or column). You're going to replace one rook with a king and then move the king repeatedly to beat as many rooks as possible. You can't enter a cell that is being attacked by a rook. Additionally, you **can't move diagonally to an empty cell** (but you can beat a rook diagonally). (So this king moves like a superpawn that beats diagonally in 4 directions and moves horizontally/vertically in 4 directions.) For each rook, consider replacing it with a king, and find the minimum possible number of moves needed to beat the maximum possible number of rooks.
[{"input": "6\n 1 8\n 6 10\n 2 7\n 4 4\n 9 3\n 5 1", "output": "5\n 0\n 7\n 5\n 0\n 0\n \n\nSee the drawing below. If we replace rook 3 with a king, we can beat at most\ntwo other rooks. The red path is one of optimal sequences of moves: beat rook\n1, then keep going down and right until you can beat rook 4. There are 7 steps\nand that's the third number in the output.\n\n![path](https://img.atcoder.jp/agc047/rooks_path_small3.png)\n\n_x-coordinate increases from left to right, while y increases bottom to top._\n\nStarting from rook 2, 5 or 6, we can't beat any other rook. The optimal number\nof moves is 0.\n\n* * *"}, {"input": "5\n 5 5\n 100 100\n 70 20\n 81 70\n 800 1", "output": "985\n 985\n 1065\n 1034\n 0\n \n\n* * *"}, {"input": "10\n 2 5\n 4 4\n 13 12\n 12 13\n 14 17\n 17 19\n 22 22\n 16 18\n 19 27\n 25 26", "output": "2\n 2\n 9\n 9\n 3\n 3\n 24\n 5\n 0\n 25"}]
Print N lines. The i-th line is for scenario of replacing the rook at (X_i, Y_i) with your king. This line should contain one integer: the minimum number of moves to beat M_i rooks where M_i denotes the maximum possible number of beaten rooks in this scenario (in infinite time). * * *
s556641086
Wrong Answer
p02593
Input is given from Standard Input in the following format. N X_1 Y_1 X_2 Y_2 \vdots X_N Y_N
#
Statement You are given positions (X_i, Y_i) of N enemy rooks on an infinite chessboard. No two rooks attack each other (at most one rook per row or column). You're going to replace one rook with a king and then move the king repeatedly to beat as many rooks as possible. You can't enter a cell that is being attacked by a rook. Additionally, you **can't move diagonally to an empty cell** (but you can beat a rook diagonally). (So this king moves like a superpawn that beats diagonally in 4 directions and moves horizontally/vertically in 4 directions.) For each rook, consider replacing it with a king, and find the minimum possible number of moves needed to beat the maximum possible number of rooks.
[{"input": "6\n 1 8\n 6 10\n 2 7\n 4 4\n 9 3\n 5 1", "output": "5\n 0\n 7\n 5\n 0\n 0\n \n\nSee the drawing below. If we replace rook 3 with a king, we can beat at most\ntwo other rooks. The red path is one of optimal sequences of moves: beat rook\n1, then keep going down and right until you can beat rook 4. There are 7 steps\nand that's the third number in the output.\n\n![path](https://img.atcoder.jp/agc047/rooks_path_small3.png)\n\n_x-coordinate increases from left to right, while y increases bottom to top._\n\nStarting from rook 2, 5 or 6, we can't beat any other rook. The optimal number\nof moves is 0.\n\n* * *"}, {"input": "5\n 5 5\n 100 100\n 70 20\n 81 70\n 800 1", "output": "985\n 985\n 1065\n 1034\n 0\n \n\n* * *"}, {"input": "10\n 2 5\n 4 4\n 13 12\n 12 13\n 14 17\n 17 19\n 22 22\n 16 18\n 19 27\n 25 26", "output": "2\n 2\n 9\n 9\n 3\n 3\n 24\n 5\n 0\n 25"}]
Print the minimum and maximum values separated by a space in a line.
s576976315
Accepted
p02439
The input is given in the following format. $a \; b \; c\;$ Three integers $a, b, c$ are given in a line.
inp = list(map(int, input().split())) print("{} {}".format(min(inp), max(inp)))
Min-Max For given three integers $a, b, c$, print the minimum value and the maximum value.
[{"input": "4 5 3", "output": "3 5"}]
Print the minimum and maximum values separated by a space in a line.
s860984654
Accepted
p02439
The input is given in the following format. $a \; b \; c\;$ Three integers $a, b, c$ are given in a line.
x = list(map(int, input().split())) print(min(x), max(x))
Min-Max For given three integers $a, b, c$, print the minimum value and the maximum value.
[{"input": "4 5 3", "output": "3 5"}]
Print the minimum and maximum values separated by a space in a line.
s794738733
Accepted
p02439
The input is given in the following format. $a \; b \; c\;$ Three integers $a, b, c$ are given in a line.
A = list(map(int, input().split())) print(min(A), max(A))
Min-Max For given three integers $a, b, c$, print the minimum value and the maximum value.
[{"input": "4 5 3", "output": "3 5"}]
Print the minimum and maximum values separated by a space in a line.
s736634426
Accepted
p02439
The input is given in the following format. $a \; b \; c\;$ Three integers $a, b, c$ are given in a line.
n = list(map(int, input().split())) print(min(n), max(n))
Min-Max For given three integers $a, b, c$, print the minimum value and the maximum value.
[{"input": "4 5 3", "output": "3 5"}]
Print the minimum and maximum values separated by a space in a line.
s886567291
Accepted
p02439
The input is given in the following format. $a \; b \; c\;$ Three integers $a, b, c$ are given in a line.
num = list(map(int, input().split())) print(min(num), max(num))
Min-Max For given three integers $a, b, c$, print the minimum value and the maximum value.
[{"input": "4 5 3", "output": "3 5"}]
Print the minimum and maximum values separated by a space in a line.
s933013718
Accepted
p02439
The input is given in the following format. $a \; b \; c\;$ Three integers $a, b, c$ are given in a line.
temp = list(map(int, input().split())) print(min(temp), max(temp))
Min-Max For given three integers $a, b, c$, print the minimum value and the maximum value.
[{"input": "4 5 3", "output": "3 5"}]
Print the minimum and maximum values separated by a space in a line.
s582592557
Accepted
p02439
The input is given in the following format. $a \; b \; c\;$ Three integers $a, b, c$ are given in a line.
l = [int(x) for x in input().split()] print("{} {}".format(min(l), max(l)))
Min-Max For given three integers $a, b, c$, print the minimum value and the maximum value.
[{"input": "4 5 3", "output": "3 5"}]
Print the minimum and maximum values separated by a space in a line.
s129385618
Accepted
p02439
The input is given in the following format. $a \; b \; c\;$ Three integers $a, b, c$ are given in a line.
a, b, c = map(int, input().split()) print(min(a, b, c), max(a, b, c))
Min-Max For given three integers $a, b, c$, print the minimum value and the maximum value.
[{"input": "4 5 3", "output": "3 5"}]
Print the minimum and maximum values separated by a space in a line.
s439139062
Accepted
p02439
The input is given in the following format. $a \; b \; c\;$ Three integers $a, b, c$ are given in a line.
a = sorted(list(map(int, input().split()))) print(a[0], a[-1])
Min-Max For given three integers $a, b, c$, print the minimum value and the maximum value.
[{"input": "4 5 3", "output": "3 5"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s656972009
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
#include<iostream> #include<iomanip> #include<cmath> #include<string> #include<cstring> #include<vector> #include<list> #include<algorithm> #include<map> #include<set> #include<queue> #include<stack> using namespace std; typedef long long ll; #define fi first #define se second #define mp make_pair #define mt make_tuple #define pqueue priority_queue const int inf=1e9+7; const ll mod=1e9+7; const ll mod1=998244353; const ll big=1e18; const double PI=2*asin(1); int main() { int A, B; cin>>A>>B; if(A+B>=10) cout<<"error"<<endl; else cout<<A+B<<endl; }
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s453262833
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
import java.util.*; class Main { public static void main(String args[]) { Scanner inp = new Scanner(System.in); int a = inp.nextInt(); int b = inp.nextInt(); inp.close(); System.out.println((a + b) < 10 ? a + b : "error"); } }
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s755215999
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a=input()strip().split(" ") b=[int(i) for i in a] c=b[0]+c[1] if(c>=10): print("error") else: print(c)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s657637903
Accepted
p03697
Input is given from Standard Input in the following format: A B
ab = sum(map(int, input().split())) print("error" if ab >= 10 else ab)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s533766686
Accepted
p03697
Input is given from Standard Input in the following format: A B
r = eval(input().replace(" ", "+")) print("error" if r >= 10 else r)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s167614749
Accepted
p03697
Input is given from Standard Input in the following format: A B
N, K = map(int, input().split()) print(N + K if N + K < 10 else "error")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s451617513
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
print(s if s < 10 else "error" for s in [sum(list(map(int, input.split())))])
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s846350395
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b=map(int,input().split()) if a+b>=10: print('error') else: print(a+b
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s826676693
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a, b = map(int, input().split()) if a + b < 10: print(a + b): else: print("error")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s460611242
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b = int(input().split()) sum = a+b if(sum>=10): print("error") else: print(sum)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s698300441
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a, b = map(int, input().split()) if a + b >= 10: print("error") else: print(sum(a + b)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s598694764
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b = int(input().split()) sum = a+b if(sum>=10): print("error") else: print(sum)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s614713327
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
s = input().split() if (int(s[0]) + int(s[1])>=10): print('error') else : print(int(s[0]) + int(s[1]))
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s795816644
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
文字列を取り込む。 文字数を数える。 文字列をソートする。 最初の文字と二番目の文字が同じかどうか確認する。 同じならば'NO'を出力する。 違うならば二番目の文字列と三番目の文字列が同じかどうか確認する。 同じならば'NO'を出力する。 ・ ・ ・ 最後から一つ前の文字と最後の文字を確認して違うならば 'YES'を出力する。
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s005137928
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
A, B = map(int, input().split()) total = A+B if A >= 1 and B <= : if total < 10: print(total) else: print('error')
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s274608208
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
A,B = map(int, input().split()) A_B = (A+B) if A_B < 10: print(A_B) elif A_B > 10: print("error") elif A_B = 10: print("error")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s143770077
Wrong Answer
p03697
Input is given from Standard Input in the following format: A B
s = input() h = [] res = True for c in s: if c in h: res = False break else: h.append(c) print("yes" if res else "no")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s153802827
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
N, A, B = list(map(int, input().split())) H = [int(input()) for _ in range(N)] from math import ceil def can_korosu(t): count = 0 for h in H: count += ceil(max(0, h - t * B) / (A - B)) if count > t: return False return True lo = 0 hi = 10**9 p = (lo, hi) for _ in range(50): mid = (hi + lo) // 2 if can_korosu(mid): hi = mid else: lo = mid if p == (lo, hi): break p = (lo, hi) print(hi)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s789801199
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
import numpy as np import fractions as fra h,w=map(int,input().split()) if(h+w>=10): print("error"): else: print(h+w)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s246279831
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
import sys import copy import math from _bisect import * from collections import * from operator import itemgetter from math import factorial """ from fractions import gcd def lcm(x, y): return (x * y) // gcd(x, y) """ stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline() a, b = na() print(a + b if a + b 10 else 'error')
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s304913042
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
# -*- coding: utf-8 -*- import sys import subprocess import json import time import math import re import sqlite3 A, B = map(int, input().split()) if A + B >= 10: print("error") else print(A+B)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s681154959
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
fn read() -> (i32, i32) { let mut s = String::new(); std::io::stdin().read_line(&mut s).unwrap(); let vec: Vec<i32> = s .trim() .split_whitespace() .map(|x| x.parse().unwrap()) .collect(); (vec[0], vec[1]) } fn main() { let (a, b) = read(); if a + b < 10 { println!("{}", a + b); } else { println!("error"); } }
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s773487029
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b = map(int,input().split())) if a+b >= 10: print("error") else: print(a+b)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s557739762
Accepted
p03697
Input is given from Standard Input in the following format: A B
S = sum(map(int, input().split())) print("error" if S >= 10 else S)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s187161528
Accepted
p03697
Input is given from Standard Input in the following format: A B
x = input() z = eval(x[0] + "+" + x[2]) print(z // 10 * "error" or z)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s008155911
Accepted
p03697
Input is given from Standard Input in the following format: A B
n = eval(input().replace(" ", "+")) print([n, "error"][n > 9])
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s416801306
Accepted
p03697
Input is given from Standard Input in the following format: A B
N = sum(map(int, input().split())) print(N if N < 10 else "error")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s236183116
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b = input() if (a + b) >= 10: print("error) else: print(a + b)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s075094799
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
print(["error", A + B], [eval(input().replace(" ", "+")) < 10])
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s184954826
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b= map(int,inpit()split()) print(a+b if a+b<10 else "error")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s236951137
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
print(["error", A + B], [sum(list(map(int, input().split()))) < 10])
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s753252061
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b=map(int,input().split()) if a+b>=10:print('error') else:print(a+b)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s731544912
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a, b = map(int, input().split()) print('error' if a+b >= 10 else a+b
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s224299758
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
A, B = map(int, input().split()) print(["error", A + B] A + B < 10)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s887074532
Wrong Answer
p03697
Input is given from Standard Input in the following format: A B
S = input() print(["no", "yes"][len(set(S)) == len(S)])
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s003478678
Wrong Answer
p03697
Input is given from Standard Input in the following format: A B
k = eval(input().replace(" ", "+")) print(k if k <= 10 else "error")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s695144117
Accepted
p03697
Input is given from Standard Input in the following format: A B
num = sum(list(map(int, input().split()))) print("error" if num >= 10 else num)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s866306823
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
A < B = map(int, input().split()) if A + B > 9: print("error") else: print(A + B)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s108552616
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b = map(int, input().split()) if (a+b) <= 9: print(a+b) else; print("error")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s102333150
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b=map(int,input().split()) if a+b >= 10:print('error') else:print(a+b)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s845548881
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b = map(int, input().split()) if (a+b) <= 9: print(a+b) else; print("error")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s050402720
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b = map(int, input().split()) if (a+b) <= 9: print(a+b) else; print("error")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s840012267
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
print("error") if sum(input().split()) >= 10 else print(sum(input().split()))
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s240163227
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a, b = map(int, input().split()) A = a + b if A < 10: print(A): else: print("error")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s177467326
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b=[int(i) for i in input().split()] c=a+b if c>=10: print(''error) else: print(c)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s105759505
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a, b = map(int, input().split()) if a+b >= 10: print('error') elif: print(a+b)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s178872089
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
A,B={int(x) for x in input().split(" ")} ans A+B printf("error" if ans >=10 else ans)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s154515566
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
A,B = int(i) for i in input().split() if A+B >= 10: print("error") else: print(A+B)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s229144219
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a=input()strip().split(" ") b=[int(i) for i in a] c=b[0]+b[1] if(c>=10): print("error") else: print(c)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s474236383
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
print(["error", A + B], [eval(input().split().replace(" ", "+")) < 10])
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s683060174
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a,b=map(int,input().split())) if a+b<10: print(a+b) else: print('error')
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s760750198
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
a=input() b=input() c=a+b if c>=10: print('error') else: print('c')
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s550680721
Wrong Answer
p03697
Input is given from Standard Input in the following format: A B
a, b = (int(_) for _ in input().split()) print("error") if a + b > 10 else print(a + b)
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s085156680
Runtime Error
p03697
Input is given from Standard Input in the following format: A B
print( ["error", eval(input().replace(" ", "+"))], [eval(input().replace(" ", "+")) < 10] )
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]
If A + B is 10 or greater, print the string `error` (case-sensitive); otherwise, print the value of A + B. * * *
s778856849
Accepted
p03697
Input is given from Standard Input in the following format: A B
num = [int(x) for x in input().split()] print(sum(num) if sum(num) < 10 else "error")
Statement You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead.
[{"input": "6 3", "output": "9\n \n\n* * *"}, {"input": "6 4", "output": "error"}]