input
stringlengths
20
127k
target
stringlengths
20
119k
problem_id
stringlengths
6
6
dp = [[0 for n in range(1001)] for m in range(11)] length, goal = list(map(int, input().split(" "))) problems = [] for l in range(length): a, b = list(map(int, input().split(" "))) problems.append([a, b]) for i in range(length): max_problems = problems[i][0] for k in range(1000):...
import math length, goal = list(map(int, input().split(" "))) nums = [] sumall = [] for i in range(length): a, b = list(map(int, input().split(" "))) nums.append(a) sumall.append(a * (i + 1) * 100 + b) answer = float("inf") for bit in range(2 ** length): temp = [] for i in range(length - ...
p03290
d, g = list(map(int, input().split())) pc = [list(map(int, input().split())) for i in range(d)] def dfs(s=[], score=0): ans = float('inf') if len(s)==d: if score >= g: return sum(s) else: return float('inf') else: p, c = pc[len(s)] for i i...
from itertools import product from math import ceil d, g = list(map(int, input().split())) pc = [list(map(int, input().split())) for i in range(d)] ans = 10**9 for bit in product([0, 1], repeat=d): score = 0 probs = 0 for i, b in enumerate(bit): p, c = pc[i] if b==1: ...
p03290
import math from itertools import permutations D, G = list(map(int, input().split(' '))) questions = [tuple(map(int, input().split(' '))) for _ in range(D)] min_answer = 1000 for question_ids in permutations(list(range(D))): score = G answer = 0 for question_id in question_ids: n, bon...
from itertools import product D, G = list(map(int, input().split(' '))) questions = [tuple(map(int, input().split(' '))) for _ in range(D)] questions = [(100 * index, n, bonus) for index, (n, bonus) in enumerate(questions, start=1)] min_answer = 1000 for bits in product((True, False), repeat=D): not_com...
p03290
import sys input = sys.stdin.readline d, g = [int(x) for x in input().split()] pc = [[int(x) for x in input().split()] for _ in range(d)] ans = float("inf") for i in range(2 ** d): i_bin = bin(i)[2:].zfill(d) s = set() # コンプリートボーナスをもらう for j in range(len(i_bin)): if i_bin[j] == "1": ...
import sys input = sys.stdin.readline d, g = [int(x) for x in input().split()] pc = [[int(x) for x in input().split()] for _ in range(d)] ans = float("inf") for i in range(2 ** d): s = set() # コンプリートボーナスをもらう for j in range(d): if (i >> j) & 1: s.add(j) cnt = 0 total ...
p03290
D,G = list(map(int,input().split())) P = [] num_p = 0 for i in range(1,D+1): p,c = list(map(int,input().split())) num_p += p for j in range(1,p+1): P += [(j,i*100*j+c*(j==p))] dp = [0]*(num_p+1) for k,pt in P: if k==1: t_dp = dp[:] for cur in range(1,num_p+1): if...
d,g = list(map(int,input().split())) pc = [list(map(int,input().split()))for _ in[0]*d] ans = [] for mask in range(1 << d): s = 0 num = 0 rest_max = -1 for i in range(d): p,c = pc[i] if mask >> i & 1: s += p * 100 * (i + 1) + c num += p else: ...
p03290
D, G = [int(i) for i in input().split()] PC = [(int(i), int(j)) for (i, j) in [input().split() for _ in range(D)]] # 十分大きい数を用意する ans = float("inf") # それぞれのランクの問題を「完全に解く」 or not -> 2^D通り for bit in range(1 << D): score = 0 solve = 0 rest = set(range(1, D + 1)) for i in range(D): #...
import itertools d, g = [int(i) for i in input().split()] pc = [[int(i) for i in input().split()] for _ in range(d)] ans = float("inf") for bit in itertools.product((0, 1), repeat=d): score = 0 solve = 0 rest = set(range(d)) for i in range(d): if bit[i] == 1: score ...
p03290
D, G = list(map(int, input().split())) p, c = [], [] for i in range(D): a, b = list(map(int, input().split())) p.append(a) c.append(b) from itertools import product res = 1 << 29 for v in product([0, 1], repeat=D): score, num = 0, 0 for i in range(D): if v[i] == 1: ...
D, G = list(map(int, input().split())) p, c = [], [] for i in range(D): a, b = list(map(int, input().split())) p.append(a) c.append(b) res = 1 << 29 for bit in range(1 << D): score, num = 0, 0 for i in range(D): if bit >> i & 1: # bit & (i << i) score += c[i] + p[i] ...
p03290
D,G = list(map(int, input().split())) #prob_num = [3,5] #comp = [500,800] prob_num = [] comp = [] for i in range(D): p,c = list(map(int, input().split())) prob_num.append(p) comp.append(c) comp_point = [] for i in range(D): comp_point.append((100*(i+1)*prob_num[i]+comp[i])) a...
D,G = list(map(int, input().split())) prob_num = [] bonus = [] comp_pt = [] for i in range(D): p,b = list(map(int, input().split())) prob_num.append(p) bonus.append(b) comp_pt.append(100*(i+1)*p+b) def dfs(hascomp:str, target:int, prob:int, depth:int) -> int: if target <= 0: #pr...
p03290
n,g = list(map(int,input().split())) lis = [] mon = [] for i in range(n): a,b = list(map(int,input().split())) lis.append([a,b]) score = {(0,0)} for i in range(n): gone = set() for nu,cou in score: for j in range(lis[i][0]+1): if j != lis[i][0]: gone.add((nu+(i+1) * 100 * j,cou + j...
import math n,g = list(map(int,input().split())) lis = [] sum = [] for i in range(n): a,b = list(map(int,input().split())) lis.append([a,b]) sum.append((i+1)*100*a+b) def ans(x,y): if y <= 0:return 10 ** 12 nu = min(math.ceil(x/(100 * y)),lis[y-1][0]) num = 100 * y * nu if nu == lis[y-1][0]:nu...
p03290
d,g = list(map(int,input().split())) p = [] # 問題数の格納 c = [] # ボーナス点の格納 ans = [] # 候補解の格納 ss = 0 cnt = 0 for _ in range(d): #問題数、ボーナス点の入力 pp,cc = list(map(int,input().split())) p.append(pp) c.append(cc) for x in range(2**d): #bit全探索 ss = 0 # 得点 cnt = 0 # 問題数 for i in range(d): ...
d,g = list(map(int,input().split())) P, C = [], [] probs = set([i for i in range(d)]) for _ in range(d): p,c = list(map(int,input().split())) P.append(p) C.append(c) res = float('inf') for i in range(2**d): tmp = [] score = 0 cnt = 0 for j in range(d): if ((i>>j)&1): ...
p03290
import re d,g = list(map(int,input().split() )) l = [list(map(int,input().split() ))+[100*(x+1)] for x in range(d) ] mondai_num = [] for k in range(2**d): #先に全完するカテゴリ(何百点問題を全完するか)を決め、回す bin_str = format(k, "0{}b".format(d) )#二進数の文字列を取得 #これが全完する問題のリスト zenkan_list = [ x.start() for x in re.findit...
import math D,G = list(map(int,input().split())) p = [] c = [] for i in range(D): P,C = list(map(int,input().split())) p.append(P) c.append(C) res = float("inf") for i in range(2**D): bs = format(i,"0{}b".format(D)) ans = 0 cnt = 0 #コンプするやつをたす for j in range(D): if bs[j] == ...
p03290
d,g = list(map(int, input().split())) p = [] c = [] for i in range(d): a,b = list(map(int, input().split())) p.append(a) c.append(b) dp = [0 for i in range(sum(p) + 2)] for i in range(1,d+1): count_max = p[i-1] bonus = c[i-1] for j in range(sum(p)+1,0,-1): for k in ran...
d,g = list(map(int, input().split())) P = [] C = [] PC = [] for i in range(d): p,c = list(map(int, input().split())) P.append(p) C.append(c) PC.append((p,c)) P_sum = sum(P) dp = [0 for i in range(P_sum + 1)] for i,j in enumerate(PC): for k in range(P_sum, -1, -1): for l i...
p03290
from operator import itemgetter D, G = list(map(int, input().split())) PC = [list(map(int, input().split())) for _ in range(D)] def score(d, n, s, ans): if s >= G: ans = min(ans, n) return ans if d == D: if s >= G: ans = min(ans, n) return ans p, c ...
from operator import itemgetter D, G = list(map(int, input().split())) PC = [list(map(int, input().split())) for _ in range(D)] def com(d, s, ans): if d == D: ans.append(s) return ans a = s[:] a.append(1) ans = com(d+1, a, ans) b = s[:] b.append(0) ans = com(d...
p03290
d, g = [int(i) for i in input().split()] score = 0 p = [] c = [] for i in range(d): p_tmp, c_tmp = [int(i) for i in input().split()] p.append(p_tmp) c.append(c_tmp) num = [] for i in range(2**d): num_tmp = 0 score = 0 not_comp = [] for j in range(d): if i >> j & 1: ...
d, g = [int(i) for i in input().split()] score = 0 p = [] c = [] for i in range(d): p_tmp, c_tmp = [int(i) for i in input().split()] p.append(p_tmp) c.append(c_tmp) num = [] for i in range(2**d): num_tmp = 0 score = 0 not_comp = [] for j in range(d): if i >> j & 1: ...
p03290
D, G = list(map(int, input().split())) P = [] for i in range(D): p, c = list(map(int, input().split())) P.append((p, c)) ans = float("inf") for i in range(2 ** D): score = 0 index = [] attempt = 0 for j in range(D): if ((i >> j) & 1): p, c = list(map(int, P[j])) score ...
D, G = list(map(int, input().split())) from itertools import chain S = [] for i in range(D): p, c = list(map(int, input().split())) S.append((p, c)) L = [] for i in range(2**D): T = [] for j in range(D): if (i>>j) & 1: T.append(j) L.append(T) X = [] for l in L: score, coun...
p03290
import sys,math,collections,itertools,copy input = sys.stdin.readline D,G=list(map(int,input().split())) score = [] maxScore = [] cos_per = [] for d in range(D): p,c=list(map(int,input().split())) tmp = [(d+1)*100]*p tmp[-1]+=c score.append(tmp) maxScore.append(sum(tmp)) #cos_per.a...
import sys,math,collections,itertools,copy input = sys.stdin.readline D,G=list(map(int,input().split())) score = [] maxScore = [] cos_per = [] maxS = [] for d in range(D): p,c=list(map(int,input().split())) tmp = [(d+1)*100]*p tmp[-1]+=c score.append(tmp) maxScore.append(sum(tmp)) ...
p03290
D, G = list(map(int, input().split())) p = [0 for i in range(D)] c = [0 for i in range(D)] for i in range(D): p[i], c[i] = list(map(int, input().split())) def dfs(s): if len(s) == D: ans = 1000 score = 0 times = 0 for i in range(D): if s[i] == "1": ...
def main(): D, G = list(map(int, input().split())) info = [tuple(map(int, input().split())) for _ in range(D)] ans = 100 * 10 for bit in range(1<<D): score = 0 num_problem = 0 # complete bonus for i in range(D): if (bit>>i) & 1: b...
p03290
def main(): D, G = list(map(int, input().split())) info = [tuple(map(int, input().split())) for _ in range(D)] ans = 100 * 10 for bit in range(1<<D): score = 0 num_problem = 0 # complete bonus for i in range(D): if (bit>>i) & 1: b...
def main(): D, G = list(map(int, input().split())) info = [tuple(map(int, input().split())) for _ in range(D)] ans = 100 * 10 for bit in range(1<<D): score = 0 num_problem = 0 # complete bonus for i in range(D): if (bit>>i) & 1: b...
p03290
#!/usr/bin/env python3 import sys, math, itertools, heapq, collections, bisect, string, copy input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') sys.setrecursionlimit(10**8) inf = float('inf') mod = 10**9+7 ans = inf count = 0; pro = 1 d, g = list(map(int, input().split())) g //= 100 dp=[[i...
#!/usr/bin/env python3 import sys, math, itertools, heapq, collections, bisect, string, copy input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') sys.setrecursionlimit(10**8) inf = float('inf') mod = 10**9+7 ans = inf count = 0; pro = 1 d, g = list(map(int, input().split())) g //= 100 dp=[[i...
p03290
d,g = list(map(int,input().split())) li = [list(map(int,input().split())) for i in range(d)] for i in range(d): li[i].append(li[i][0]*100*(i+1) + li[i][1]) tmp = 10 ** 9 def func(x,lis,cnt): global tmp if x <= 0: return cnt else: for i in range(d): if i not in lis: if x <= 10...
d,g = list(map(int,input().split())) li = [list(map(int,input().split())) for i in range(d)] ans = 10 ** 9 for i in range(2**d): ch = bin(i)[2:] ch = ch.zfill(d) tmpsum = 0 cnt = 0 for j in range(d): if ch[j] == "1": tmpsum += li[j][0]*100*(j+1) + li[j][1] cnt += li[j][0] if tm...
p03290
import itertools d,g=list(map(int,input().split())) p=[0 for _ in range(d)] c=[0 for _ in range(d)] l=[[] for _ in range(d)] for i in range(d):#値を取得! p[i],c[i]=list(map(int,input().split())) for i in range(d):#リストつくる! for j in range(p[i]+1): l[i].append((i+1)*100*j) l[i][p[i]] += c[i] r = list(i...
d,g=list(map(int,input().split())) p=[0 for _ in range(d)] c=[0 for _ in range(d)] ans = 100**10 for i in range(d):#値を取得! p[i],c[i]=list(map(int,input().split())) for i in range(2**d): score = 0 count = 0 horyu = 0 for j in range(d): if ((i >> j) & 1): score += (j+1)*p[j]*100 + c[j] count ...
p03290
# encoding: utf-8 D_MAX = 10 P_MAX = 100 num_and_pnt = lambda x: [int(x[0]), int(x[1]) // 100] D, G = num_and_pnt(input().split()) # [pi, ci] pc = [num_and_pnt(input().split()) + [i] for i in range(D)] # pc.sort(key=lambda x: -((x[2] + 1) * x[0] + x[1])) # depth-first-like search G_tab = [(x[2] + 1) * x[0]...
# encoding: utf-8 D_MAX = 10 P_MAX = 100 num_and_pnt = lambda x: [int(x[0]), int(x[1]) // 100] D, G = num_and_pnt(input().split()) # [pi, ci] pc = [num_and_pnt(input().split()) for i in range(D)] G_list = [(i + 1) * x[0] + x[1] for i, x in enumerate(pc)] cnt_list = [x[0] for i, x in enumerate(pc)] idx = [l...
p03290
# coding:utf-8 INF = float('inf') def inpl(): return list(map(int, input().split())) D, G = inpl() P, C = [], [] for i in range(D): p, c = inpl() P.append(p) C.append(c + 100 * (i + 1) * p) ans = INF for i in range(2 ** D): point = 0 cnt = 0 rest_max = 0 for shift i...
# coding:utf-8 import sys INF = float('inf') MOD = 10 ** 9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LS(): return sys.stdin.readline().split() def II(): return int(sys.stdin.readline()) def SI(): return eval(i...
p03290
d, g = list(map(int, input().split())) pc = [list(map(int, input().split())) for i in range(d)] ans = float("inf") for bit in range(1 << d): count = 0 sum = 0 nokori = set(range(1, d + 1)) for i in range(d): if bit & (1 << i): sum += pc[i][0] * (i + 1) * 100 + pc[i][1] ...
def dfs(i, sum, count, nokori): global ans if i == d: if sum < g: use = max(nokori) n = min(pc[use - 1][0], -(-(g - sum) // (use * 100))) count += n sum += n * use * 100 if sum >= g: ans = min(ans, count) return 0 ...
p03290
#abc104c all green d, g = list(map(int, input().split())) pc = [list(map(int, input().split())) for _ in range(d)] all_sum = [] for bit in range(1<<d): s = 0 a = 0 rest = [] for i in range(d): if bit & (1<<i): s += pc[i][0]*100*(i+1) + pc[i][1] a += pc[i][0] ...
def dfs(i, sum, count, rest): global ans if i == d: if sum < g: rest_max = max(rest) n = min(l[rest_max-1][0], -(-(g-sum)//(rest_max*100))) count += n sum += n * rest_max * 100 if sum >= g: ans = min(ans, count) else : ...
p03290
D, G = list(map(int, input().split())) pc = [list(map(int, input().split())) for i in range(D)] G /= 100 C = 2e3 N = len(pc) for i in range(2 ** N): p = 0 c = 0 for j in range(N): if i >> j & 1: p += pc[j][0] * (j + 1) + pc[j][1] / 100 c += pc[j][0] if p >= G:...
D, G = list(map(int, input().split())) G = int(G / 100) pc = [list(map(int, input().split())) for _ in range(D)] N = 10 ** 9 for bit in range(2 ** D): S = 0 c = 0 A = True a = -1 for i in range(D - 1, -1, -1): if bit & (1 << i): S += (i + 1) * pc[i][0] + int(pc[i][1]...
p03290
import math d,g = [int(i) for i in input().split()] P = [] C = [] for i in range(d): p,c = [int(i) for i in input().split()] P.append(p) C.append(c) # cnt = 0 # def count(): # global cnt # cnt+=1 # print(cnt) def flag(point,P,now): if point+100*(now+1)*P >= g: return 1 ...
import math d,g = [int(i) for i in input().split()] P = [] C = [] for i in range(d): p,c = [int(i) for i in input().split()] P.append(p) C.append(c) # cnt = 0 # def count(): # global cnt # cnt+=1 # print(cnt) def flag(point,P,now): if point+100*(now+1)*(P-1) >= g: return...
p03290
def main(): D, G, *pc = list(map(int, open(0).read().split())) p = pc[::2] c = pc[1::2] ans = 1e9 + 7 # 2 ** D - 1 まで for b in range(2 ** D): num = 0 pnt = 0 # コンプリートしない MAX x = None # 得点が高い方から for i in range(D - 1, -1, -1): ...
def main(): D, G, *pc = list(map(int, open(0).read().split())) p = pc[::2] c = pc[1::2] ans = 1e9 + 7 # コンプリート comp = [c[i] + 100 * (i + 1) * p[i] for i in range(D)] # 2 ** D - 1 まで for b in range(2 ** D): num = 0 pnt = 0 # コンプリートしない MAX x = No...
p03290
D, G = [int(_) for _ in input().split()] PC = [[int(_) for _ in input().split()] for i in range(D)] P = [p for p, c in PC] C = [c for p, c in PC] from heapq import * h = [] heappush(h, (0, 0, (0,)*D)) result = 0 ef = {} while h: t, score, pat = heappop(h) # print(t, score, pat) if sc...
D, G = [int(_) for _ in input().split()] PC = [tuple(int(_) for _ in input().split()) for i in range(D)] from itertools import product def calc(D, G, PC, es): r = 0 k = None result = 0 for i, e, pc in zip(list(range(D)), es, PC): if e: r += (i+1) * 100 * pc[0] + pc[1] ...
p03290
D, G = list(map(int, input().split())) P, C = [], [] for _ in range(D): p, c = list(map(int, input().split())) P.append(p); C.append(c) ans = float('inf') for bit in range(2**D): is_solve = [ 0 for _ in range(D) ] score, solve_num = 0, 0 # i 番目の bit が立っている => 100(i+1)点をつけられた p_i 問を全完す...
D, G = list(map(int, input().split())) P, C = [], [] for _ in range(D): p, c = list(map(int, input().split())) P.append(p); C.append(c) ans = float('inf') for bit in range(2**D): score, solve_num = 0, 0 for i in range(D): if (bit >> i) & 1: score += (100 * (i+1) * P...
p03290
D, G = list(map(int, input().split())) problem = [] bonus_score = [] for i in range(D): pi, ci = list(map(int, input().split())) problem.append(pi) bonus_score.append(ci) total_problem = sum(problem) dp= [[0 for k in range(total_problem + 1)] for i in range(D+1)] for i in range(D): for k in ...
D, G = list(map(int, input().split())) problem = [] bonus = [] for i in range(D): pi, ci = list(map(int, input().split())) problem.append(pi) bonus.append(ci) ans = float('inf') for S in range(1 << D): # Sは2^Dの元 score = sum([(problem[j] * 100 * (j + 1) + bonus[j]) * ((S >> j) & 1) for j in ran...
p03290
difficulties, goal = list(map(int, input().split())) pcs = [list(map(int, input().split())) for _ in range(difficulties)] dp = [[0] * 1102 for _ in range(difficulties + 1)] for d, pc in enumerate(pcs, 1): problem, complete = pc score = [x*100*d for x in range(problem)] + [problem*100*d+complete] +[...
difficulties, goal = list(map(int, input().split())) pcs = [list(map(int, input().split())) for _ in range(difficulties)] dp = [[0] * 1102 for _ in range(difficulties + 1)] total_problem = 0 for d, pc in enumerate(pcs, 1): problem, complete = pc total_problem += problem score = {x: x*100*d fo...
p03290
difficulties, goal = list(map(int, input().split())) pcs = [list(map(int, input().split())) for _ in range(difficulties)] dp = [[0] * 1102 for _ in range(difficulties + 1)] total_problem = 0 for d, pc in enumerate(pcs, 1): problem, complete = pc total_problem += problem score = {x: x*100*d fo...
difficulties, goal = list(map(int, input().split())) pcs = [list(map(int, input().split())) for _ in range(difficulties)] total_problem = 0 new_dp = [0] * 1001 for d, pc in enumerate(pcs, 1): dp = new_dp[:] problem, complete = pc total_problem += problem score = {x: x*100*d for x in ra...
p03290
from math import ceil D, G = list(map(int,input().split())) pc = [list(map(int,input().split())) for i in range(D)] ans = float("inf") for bit in range(1 << D): cnt = 0 sum = 0 remain = set(range(1,D+1)) for i in range(D): if bit & (1 << i): cnt += pc[i][0] ...
def dfs(i, sum, count, nokori): global ans if i == d: # G 点に満たなければ nokori のうち一番大きいものを解く if sum < g: use = max(nokori) # 解く問題が問題数を超えないように注意 n = min(pc[use - 1][0], -(-(g - sum) // (use * 100))) count += n sum += n * use * 100 ...
p03290
import sys import math input = sys.stdin.readline def I(): return int(eval(input())) def MI(): return list(map(int, input().split())) def LI(): return list(MI()) inf = float("inf") def main(): d, g = MI() pc = [LI() for _ in range(d)] ans = inf for bit i...
import sys import math input = sys.stdin.readline def I(): return int(eval(input())) def MI(): return list(map(int, input().split())) def LI(): return list(MI()) inf = float("inf") def main(): d, g = MI() pc = [LI() for _ in range(d)] ans = inf for bit i...
p03290
D,G=list(map(int,input().split())) G//=100 p=[0]*D c=[0]*D for i in range(D): p[i],c[i]=list(map(int,input().split())) c[i]//=100 ans=10**10 for bit in range(2**D): score=G problems=0 SET=set([i for i in range(D)]) for g in range(bit): if (bit>>g)&1: score...
D,G=list(map(int,input().split())) G//=100 p=[0]*D c=[0]*D for i in range(D): p[i],c[i]=list(map(int,input().split())) c[i]//=100 ans=10**10 for bit in range(2**D): score=G problems=0 SET=set([i for i in range(D)]) for g in range(D): if (bit>>g)&1: score-=...
p03290
d,g=list(map(int,input().split())) g=g//100 p_list=[0] c_list=[0] for i in range(d): p,c=list(map(int,input().split())) p_list.append(p) c_list.append(c//100) dp=[] for i in range(d+1): sub_list=[] for j in range(g+1): sub_list.append(10**9) dp.append(sub_list) dp[0][0]=0 ...
d,g=list(map(int,input().split())) g=g//100 p_list=[] c_list=[] s_list=[] for i in range(d): p,c=list(map(int,input().split())) c=c//100 p_list.append(p) c_list.append(c) s_list.append(p*(i+1)+c) Min=1000 for i in range(2**d): Sum=0 Num=0 for j in range(d): if (i>...
p03290
D,G = list(map(int,input().split())) P = [] C = [] for i in range(D) : p,c = list(map(int,input().split())) P.append(p) C.append(c) ans = float("inf") for i in range(1 << D) : # 2**D ct = 0 #cost score = 0 for j in range(D) : if (i >> j) & 1 : #bit全探索 score += C[...
D,G = list(map(int,input().split())) L = [list(map(int,input().split())) for i in range(D)] ans = float("inf") for bit in range(2 ** D) : score = 0 AC = 0 for k in range(D) : if bit & (1 << k) : p,c = L[k] score += c AC += p score += p*(k+...
p03290
d, g = [int(i) for i in input().split()] p = [0] + [[int(i) for i in input().split()] for _ in range(d)] def recursive(d, g): if d == 0: return 10 ** 9 n = min(g // (100 * d), p[d][0]) t = 100 * d * n # Full if n == p[d][0]: t += p[d][1] # Partial if t < g: ...
d, g = [int(i) for i in input().split()] p = [0] + [[int(i) for i in input().split()] for _ in range(d)] def recursive(d, g): if d == 0: return 10 ** 9 n = min(g // (100 * d), p[d][0]) t = 100 * d * n # Full if n == p[d][0]: t += p[d][1] # Partial if t < g: ...
p03290
def rec(i, g, count, rem): global ans if i == D: # 総得点がGを超えていなければ、remの中の最高配点の問題を解く if g < G: # 解く問題 use = max(rem) c = min(pc[use-1][0], -(-(G-g) // (use*100))) count += c g += use*100 * c if g >= G: ...
def rec(i, g, count, rem): global ans if i == 0: # 総得点がGを超えていなければ、remの中の最高配点の問題を解く if g < G: # 解く問題 use = max(rem) c = min(pc[use-1][0], -(-(G-g) // (use*100))) count += c g += use*100 * c i...
p03290
import math from itertools import permutations d,g = list(map(int,input().split())) x = [] for i in range(d): x1,y1=[int(i) for i in input().split()] x.append([x1,y1]) zy = [i for i in range(1,d+1)] zyu = list(permutations(zy, d)) ans2 = 100000000000000000000000 gou = g+0 for i in zyu: ans = 0 ...
import math from itertools import combinations d,g = list(map(int,input().split())) x = [] for i in range(d): x1,y1=[int(i) for i in input().split()] x.append([x1,y1]) zy = [i for i in range(1,d+1)] zyu = [] for i in range(d+1): zyu.extend(list(combinations(zy, i))) ans2 = 100000000000000000000000 ...
p03290
D, G = list(map(int,input().split())) pc = [list(map(int,input().split())) for _ in range(D)] ans = 1e9 for i in range(1 << D): cnt = 0 point = 0 for j in range(D): if(((i >> j) & 1) == 1): point += pc[j][0]*100*(j+1) + pc[j][1] cnt += pc[j][0] else: tmp = j if(point < G)...
D, G = list(map(int,input().split())) PC = [list(map(int,input().split())) for _ in range(D)] ans = 1e9 for i in range(1 << D): point = 0 cnt = 0 for j in range(D): if(((i >> j) & 1) == 1): point += PC[j][0]*(j+1)*100 + PC[j][1] cnt += PC[j][0] else: tmp = j if(point < G)...
p03290
D, G = list(map(int,input().split())) PC = [list(map(int,input().split())) for _ in range(D)] ans = 1e9 for i in range(1 << D): point = 0 cnt = 0 for j in range(D): if(((i >> j) & 1) == 1): point += PC[j][0]*(j+1)*100 + PC[j][1] cnt += PC[j][0] else: tmp = j if(point < G)...
D, G = list(map(int,input().split())) PC = [0]+[list(map(int,input().split())) for _ in range(D)] def dfs(d, g): if(d == 0): return 1e9 x = min(g//(100*d), PC[d][0]) point = x*100*d if(x == PC[d][0]): point += PC[d][1] if(point < g): x += dfs(d-1, g-point) return min(x, ...
p03290
import itertools import math d, g = list(map(int, input().split())) ls = [list(map(int, input().split())) for _ in range(d)] res = float('inf') for indices in itertools.permutations(list(range(d))): count = 0 s = 0 for i in indices: p, c = ls[i] if s + 100 * (i + 1) * p >= g: ...
import itertools import math d, g = list(map(int, input().split())) ls = [[100 * (i + 1)] + list(map(int, input().split())) for i in range(d)] s0 = [a * p for a, p, _ in ls] s1 = [a * p + c for a, p, c in ls] res = float('inf') for indices in itertools.permutations(list(range(d))): count = 0 s = 0 ...
p03290
D, G = list(map(int, input().split(' '))) p_list = list() c_list = list() for _ in range(D): p, c = list(map(int, input().split(' '))) p_list.append(p) c_list.append(c) num_prob_list = [0] * D min_prob_num_sum = sum(p_list) def dfs(prob_index=-1, prob_num=0, current_prob_num_sum=0, current_scor...
import itertools import math D, G = list(map(int, input().split(' '))) p_list = list() c_list = list() for _ in range(D): p, c = list(map(int, input().split(' '))) p_list.append(p) c_list.append(c) ans = sum(p_list) pattern_list = itertools.product([0, 1], repeat=D) for pattern in pattern_list: ...
p03290
D, G = [int(n) for n in input().split()] score_table = [] for i in range(1, D+1): p, c = [int(n) for n in input().split()] score_table.append([i*100, p, c]) min_count = sum([l[1] for l in score_table]) #print(min_count) for bit in range(1<<D): score = 0 count = 0 for i in range(D):...
D, G = [int(n) for n in input().split()] score_table = [] for i in range(1, D+1): p, c = [int(n) for n in input().split()] score_table.append([i*100, p, c]) min_count = sum([l[1] for l in score_table]) #print(min_count) for bit in range(1<<D): score = 0 count = 0 for i in range(D):...
p03290
import random import bisect import math option = 0 # 0:PSO 1:CFA 2:CFArank max_or_min = 0 # 0:minimize 1:maxmize iter=3 N = 50 #粒子の数 T = 1000 #世代数(ループの回数) maximum=1 minimum=0 dimension, limit = [int(i) for i in input().split()] pi = [0 for i in range(dimension)] ci = [0 for i in range(dimensio...
import random import bisect import math option = 0 # 0:PSO 1:CFA 2:CFArank max_or_min = 0 # 0:minimize 1:maxmize iter=2 N = 50 #粒子の数 T = 1000 #世代数(ループの回数) maximum=1 minimum=0 dimension, limit = [int(i) for i in input().split()] pi = [0 for i in range(dimension)] ci = [0 for i in range(dimensio...
p03290
d,g=list(map(int,input().split())) data=[] cp=[] for i in range(1,d+1): p,c=list(map(int,input().split())) data.append(p) cp.append(c) a=99999999 for i in range(1024): ct=0 ans=0 tmp=data[:] for j in range(d): if i&(1<<j): ct+=100*(j+1)*data[j]+cp[j] ...
d,g=list(map(int,input().split())) data=[] for i in range(d): p,c=list(map(int,input().split())) data.append((p,c)) n=0 mn=99999999 while n<2**d: point=0 count=0 for i in range(d): if n&(1<<i): point+=data[i][0]*100*(i+1)+data[i][1] count+=data[i][0] ...
p03290
D, G = [int(i) for i in input().split()] pc = [list([int(x) for x in input().split()]) for i in range(D)] pc.insert(0,[]) ans = float('inf') def f(score, i, kaitousu): global ans if i <= D: for j in range(pc[i][0] + 1): if j == pc[i][0]: newScore = score + 100 * i * j + pc[i][1] else: new...
D, G = list(map(int, input().split())) P = [0] C = [0] ans = 0 for _ in range(D): p, c = list(map(int, input().split())) P.append(p) C.append(c) ans += p for i in range(1<<D): point = 0 count = 0 for j in range(D, 0, -1): if i>>j-1&1: point += j * 100 * P[...
p03290
D,G=list(map(int,input().split())) p=[0]*D c=[0]*D ans=1000000000 for i in range(D): p[i],c[i]=list(map(int,input().split())) for i in range(1<<D): s=0 cnt=0 P=[0]*D for j in range(D): if ((i>>j)&1)==1: s+=c[j]+(j+1)*p[j]*100 cnt+=p[j] P[j]=1...
D,G=list(map(int,input().split())) p=[0]*D c=[0]*D ans=1000000000 for i in range(D): p[i],c[i]=list(map(int,input().split())) for i in range(1<<D): s=0 cnt=0 P=[0]*D for j in range(D): if ((i>>j)&1)==1: s+=c[j]+(j+1)*p[j]*100 cnt+=p[j] P[j]=1...
p03290
import math D,G = list(map(int,input().split())) pc = [list(map(int,input().split()))for i in range(D)] digit = "0"+str(D)+"b" ans = float('INF') for i in range(2**D): pattern = list(str(format(i,digit))) point = 0 count = 0 last0 = -1 for j in range(D): if pattern[j] =="1": point +=...
import math D,G = list(map(int,input().split())) pc = [list(map(int,input().split()))for _ in range(D)] minimam=float('INF') digit = "0"+str(D)+"b" for i in range(2**D): pattern = str(format(i,digit)) #この完答パターンのときの完答に伴う問題数と得点を算出する point = 0 count = 0 for j in range(D): if pattern[j]=="1...
p03290
import math D,G = list(map(int,input().split())) pc = [list(map(int,input().split()))for _ in range(D)] digit = "0"+str(D)+"b" ans = float("INF") for i in range(2**D): flags = list(str(format(i,digit))) points = 0 problems = 0 last0 = -1 #まずは完答組での点数を算出 for j in range(D): if int(flags[j])...
import math D,G = list(map(int,input().split())) pc = [list(map(int,input().split()))for _ in range(D)] digit = "0"+str(D)+"b" ans = float("INF") for i in range(2**D): flags = list(str(format(i,digit))) points = 0 count = 0 last0 = -1 for j in range(D): if flags[j]=="1": ...
p03290
import sys sys.setrecursionlimit(10000) D, G = list(map(int, input().split(' '))) left = {} bonus = {} for i in range(1, D+1): left[i], bonus[i] = list(map(int, input().split(' '))) big = 9999999 probably_ans = big def hogehoge(depth, index, pt, left, bonus, probably_ans): if pt >= G: r...
import sys sys.setrecursionlimit(10000) D, G = list(map(int, input().split(' '))) left = {} bonus = {} for i in range(1, D+1): left[i], bonus[i] = list(map(int, input().split(' '))) big = 9999999 probably_ans = big memo = {} def hogehoge(depth, index, pt, left, bonus, probably_ans): key = (dept...
p03290
import itertools D, G = list(map(int, input().split())) score_list = [] for i in range(D): p, c = list(map(int, input().split())) score_list.append([(i + 1) * 100] * (p - 1) + [c + (i + 1) * 100]) full_score = [sum(i) for i in score_list] per = list(itertools.permutations(list(range(D)))) ans = 10000 ...
D, G = list(map(int, input().split())) score_list = [] for i in range(D): p, c = list(map(int, input().split())) score_list.append([(i + 1) * 100] * (p - 1) + [c + (i + 1) * 100]) full_score = [sum(i) for i in score_list] sol = [format(i, 'b').zfill(D) for i in range(2 ** D)] ans = [] for i in sol: ...
p03290
import heapq n, need = list(map(int, input().split())) a = [list(map(int, input().split())) for _ in range(n)] ret = float('inf') for mask in range(1 << n): total = 0 count = 0 pq = [] for bit in range(n): num, bonus = a[bit] points = (bit + 1) * 100 if (mask >> bi...
n, need = list(map(int, input().split())) a = [list(map(int, input().split())) for _ in range(n)] ret = float('inf') for mask in range(1 << n): total = 0 count = 0 for bit in range(n): if (mask >> bit) & 1: num, bonus = a[bit] points = (bit + 1) * 100 ...
p03290
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 MOD = 1000000007 def main(): D, G, *PC = list(map(int, read().split())) P = PC[::2] C = PC[1::2] ans = INF for mask in range(1 << D): ...
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 MOD = 1000000007 def main(): D, G, *PC = list(map(int, read().split())) P = PC[::2] C = PC[1::2] ans = INF for mask in range(1 << D): ...
p03290
from collections import deque import itertools, math d,g = list(map(int,input().split())) pc = [list(map(int,input().split())) for _ in range(d)] g /= 100 pat = list(itertools.permutations(list(range(d)))) ans = sum([pc[x][0] for x in range(d)]) def dfs(k, point, cnt, pat): global ans i = pat[k] ...
from collections import deque import itertools, math d,g = list(map(int,input().split())) pc = [list(map(int,input().split())) for _ in range(d)] g /= 100 #ans = sum([pc[x][0] for x in range(d)]) ans = float('inf') for bit in range(1<<d): cnt = 0 point = 0 pat = set(range(1,d+1)) for i in range...
p03290
from collections import deque import itertools, math d,g = list(map(int,input().split())) pc = [list(map(int,input().split())) for _ in range(d)] g /= 100 #ans = sum([pc[x][0] for x in range(d)]) ans = float('inf') for bit in range(1<<d): cnt = 0 point = 0 pat = set(range(1,d+1)) for i in range...
d,g = list(map(int,input().split())) pc = [list(map(int,input().split())) for _ in range(d)] ans = float('inf') for bit in range(1<<d): sum = 0 cnt = 0 rem = set(range(d)) for i in range(d): if bit & 1<<i: sum += pc[i][0]*(i+1)*100 + pc[i][1] cnt += pc[i][0] rem.discard(i) ...
p03290
from math import ceil D, G = [int(t) for t in input().split()] p = [] c = [] for i in range(D): p_, c_ = [int(t) for t in input().split()] p.append(p_) c.append(c_) def solve(G, i): """100i点以下の問題だけでGを達成する最小問題数""" if i <= 0: return float('inf') #最も配転が高い問題で総合点を超えることができるか確認 ...
from math import ceil D,G = list(map(int,input().split())) list = [list(map(int,input().split())) for _ in range(D)] def dfs(G,i): if i <= 0: return float('inf') n = min(ceil(G/(100*i)),list[i-1][0]) s = 100*i*n if n == list[i-1][0]: s += list[i-1][1] if G > s: n...
p03290
d, g = list(map(int, input().split())) pc = [0] + [[int(i) for i in input().split()] for i in range(d)] def dfs(g, i): if i == 0: return 10 ** 12 n = min(g // (100 * i), pc[i][0]) score = n * 100 * i if n == pc[i][0]: score += pc[i][1] if g > score: ...
d, g = list(map(int, input().split())) PC = [0] + [[int(i) for i in input().split()] for i in range(d)] def dfs(g, i): if i == 0: return 10 ** 12 n = min(g // (100 * i), PC[i][0]) score = n * 100 * i if n == PC[i][0]: score += PC[i][1] if g > score: ...
p03290
D , G = list(map(int,input().split())) questions = [] for i in range(D): p , c = list(map(int,input().split())) questions.append([p,c]) ans = float("inf") for bit in range(2 ** D): tmp_ans = 0 tmp_sum = 0 for j in range(D): if bit >> j & 1: tmp_sum += questions[j][0]...
D , G = list(map(int,input().split())) bonus = [] question_cnt = [] for i in range(D): p , c = list(map(int,input().split())) question_cnt.append(p) bonus.append(c) ans = float('inf') for bit in range(2 ** D): sum_val = 0 tmp_ans = 0 Flag = False for j in range(D): if bi...
p03290
import math D, G = list(map(int, input().split())) lst = [list(map(int, input().split())) for _ in range(D)] ret = 1000 ** 10 for i in range(2 ** D): total = 0 cnt = 0 digit = 1 for p in range(D): if (digit << p) & i: cnt += lst[p][0] total += lst[p][0] * (...
import math D, G = list(map(int, input().split())) lst = [list(map(int, input().split())) for _ in range(D)] ret = 1000 ** 10 for i in range(2 ** D): total = 0 cnt = 0 for p in range(D): if (i >> p) & 1: cnt += lst[p][0] total += lst[p][0] * (p + 1) * 100 + lst[...
p03290
d,g=list(map(int,input().split())) g=g//100 pc=[list(map(int,input().split())) for i in range(d)] P=0 C=0#合計 for i in range(d): pc[i][1]=pc[i][1]//100 C=(C+pc[i][1]+pc[i][0]*(i+1)) P+=pc[i][0] dp=[10000000]*(C+1) for i in range(d): dp_sub=[10000000]*(C+1) for j in range(C+1): if...
import math d,g=list(map(int,input().split())) pc=[list(map(int,input().split())) for i in range(d)] ans=10000000000000000000 for i in range(1<<d): s=0 ans_=0 for j in range(d): if (i>>j)&1: s+=(pc[j][1]+pc[j][0]*100*(j+1)) ans_+=pc[j][0] #print(s,ans_) if...
p03290
D,G = list(map(int,input().split())) PC = [] L = [] t = 10 ** 9 m = 0 for i in range(1,D + 1): p,c = list(map(int,input().split())) s = 0 pc = [] for j in range(p): s += i * 100 if j == p - 1: s += c L.append([j + 1,s]) if s >= G and j + 1 < t: t = j + 1 p...
import math D, G = list(map(int, input().split())) PC = [] for _ in range(D): p, c = list(map(int, input().split())) PC.append([p, c]) ans = 10 ** 9 #全部解く・解かないが2のD乗通りになる for i in range(2 ** D): score = 0 time = 0 maxj = -1 #全部解く場合 for j in range(D): #jケタ落としていき、jケタめ ==...
p03290
from itertools import * from math import * D, G = list(map(int, input().split())) probs = [list(map(int, input().split())) for _ in range(D)] seq = list(range(D)) x = list(permutations(seq, D)) #print(x) ans = float("inf") G2=G for i in range(len(x)): cand = x[i] cnt = 0 G=G2 for j in ran...
from itertools import * from math import * D, G = list(map(int, input().split())) probs = [list(map(int, input().split())) for _ in range(D)] seq = list(range(D)) x = list(permutations(seq, D)) #print(x) ans = float("inf") G2=G for cand in x: cnt = 0 G=G2 for ind in cand: probpoint = ...
p03290
from itertools import accumulate from operator import add N, K = list(map(int, input().split())) K2 = 2 * K # Gss[i][j]: 「市松模様の黒い部分の右上のマス」が(i,j)のとき、満たせる要望の個数 Gss = [[0] * K2 for i in range(K2)] for i in range(N): x, y, c = input().split() x, y = int(x), int(y) # 要望を「0<=x<2K, 0<=y<K, 'B'」に変換...
from itertools import accumulate from operator import add N, K = list(map(int, input().split())) K2 = 2 * K # Gss[i][j]: 「市松模様の黒い部分の右上のマス」が(i,j)のとき、満たせる要望の個数 Gss = [[0] * K2 for i in range(K2)] for i in range(N): x, y, c = input().split() x, y = int(x), int(y) # 要望を「0<=x<2K, 0<=y<K, 'B'」に変換...
p03460
from collections import defaultdict n, k = list(map(int, input().split())) k2 = k * 2 requires = defaultdict(lambda: [0, 0]) for i in range(n): x, y, c = input().split() x, y = int(x), int(y) rx, ry = x % k2, y % k2 b = c == 'B' if rx > k: if ry > k: rx -= k ...
from itertools import accumulate n, k = list(map(int, input().split())) k2 = k * 2 req_b = [[0] * k for _ in range(k)] req_w = [[0] * k for _ in range(k)] bc, wc = 0, 0 for i in range(n): x, y, c = input().split() x, y = int(x), int(y) rx, ry = x % k2, y % k2 b = c == 'B' if rx >= k: ...
p03460
from itertools import accumulate n, k = list(map(int, input().split())) k2 = k * 2 req_b = [[0] * k for _ in range(k)] req_w = [[0] * k for _ in range(k)] bc, wc = 0, 0 for i in range(n): x, y, c = input().split() x, y = int(x), int(y) rx, ry = x % k2, y % k2 b = c == 'B' if rx >= k: ...
from itertools import accumulate n, k = list(map(int, input().split())) k2 = k * 2 req_b = [[0] * k for _ in range(k)] req_w = [[0] * k for _ in range(k)] bc, wc = 0, 0 for i in range(n): x, y, c = input().split() x, y = int(x), int(y) rx, ry = x % k2, y % k2 b = c == 'B' if rx >= k: ...
p03460
N, K = list(map(int, input().split())) dK = 2*K MeetDemand =[[0 for c in range(dK+1)] for r in range(dK)] for i in range(N): x, y, c =input().split() x = int(x) % dK y = (int(y)+K if c=="W" else int(y)) % dK if 0 <= x < K and 0 <= y < K: MeetDemand[0][0] += 1 MeetDemand[...
N, K = list(map(int, input().split())) dK = 2*K MeetDemand =[[0 for y in range(dK+1)] for x in range(K+1)] for i in range(N): x, y, c =input().split() x = int(x) % dK y = (int(y)+K if c=="W" else int(y)) % dK if K <= x: if 0 <= y < K: x -= K y += K el...
p03460
def get(i1, j1, i2, j2): if i1 > i2 or j1 > j2 or i1 < 0 or j1 < 0 or i2 < 0 or j2 < 0: return 0 elif i1 > 0 and j1 > 0: return l[i2][j2] - l[i1-1][j2] - l[i2][j1-1] + l[i1-1][j1-1] elif i1 <= 0 < j1: return l[i2][j2] - l[i2][j1-1] elif j1 <= 0 < i1: return l[i2][j2] - l[i1 - 1][j2] e...
def cl(i1,j1,i2,j2): if i1>i2 or j1>j2 or i1<0 or j1<0 or i2<0 or j2<0: return 0 v=l[i2][j2] if i1>0: v-=l[i1-1][j2] if j1>0: v-=l[i2][j1-1] if i1>0 and j1>0: v+=l[i1-1][j1-1] return v N,K=list(map(int,input().split())) K2=2*K l=[[0]*K2 for _ in range(K2)] for i in range(N)...
p03460
from collections import defaultdict def calc(K, xyc): K2 = K * 2 N = len(xyc) m = defaultdict(int) for x, y, c in xyc: y += c * K x1, y1 = x % K2, y % K2 x2, y2 = x1 + K, y1 + K m[x1, y1] += 1 m[x2, y2] += 1 m[x2, y1] -= 1 m[x1, y2]...
def calc(K, xyc): K2 = K * 2 N = len(xyc) p = [[0] * K2 for i in range(K2)] for x, y, c in xyc: y += c * K p[x % K2][y % K2] += 1 p[(x + K) % K2][(y + K) % K2] += 1 def isum(xs): r = 0 yield r for x in xs: r += x ...
p03460
def calc(K, xyc): K2 = K * 2 N = len(xyc) p = [[0] * K2 for i in range(K2)] for x, y, c in xyc: y += c * K p[x % K2][y % K2] += 1 p[(x + K) % K2][(y + K) % K2] += 1 def isum(xs): r = 0 yield r for x in xs: r += x ...
def calc(K, xyc): K2 = K * 2 N = len(xyc) p = [[0] * K2 for i in range(K2)] for x, y, c in xyc: y += c * K p[x % K2][y % K2] += 1 p[(x + K) % K2][(y + K) % K2] += 1 def calcsum(xs): r = sum(xs[:K]) yield r for a, b in zip(xs[:K], xs[K:])...
p03460
import functools import operator print(('Even' if (functools.reduce(operator.mul,list(map(int,input().split()))))%2==0 else 'Odd'))
print(('Odd' if len([1 for i in list(map(int,input().split())) if i%2!=0])==2 else 'Even'))
p03455
a,b=input().split();print(('EOvdedn'[eval(a+'*'+b)%2!=0::2]))
print(('EOvdedn'[eval(input().replace(' ','*'))%2!=0::2]))
p03455
print(('EOvdedn'[eval(input().replace(' ','*'))%2::2]))
a,b=list(map(int,input().split()));print(('EOvdedn'[a%2 and b%2::2]))
p03455
lis = [] lis = input().split() answer = 1 for lis_value in lis: answer *= int(lis_value) print(("Even" if answer % 2 == 0 else "Odd"))
a,b = list(map(int,input().split())) if a*b % 2 == 0: print("Even") else: print("Odd")
p03455
a, b = list(map(int, input().split())) print(('Odd' if a & 1 and b & 1 else 'Even'))
a, b = list(map(int, input().split())) print(('Odd' if a*b % 2 == 1 else 'Even'))
p03455
import operator import functools number_list = list(map(int, input().split())) product = functools.reduce(operator.mul, number_list) if product % 2 == 0: print('Even') else: print('Odd')
a, b = list(map(int, input().split())) if (a * b % 2) == 0: print('Even') else: print('Odd')
p03455
a,b = list(map(int, input().split())) print(("Even" if (a * b) % 2 == 0 else "Odd"))
a,b = list(map(int, input().split())) if (a * b) % 2 == 0: print("Even") else: print("Odd")
p03455
a, b = input().split(' ') multi_a_b = int(a) * int(b) if multi_a_b % 2 == 0: print('Even') else: print('Odd')
a, b = list(map(int, input().split())) if (a * b) % 2 == 0: print('Even') else: print('Odd')
p03455
a,b=list(map(int,input().split())) v=a*b print(("Even" if v%2==0 else "Odd"))
a,b=map(int,input().split()) print("Even") if a*b%2==0 else print("Odd")
p03455
(a, b) = list(map(int, input().split())) if a % 2 == 1 and b % 2 == 1: print("Odd") else: print("Even")
a, b = list(map(int, input().split())) if a % 2 == 1 and b % 2 == 1: print("Odd") else: print("Even")
p03455
a, b = list(map(int, input().split())) if a*b % 2 == 0: print("Even") else: print("Odd")
a, b=list(map(int, input().split())) s="Odd" if a%2!=0 and b%2!=0 else "Even" print(s)
p03455
a,b=list(map(int,input().split())) print(('Odd'if a*b%2==1else'Even'))
a,b=list(map(int,input().split()));print((['Even','Odd'][a*b%2]))
p03455
a, b =list(map(int, input().split())) product = a * b if product % 2 == 0: print("Even") else: print("Odd")
a, b = list(map(int, input().split())) pro = a * b if pro % 2 == 0: print("Even") else: print("Odd")
p03455
a,b = list(map(int, input().split())) print(("Odd" if a*b%2!=0 else "Even"))
a, b = list(map(int, input().split())) if a * b % 2 == 0: print('Even') else: print('Odd')
p03455
# -*- codinf: utf-8 -*- # コマンドラインの入力文字をリストに格納 # input().split() -> 入力文字を空白区切りで取得 ※inputは文字列として取得する。split()でリスト型に変換 # for num in input().split() -> 取得した入力文字を一つずつnum変数に格納 # int(num)で格納されたnum変数を数値に変換 numList = [int(num) for num in input().split()] # 入力文字の乗算 productNumList = numList[0] * numList[1] # 奇数/偶数の判定...
#2019/10/10 a, b = list(map(int, open(0).read().split())) print(("Odd" if (a*b)%2!=0 else "Even"))
p03455
ri = lambda: int(input()) rl = lambda: list(map(int,input().split())) rr = lambda N: [ri() for _ in range(N)] YN = lambda b: print('YES') if b else print('NO') INF = 10**18 a,b=rl() print('Odd' if a*b%2==1 else 'Even')
ri = lambda: int(input()) rl = lambda: list(map(int,input().split())) rr = lambda N: [ri() for _ in range(N)] YN = lambda b: print('YES') if b else print('NO') yn = lambda b: print('Yes') if b else print('No') OE = lambda x: print('Odd') if x%2 else print('Even') INF = 10**18 a,b=rl() #print('Odd' if a*b%2==1...
p03455
a,b = list(map(int,input().split())) num = a * b mod = num % 2 if mod == 0: print("Even") else: print("Odd")
a,b = list(map(int,input().split())) if a*b%2==0: print("Even") else: print("Odd")
p03455
a,b = list(map(int,input().split())) if a*b%2==0: print("Even") else: print("Odd")
a,b = list(map(int,input().split())) c = a*b print(("Odd" if c%2==1 else "Even"))
p03455
# #! /bin/python # a = int(input()) # b,c = map(int,input().split()) # s = input() # print('{} {}'.format(a+b+c,s)) # 11 22 といった形で標準入力を数値で受け取る。 a,b = list(map(int,input().split())) # if (not (1 <= a <= 10000)) or (not (1 <= b <= 10000)): # print('over flow argument!') # exit() if 1 <= a <= 1...
# #! /bin/python # a = int(input()) # b,c = map(int,input().split()) # s = input() # print('{} {}'.format(a+b+c,s)) # 11 22 といった形で標準入力を数値で受け取る。 a,b = list(map(int,input().split())) # if (not (1 <= a <= 10000)) or (not (1 <= b <= 10000)): # print('over flow argument!') # exit() def checkEvenO...
p03455
a,b = list(map(int,input().split())) if(a * b) % 2 == 0 : print("Even") else: print("Odd")
x,y = map(int,input().split()) print('Even') if((x*y%2) == 0) else print('Odd')
p03455
a, b = list(map(int, input().split())) print(('EOvdedn'[a*b%2::2]))
print(('EOvdedn'[eval(input().replace(' ', '*'))%2::2]))
p03455
num1, num2 = list(map(int,input().split())) if num1 * num2 % 2 ==0: print('Even') else: print('Odd')
a, b = tuple(int(num) for num in input().split()) ab = a * b if ab % 2: print('Odd') else: print('Even')
p03455
a, b = list(map(int, input().split())) print(("Even" if a*b % 2 == 0 else "Odd"))
a, b = list(map(int, input().split())) if a*b%2 == 0: print("Even") else: print("Odd")
p03455
d, g = list(map(int, input().split())) if d * g % 2 == 1: print('Odd') else: print('Even')
d, g = list(map(int, input().split())) if d % 2 == 1 and g % 2 == 1: print('Odd') else: print('Even')
p03455
a, b = list(map(int, input().split())) if a % 2 != 0 and b % 2 != 0: print('Odd') else: print('Even')
a, b = list(map(int, input().split())) m = a * b if m % 2 != 0: print('Odd') else: print('Even')
p03455
a, b = list(map(int, input().split())) if a * b % 2 == 0: print('Even') else: print('Odd')
# -*- coding: utf-8 -*- def main(): a, b = list(map(int, input().split())) print((['Even', 'Odd'] [a * b % 2])) if __name__ == '__main__': main()
p03455
a, b = list(map(int, input().split())) print(("Even" if a*b % 2 == 0 else "Odd"))
a,b = list(map(int,input().split())) num = a * b if num % 2 == 0: print("Even") else: print("Odd")
p03455
a , b = list(map(int,input().split())) if (a * b)%2 ==0: print("Even") else: print("Odd")
# ABC 086 A,B= list(map(int,input().split())) if (A* B)%2==0: ans ='Even' else: ans='Odd' print(ans)
p03455