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. * * *
s526839580
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
a,b=map(int,input().split()) print(a+1-b) //Source code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 charactersSource code should be longer than 50 characters
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s293609458
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
# coding: utf-8 # Your code here! N,A=map(int,input()split()) print(N-A+1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s500112752
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
N,i=int(input ("enter the number of cars and car )) X=N-i+1 Print(x)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s764072182
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
N,i=map(int,input().split()) if 1<=n<=100: if 1<=i<=n: print(N-i+1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s933826275
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
N = int(input()) A = list(map(int, input().split())) median_len = N * (N + 1) // 2 median = median_len // 2 + 1 a = 1 medin_rank = 1 for i in range(1, N): a = i * (i + 1) // 2 b = (i + 2) * (i + 1) // 2 if a <= median and b > median: medin_rank = i break rank_index = median - a median_list = [] l = medin_rank // 2 for i in range(N - medin_rank): median_list.append(A[l + i]) print(median_list[rank_index])
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s685976958
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
import java.util.*; public class Main { public static void main(String args[]) { // 入力 Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); int i = Integer.parseInt(sc.next()); // 主処理 int result = n - i + 1; // 出力 System.out.println(result); sc.close(); } }
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s012034554
Accepted
p03272
Input is given from Standard Input in the following format: N i
X = list(map(int, input().split())) print(X[0] - X[1] + 1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s898511622
Accepted
p03272
Input is given from Standard Input in the following format: N i
n = [int(i) for i in input().split()] print(n[0] - n[1] + 1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s239753245
Accepted
p03272
Input is given from Standard Input in the following format: N i
l = input().split(" ") print(int(l[0]) - int(l[1]) + 1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s546723774
Accepted
p03272
Input is given from Standard Input in the following format: N i
N, I = map(int, input().split(" ")) print(N - (I - 1))
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s223607969
Accepted
p03272
Input is given from Standard Input in the following format: N i
a, b = input().split(" ") print(int(a) - int(b) + 1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s644087323
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
a, b = list(input().strip().split(" ") print(b-a+1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s522895571
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
s=list(map(int,input().split())) print(s[0]-s[1]+1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s401186692
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
n i = map(int,input().split()) print((n - i) + 1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s534115813
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
n, i = map(int, input().split()) print(n - i + 1) 
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s881952063
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
print(int(input()) + 1 - int(input()))
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s193047561
Wrong Answer
p03272
Input is given from Standard Input in the following format: N i
print(eval("-".join(input())))
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s894421207
Accepted
p03272
Input is given from Standard Input in the following format: N i
inp = input().split(" ") print(int(inp[0]) - int(inp[1]) + 1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s442844655
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
k = int(input()) print(int((k / 2) ** 2) if k % 2 == 0 else int(((k / 2) - 0.5) * ((k / 2) + 0.5)))
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s398243381
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
H, W = map(int, input().split()) a = [] b = [] c = [] for i in range(H): a1 = input() if "#" in a1: a.append(a1) else: continue a = list(zip(*a)) l1 = len(a) for j in range(l1): b1 = a[j] if "#" in b1: b.append(b1) else: continue c = list(zip(*b)) l2 = len(c) for n in range(l2): print("".join(c[n]))
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s115523629
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
import sys H_W = list(map(int, input().split())) H = H_W[0] W = H_W[1] b = [[0 for i in range(W)] for j in range(H)] a = [[str(c) for c in l.strip()] for l in sys.stdin] # .を0に, #を1にした新しい配列bを作る for i in range(H): for j in range(W): if a[i][j] == "#": b[i][j] = 1 # 列と行ごとにすべて0のものを探す w = [0] * W h = [0] * H for i in range(H): for j in range(W): h[i] = h[i] + b[i][j] w[j] = w[j] + b[i][j] print(h) print(w) # 全ての要素が0の列と行を削除する i = 0 c = 0 j = 0 for i in range(H): if h[i] == 0: del a[j] H = H - 1 j = j - 1 j = j + 1 print(a) k = 0 for i in range(W): if w[i] == 0: for j in range(H): del a[j][k] print(a) W = W - 1 k = k - 1 k = k + 1 print(a) # 答え for i in range(H): flag = 0 for j in range(W): if flag == 0: ans = a[i][j] flag = 1 else: ans = ans + a[i][j] print(ans)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s291433813
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
import sys # 関数 solve は,もちろん,問題に応じて書き換える def solve(a, b): c=a-b+1 return(c) # ここから下は,入力・出力形式が同じであれば,変えなくて良い. def readQuestion(): line = sys.stdin.readline().rstrip() [str_a, str_b] = line.split(' ') return (int(str_a), int(str_b)) def main(): a, b = readQuestion() answer = solve(a, b) print(answer) if __name__ == '__main__': main()
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s286360305
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
i = list(map(int, input(), split())) print(i[0] - i[1] + 1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s265086474
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
import math N, K = map(int, input().split()) a = list(map(int, input().split())) l = 0 r = K - 1 Min = float("inf") for i in range(N - K + 1): if a[l] * a[r] <= 0: # 原点を跨ぐとき Min = min(Min, abs(a[l]) + abs(a[l] - a[r]), abs(a[r]) + abs(a[r] - a[l])) elif l == 0: # 左端の時 if a[r] * a[r + 1] < 0 or a[0] > 0: Min = min(Min, abs(a[l]) + abs(a[l] - a[r]), abs(a[r]) + abs(a[r] - a[l])) elif r == N - 1: # 右端の時 if a[l - 1] * a[l] < 0 or a[l] > 0: Min = min(Min, abs(a[l]) + abs(a[l] - a[r]), abs(a[r]) + abs(a[r] - a[l])) else: if a[r] * a[r + 1] < 0 or a[l - 1] * a[l] < 0: Min = min(Min, abs(a[l]) + abs(a[l] - a[r]), abs(a[r]) + abs(a[r] - a[l])) l = l + 1 r = r + 1 print(Min)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s589294990
Accepted
p03272
Input is given from Standard Input in the following format: N i
N, Y = [int(i) for i in input().split()] print(N - Y + 1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the answer. * * *
s238200100
Runtime Error
p03272
Input is given from Standard Input in the following format: N i
a=list(map(int(input().split())) print(a[0]-a[1]+1)
Statement There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."
[{"input": "4 2", "output": "3\n \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n \n\n* * *"}, {"input": "15 11", "output": "5"}]
Print the number of strings that satisfy the conditions, modulo 998244353. * * *
s399793590
Runtime Error
p02875
Input is given from Standard Input in the following format: N
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**8) input = sys.stdin.readline MOD = 998244353 MAX_N = 10**6 fac = [1] + [0] * MAX_N fac_inv = [1] + [0] * MAX_N mod_pow2_n = [1] + [0] * MAX_N f = 1 finv = 1 p2 = 1 for i in range(1, MAX_N + 1): # fac[i] = fac[i-1] * i % MOD f *= i f %= MOD fac[i] = f # Fermat's little theorem says # a**(p-1) mod p == 1 # then, a * a**(p-2) mod p == 1 # it means a**(p-2) is inverse element # fac_inv[i] = fac_inv[i-1] * pow(i, MOD-2, MOD) % MOD finv *= pow(i, MOD - 2, MOD) finv %= MOD fac_inv[i] = finv p2 *= 2 p2 %= MOD mod_pow2_n[i] = p2 def mod_nCr(n, r): if n < r or n < 0 or r < 0: return 0 tmp = fac_inv[n - r] * fac_inv[r] % MOD return tmp * fac[n] % MOD def single_mod_nCr(n, r): if n < r or n < 0 or r < 0: return 0 if r > n - r: r = n - r ret = 1 for i in range(r): ret *= n - i ret *= pow(i + 1, MOD - 2, MOD) ret %= MOD return ret n = int(input()) ans = 0 for i in range(n // 2 + 1, n + 1): ans += mod_nCr(n, i) * mod_pow2_n[n - i] ans %= MOD print((pow(3, n, MOD) - ans * 2 + MOD) % MOD)
Statement Given is a positive even number N. Find the number of strings s of length N consisting of `A`, `B`, and `C` that satisfy the following condition: * s can be converted to the empty string by repeating the following operation: * Choose two consecutive characters in s and erase them. However, choosing `AB` or `BA` is not allowed. For example, `ABBC` satisfies the condition for N=4, because we can convert it as follows: `ABBC` → (erase `BB`) → `AC` → (erase `AC`) → `(empty)`. The answer can be enormous, so compute the count modulo 998244353.
[{"input": "2", "output": "7\n \n\nExcept `AB` and `BA`, all possible strings satisfy the conditions.\n\n* * *"}, {"input": "10", "output": "50007\n \n\n* * *"}, {"input": "1000000", "output": "210055358"}]
Print the number of strings that satisfy the conditions, modulo 998244353. * * *
s499053731
Wrong Answer
p02875
Input is given from Standard Input in the following format: N
def main(): mod = 998244353 n = int(input()) Fact = [1] for i in range(1, n + 1): Fact.append(Fact[i - 1] * i % mod) Finv = [0] * (n + 1) Finv[-1] = pow(Fact[-1], mod - 2, mod) for i in range(n - 1, -1, -1): Finv[i] = Finv[i + 1] * (i + 1) % mod def comb(n, r): if n < r: return 0 return Fact[n] * Finv[r] * Finv[n - r] % mod impossible = 0 for k in range(n // 2 + 1, n + 1): impossible += comb(n, k) * pow(2, n - k, mod) impossible %= mod print(pow(3, n, mod) - impossible * 2) if __name__ == "__main__": main()
Statement Given is a positive even number N. Find the number of strings s of length N consisting of `A`, `B`, and `C` that satisfy the following condition: * s can be converted to the empty string by repeating the following operation: * Choose two consecutive characters in s and erase them. However, choosing `AB` or `BA` is not allowed. For example, `ABBC` satisfies the condition for N=4, because we can convert it as follows: `ABBC` → (erase `BB`) → `AC` → (erase `AC`) → `(empty)`. The answer can be enormous, so compute the count modulo 998244353.
[{"input": "2", "output": "7\n \n\nExcept `AB` and `BA`, all possible strings satisfy the conditions.\n\n* * *"}, {"input": "10", "output": "50007\n \n\n* * *"}, {"input": "1000000", "output": "210055358"}]
Print the answer. * * *
s585277356
Accepted
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
n, a = open(0) print(sum(sorted(map(int, a.split()))[int(n) :: 2]))
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s383635325
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
N = int(input()) A = sorted(list(map(int, input().split()))) print(sum(A[N:2*N])
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s172215824
Accepted
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
import sys ## io ## def IS(): return sys.stdin.readline().rstrip() def II(): return int(IS()) def MII(): return list(map(int, IS().split())) def MIIZ(): return list(map(lambda x: x - 1, MII())) ## dp ## def DD2(d1, d2, init=0): return [[init] * d2 for _ in range(d1)] def DD3(d1, d2, d3, init=0): return [DD2(d2, d3, init) for _ in range(d1)] ## math ## def to_bin(x: int) -> str: return format(x, "b") # rev => int(res, 2) def to_oct(x: int) -> str: return format(x, "o") # rev => int(res, 8) def to_hex(x: int) -> str: return format(x, "x") # rev => int(res, 16) MOD = 10**9 + 7 def divc(x, y) -> int: return -(-x // y) def divf(x, y) -> int: return x // y def gcd(x, y): while y: x, y = y, x % y return x def lcm(x, y): return x * y // gcd(x, y) def enumerate_divs(n): """Return a tuple list of divisor of n""" return [(i, n // i) for i in range(1, int(n**0.5) + 1) if n % i == 0] def get_primes(MAX_NUM=10**3): """Return a list of prime numbers n or less""" is_prime = [True] * (MAX_NUM + 1) is_prime[0] = is_prime[1] = False for i in range(2, int(MAX_NUM**0.5) + 1): if not is_prime[i]: continue for j in range(i * 2, MAX_NUM + 1, i): is_prime[j] = False return [i for i in range(MAX_NUM + 1) if is_prime[i]] ## libs ## from itertools import accumulate as acc from collections import deque, Counter from heapq import heapify, heappop, heappush from bisect import bisect_left # ======================================================# def main(): n = II() aa = MII() aa.sort(reverse=True) print(sum(aa[1 : 2 * n : 2])) if __name__ == "__main__": main()
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s399299349
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
n, m = map(int, input().split()) edges = [list(map(lambda x: int(x) - 1, input().split())) for _ in range(m)] edges += [[i, i] for i in range(n)] q = int(input()) color = [0] * q dp = [[0 for j in range(n)] for i in range(11)] for i in range(q): v, d, color[i] = map(int, input().split()) dp[d][v - 1] = i for i in reversed(range(1, 11)): for u, v in edges: dp[i - 1][u] = max(dp[i - 1][u], dp[i][v]) dp[i - 1][v] = max(dp[i - 1][v], dp[i][u]) print(*[color[dp[0][i]] for i in range(n)], sep="\n")
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s815435596
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
#!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import bisect_left, bisect_right import sys, random, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return list(map(float, input().split())) def LI_(): return list(map(lambda x: int(x)-1, input().split())) def II(): return int(input()) def IF(): return float(input()) def LS(): return list(map(list, input().split())) def S(): return list(input().rstrip()) def IR(n): return [II() for _ in range(n)] def LIR(n): return [LI() for _ in range(n)] def FR(n): return [IF() for _ in range(n)] def LFR(n): return [LI() for _ in range(n)] def LIR_(n): return [LI_() for _ in range(n)] def SR(n): return [S() for _ in range(n)] def LSR(n): return [LS() for _ in range(n)] mod = 1000000007 inf = 1e10 #solve def solve(): n = II() a = LI() a.sort( print(sum[n::2]) return #main if __name__ == '__main__': solve()
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s411158797
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
a =int(input()) x =list(map(int, input().split())) x.sort() s=0 for i in reversed(range(1,(a+1)//3,1): s+=x[i] print(s)
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s833119494
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
N = int(input()) a = sorted(map(int, input().split())) [::-1] ans = 0 for i in range(0, 3N, 2): ans += a[i+1] print(ans)
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s769085937
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
a =int(input()) x =list(map(int, input().split())) x.sort() s=0 for I in reversed(range(1,a//3,1): s+=x[i] print(s)
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s314420430
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
a =int(input()) x =list(map(int, input().split())) x.sort() s=0 for i in reversed(range(0,a//3,1): s+=x[i+1] print(s)
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s516175792
Accepted
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
n, *lst = map(int, open(0).read().split()) lst.sort(reverse=1) print(sum(lst[1 : 1 + 2 * n : 2]))
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s364697909
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
n,a=int(input()),sorted(list(map(int,input().split())))print(sum([a[i]*(i%3==1)for i in range(3*n)]))
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s153697162
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
N=int(input()) a=list(map(int,input().split())) a.sort(reverse=True) print(sum(N//3:2N//3))
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s374358538
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
n = int(input()) data = list(map(int,input().split())) data = sorted(data, reverse=True) sum = 0 while data != [] del data[0] del data[-1] sum += data[0] del data[0] print(sum)
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s850821103
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
10 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s751137150
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # """ agc012 C """ n, m = map(int, input().split()) graph = [[] for i in range(n + 1)] for i in range(m): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) q = int(input()) qlist = [tuple(map(int, input().split())) for i in range(q)] qlist.reverse() dp = [[-1] * 11 for i in range(n + 1)] col = [0] def updatedp(v, t, d): if dp[v][d] == -1: dp[v][d] = t if d > 0: updatedp(v, t, d - 1) for u in graph[v]: updatedp(u, t, d - 1) t = 0 for v, d, c in qlist: col.append(c) updatedp(v, t, d) t += 1 for i in range(1, n + 1): print(col[dp[i][0] + 1])
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s706468799
Accepted
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
i = input n = i() print(sum(sorted(map(int, i().split()))[int(n) :][::2]))
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s745721751
Wrong Answer
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
n = int(input()) List = list(map(int, input().split())) List = sorted(List) print(sum(List[(n + 1) : (n * 2 + 1)]))
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s941377167
Wrong Answer
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
n = int(input()) aList = list(map(int, input().split())) aList.sort() print(sum(aList[n + 1 : 2 * n + 1]))
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s666942654
Wrong Answer
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
# -*- coding: UTF-8 -*- N = int(input()) d = list(map(int, input().split(" "))) d.sort(reverse=True) _ans = [] for i in range(N - 1): _ans.append(d[2 * i + 1]) print(sum(_ans))
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s726031183
Accepted
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
n, a = int(input()), sorted(list(map(int, input().split())), reverse=True) print(sum([a[2 * i + 1] for i in range(n)]))
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s712230460
Accepted
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
# -*- coding: utf-8 -*- import sys import math import os import itertools import string import heapq import _collections from collections import Counter from collections import defaultdict from functools import lru_cache import bisect import re import queue class Scanner: @staticmethod def int(): return int(sys.stdin.readline().rstrip()) @staticmethod def string(): return sys.stdin.readline().rstrip() @staticmethod def map_int(): return [int(x) for x in Scanner.string().split()] @staticmethod def string_list(n): return [input() for i in range(n)] @staticmethod def int_list_list(n): return [Scanner.map_int() for i in range(n)] @staticmethod def int_cols_list(n): return [int(input()) for i in range(n)] class Math: @staticmethod def gcd(a, b): if b == 0: return a return Math.gcd(b, a % b) @staticmethod def lcm(a, b): return (a * b) // Math.gcd(a, b) @staticmethod def roundUp(a, b): return -(-a // b) @staticmethod def toUpperMultiple(a, x): return Math.roundUp(a, x) * x @staticmethod def toLowerMultiple(a, x): return (a // x) * x @staticmethod def nearPow2(n): if n <= 0: return 0 if n & (n - 1) == 0: return n ret = 1 while n > 0: ret <<= 1 n >>= 1 return ret @staticmethod def sign(n): if n == 0: return 0 if n < 0: return -1 return 1 @staticmethod def isPrime(n): if n < 2: return False if n == 2: return True if n % 2 == 0: return False d = int(n**0.5) + 1 for i in range(3, d + 1, 2): if n % i == 0: return False return True class PriorityQueue: def __init__(self, l=[]): self.__q = l heapq.heapify(self.__q) return def push(self, n): heapq.heappush(self.__q, n) return def pop(self): return heapq.heappop(self.__q) MOD = int(1e09) + 7 INF = int(1e15) def main(): # sys.stdin = open("sample.txt") N = Scanner.int() A = Scanner.map_int() A.sort(reverse=True) print(sum(A[1 : N * 2 : 2])) return if __name__ == "__main__": main()
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s297021914
Wrong Answer
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
# AGC 012 A - AtCoder Group Contest N = int(input()) an = list(map(int, input().split())) ak = [] while len(an) > 0: ak.append(min(an)) del an[an.index(min(an))] lists = [[] for _ in range(N)] while len(ak) > 0: for k in range(N): lists[k].append(min(ak)) del ak[ak.index(min(ak))] sasa = 0 for j in range(N): sasa += lists[j][1] print(sasa)
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s094794928
Runtime Error
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
N = int(input()) A = sorted(map(int, input().split())) print(sum(A[N:2*N])
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s466676711
Wrong Answer
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
N = int(input()) INT_LIST_SORETED = sorted([int(s) for s in input().split()]) SECOND_INT_LIST_MAX = [ val for idx, val in enumerate(INT_LIST_SORETED) if idx >= N and idx % 2 == 0 ] print(sum(SECOND_INT_LIST_MAX))
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s979368984
Accepted
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
num = 3 * int(input()) target = [int(n) for n in input().split(" ")] target.sort() third = num // 3 answer = 0 temp = 0 for i in range(third): answer += target[num - (2 * (i + 1))] temp += target[third + i] # print(num - (2 * (i+1))) print(max(answer, temp))
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the answer. * * *
s358768336
Accepted
p03767
Input is given from Standard Input in the following format: N a_1 a_2 ... a_{3N}
print( sum( sorted( list( [float(None == exec("N=int(input())"))] + list(map(int, input().split())) ), reverse=True, key=lambda x: 10**10 if type(x) == float else x, )[2 : 2 * N + 1 : 2] ) )
Statement There are 3N participants in _AtCoder Group Contest_. The _strength_ of the i-th participant is represented by an integer a_i. They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second largest strength among its members. For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3. Find the maximum possible sum of the strengths of N teams.
[{"input": "2\n 5 2 8 5 1 5", "output": "10\n \n\nThe following is one formation of teams that maximizes the sum of the\nstrengths of teams:\n\n * Team 1: consists of the first, fourth and fifth participants.\n * Team 2: consists of the second, third and sixth participants.\n\n* * *"}, {"input": "10\n 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "10000000000\n \n\nThe sum of the strengths can be quite large."}]
Print the largest value among A+B, A-B and A \times B. * * *
s612962802
Accepted
p03337
Input is given from Standard Input in the following format: A B
x, y = map(int, input().split()) print(max(x * y, x + y, x - y))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s588219805
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a, b = map(int, input().split()) print(max(a + b, a=b, a * b))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s869564397
Accepted
p03337
Input is given from Standard Input in the following format: A B
i = list(map(int, input().split())) print(max(i[0] + i[1], i[0] - i[1], i[0] * i[1]))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s217214341
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a, b, c = list(map(int, input().split())) my_result = max(a + b, a - b, a * b) print(my_result)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s821974249
Accepted
p03337
Input is given from Standard Input in the following format: A B
a = input() print(max(eval(a.replace(" ", k)) for k in "+-*"))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s423256397
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a,b = map(int, input().split()) print(max(a+b,max(a-b,a*b))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s834071073
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
A, B = map(int, input().split()) print(max(A + B, A−B, A * B))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s771101476
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
A, B = map(int, input().split()) print(max([A + B, A−B, A * B]))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s160016767
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a,b = map(int, input().split()) print(min(a+b,min(a-b,a*b))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s724528698
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a, b = map(int, input().split()) print(max(a+b, a-b, a*b)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s428330268
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
A, B = map(int, input().split()) print(max([A + B, A−B, A×B]))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s226763361
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
A, B = map(int, input().split()) print(max(A + B, A−B, A * B))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s099753847
Accepted
p03337
Input is given from Standard Input in the following format: A B
#!/usr/bin/env python3 import sys # 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 gcd # for Python 3.4 (previous contest @AtCoder) def main(): mod = 1000000007 # 10^9+7 inf = float("inf") # sys.float_info.max = 1.79...e+308 # inf = 2 ** 64 - 1 # (for fast JIT compile in PyPy) 1.84...e+19 sys.setrecursionlimit(10**6) # 1000 -> 1000000 def input(): return sys.stdin.readline().rstrip() def ii(): return int(input()) 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()) a, b = mi() print(max(a + b, a - b, a * b)) if __name__ == "__main__": main()
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s423034454
Accepted
p03337
Input is given from Standard Input in the following format: A B
import math import queue import bisect import heapq import time import itertools mod = int(1e9 + 7) def swap(a, b): return (b, a) def my_round(a, dig=0): p = 10**dig return (a * p * 2 + 1) // 2 / p def gcd(a, b): # 最大公約数 if a < b: a, b = swap(a, b) if b == 0: return a else: return gcd(b, a % b) def lcm(a, b): # 最小公倍数 return a / gcd(a, b) * b def divisors(a): # 約数列挙 divisors = [] for i in range(1, int(a**0.5) + 1): if a % i == 0: divisors.append(i) if i != a // i: divisors.append(a // i) return divisors def is_prime(a): # 素数判定 if a < 2: return False elif a == 2: return True elif a % 2 == 0: return False sqrt_num = int(a**0.5) for i in range(3, sqrt_num + 1, 2): if a % i == 0: return False return True def prime_num(a): # 素数列挙 pn = [2] for i in range(3, int(a**0.5), 2): prime = True for j in pn: if i % j == 0: prime = False break if prime: pn.append(i) return pn def prime_fact(a): # 素因数分解 sqrt = math.sqrt(a) res = [] i = 2 if is_prime(a): res.append(a) else: while a != 1: while a % i == 0: res.append(i) a //= i i += 1 return res def main(): a, b = map(int, input().split()) ans = max(a + b, a - b) ans = max(ans, a * b) print(ans) return if __name__ == "__main__": main()
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s857730870
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
N = int(input()) A = list(map(int, input().split())) A2 = [] Z = [] ans = 0 zerocnt = 0 for ai in A: if ai == 0: zerocnt += 1 elif zerocnt >= 1: A2 += [0] Z += [zerocnt] ans += (zerocnt * (zerocnt + 1)) // 2 zerocnt = 0 if ai != 0: A2 += [ai] Z += [1] ans += 1 if zerocnt >= 1: A2 += [0] Z += [zerocnt] ans += (zerocnt * (zerocnt + 1)) // 2 zerocnt = 0 for i, ai in enumerate(A2): aixor = ai sumA = ai for j in range(i + 1, min(i + 41, len(A2))): aj = A2[j] aixor = aixor ^ aj sumA += aj if aixor != sumA: break else: ans += Z[i] * Z[j] print(ans)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s846194641
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
N = int(input()) S = input() maxd = 0 for a in range(1, N - 1): X = set([]) Y = set([]) for x in range(0, a): X.add(S[x]) for y in range(a, N): Y.add(S[y]) diffnum = len(X & Y) maxd = max(diffnum, maxd) print(maxd)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s552800703
Wrong Answer
p03337
Input is given from Standard Input in the following format: A B
x, y = [int(s) for s in input().split()] max([x + y, x - y, x * y])
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s873960332
Accepted
p03337
Input is given from Standard Input in the following format: A B
x, y = [int(i) for i in input().split()] print(max(x + y, x - y, x * y))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s473512340
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
A, B = map(int, input().split()) print(max([A*B, A+B, A-B])
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s678566001
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
A, B = map(int, input().split()) if B < 0: print(A - B) elif A > 1 and B > 1: print(A * B) else A ==1 or B == 1: print(A + B)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s987087110
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a, b = map(int, input().split()) print(max(a + b, a - b, a*b))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s414582459
Accepted
p03337
Input is given from Standard Input in the following format: A B
numeros = input() numeros = numeros.split() resultado = [0, 0, 0] resultado[0] = int(numeros[0]) + int(numeros[1]) resultado[1] = int(numeros[0]) - int(numeros[1]) resultado[2] = int(numeros[0]) * int(numeros[1]) print(max(resultado))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s532620588
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
N = int(input()) S = input() East = [0] * (N) if S[0] == "E": East[0] = 1 for i in range(N - 1): if i == N - 1: break if S[i + 1] == "E": East[i + 1] = East[i] + 1 else: East[i + 1] = East[i] # print(East) result = East[N - 1] - East[1] for i in range(1, N): if i == N - 1: ans = (i - 1) - East[i - 2] elif i == 1: ans = East[N - 1] - East[i + 1] else: right_E = East[N - 1] - East[i + 1] left_W = (i - 1) - East[i - 2] ans = right_E + left_W if result > ans: result = ans # print(i) print(result)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s989269028
Wrong Answer
p03337
Input is given from Standard Input in the following format: A B
(a, b) = list(map(int, input().split())) max = a + b if max <= a * b: max = a * b if max <= a - b: max = a - b if b != 0 and max <= a / b: max = a / b print(max)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s276880034
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
N = int(input()) S = input() temp = 0 for i in range(N - 1): S1 = S[0 : i + 1] S2 = S[i + 1 : N] # print(S1 + " " + S2) kaburi = [] for s in S1: if s in S2 and s not in kaburi: kaburi.append(s) print(kaburi) if len(kaburi) > temp: temp = len(kaburi) print(temp)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s290120098
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
N = int(input()) S = list(input()) reS = S[::-1] wSum = [0 for i in range(N)] eSum = [0 for i in range(N)] for i in range(N): if i == 0: if S[i] == "W": wSum[i] = 1 if reS[i] == "E": eSum[i] = 1 else: if S[i] == "W": wSum[i] = wSum[i - 1] + 1 else: wSum[i] = wSum[i - 1] if reS[i] == "E": eSum[i] = eSum[i - 1] + 1 else: eSum[i] = eSum[i - 1] eSum = eSum[::-1] cost = eSum[1] for i in range(1, N): if i == N - 1: if cost > wSum[N - 2]: cost = wSum[N - 2] else: if cost > wSum[i - 1] + eSum[i + 1]: cost = wSum[i - 1] + eSum[i + 1] print(cost)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s762820789
Wrong Answer
p03337
Input is given from Standard Input in the following format: A B
X = input() X = list(map(int, X.split())) A = X[0] B = X[1] so = A + B su = A - B m = A * B if so > su and so > m: print(so) else: if su > so and su > m: print(su) else: print(m)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s649870478
Wrong Answer
p03337
Input is given from Standard Input in the following format: A B
def f(A, B): return max(A + B, A - B, A * B)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s718556274
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a,b=map(int, input().split()) print(max([A+B,A-B,A*B])
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s093440573
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a,b = map(int,input().split()) print(min({a+b,a-b,a*b})
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s759170929
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
A,B = map(int,input().split()) print(max(A+B,A-B,A*B)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s477020197
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a,b = map(int,input().split()) print(max([a+b,a-b,a*b])
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s042650719
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a,b =map(int,input().split()) print(max(a+b,a-b,a*b)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s267050571
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a,b=map(int,input().split()) print(max(a+b,a-b,a*b)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s597175627
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a,b=list(int(input().split())) print(max(a+b,a-b,a*b)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s841261366
Accepted
p03337
Input is given from Standard Input in the following format: A B
a, b = map(lambda x: int(x), input().split(" ")) print(max([a - b, a + b, a * b]))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s520027003
Accepted
p03337
Input is given from Standard Input in the following format: A B
A, B = (int(i) for i in input().split()) L = [A + B, A - B, A * B] print(max(L))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s727702521
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a = list(map(int, input.split())) print(max(a[0] + a[1], a[0] - a[1], a[0] * a[1]))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s349203218
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
print((lambda x: max(eval(x[0] + c + x[1]) for c in "*+-"))(input()))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s667461912
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
A, B = map(int, input().split()) print(max(A + B, A−B, A×B))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s158835049
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
s,t = map(int,input().split());print(max( for i in range(3))
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s000238508
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a, b = map(int, input().split()) print(max(a + b, a - b, a * b)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s142850723
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
A, B = map(int, input().split()) print(max(A+B, A-B, A*B)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s787847274
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a, b = map(int, input().split()) print(max(a+b, a-b, a*b)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s670524917
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a,b=list(map(int,input().split())) print(max([a+b,a-b,a*b])
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]
Print the largest value among A+B, A-B and A \times B. * * *
s695879484
Runtime Error
p03337
Input is given from Standard Input in the following format: A B
a,b=list(map(int,input().split())) print(max(a+b,a-b,a*b)
Statement You are given two integers A and B. Find the largest value among A+B, A-B and A \times B.
[{"input": "3 1", "output": "4\n \n\n3+1=4, 3-1=2 and 3 \\times 1=3. The largest among them is 4.\n\n* * *"}, {"input": "4 -2", "output": "6\n \n\nThe largest is 4 - (-2) = 6.\n\n* * *"}, {"input": "0 0", "output": "0"}]