problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03131
s842259044
Accepted
k,a,b = map(int, input().split()) if a+2>=b or a>=k: print(1+k) exit() k-=a-1 sm=a num=int(k/2) sm += num*(b-a) if k%2==1: sm+=1 print(sm)
p02552
s521947681
Accepted
x = int(input()) if(x == 0): print(1) else: print(0)
p02658
s264196487
Accepted
N = int(input()) arr = [int(x) for x in input().split()] found = False for x in arr: if x == 0: found = True if found: print(0) exit(0) res = 1 MAX = 10 ** 18 for x in arr: res *= x if res > MAX: print(-1) exit(0) print(res)
p03555
s979073780
Accepted
C1 = input() C2 = input() print('YES' if C1 == C2[::-1] else 'NO')
p02714
s600925741
Wrong Answer
n=int(input()) s=input() from collections import Counter c=Counter(s) ans = 1 for i in list(c.values()): ans*=i for i in range(n): for j in range(n): if i+2*j<n: if s[i]!=s[i+j] and s[i+j]!=s[i+2*j] and s[i]!=s[i+2*j]: ans-=1 print(ans)
p04005
s438624461
Wrong Answer
a,b,c=input().split() a=int(a) b=int(b) c=int(c) abc=sorted([a,b,c]) print(abc[0]*abc[1])
p02647
s522405544
Accepted
N,K=map(int,input().split()) A=list(map(int,input().split())) for _ in range(K): B=[0]*(N+1) for i in range(N): B[max(0,i-A[i])]+=1 B[min(N,i+A[i]+1)]-=1 for i in range(1,N): B[i]+=B[i-1] if A==B: break A=B[:] print(*A[:-1])
p02720
s552165477
Wrong Answer
# coding: utf-8 K = int(input()) def Is_runrun(n): n = str(n) return not(any([abs(int(i1)-int(i2)) <= 1 for i1, i2 in zip(n[:-1], n[1:])])) if K <= 9: print(K) else: K -= 9 n = 10 runruns = [] while len(runruns) != K: if Is_runrun(n): runruns.append(n) n += 1 print(runruns[-1])
p02598
s791918424
Accepted
N, K = map(int, input().split()) A = list(map(int, input().split())) def check(x): cnt = 0 for a in A: cnt += (a + x - 1) // x - 1 return cnt <= K left = 0 right = 10 ** 9 while right - left > 1: mid = (left + right) // 2 if check(mid): right = mid else: left = mid print(right)
p02724
s418846445
Accepted
# coding: utf-8 def solve(*args: str) -> str: x = int(args[0]) a = x//500 b = (x-(500*a))//5 return str(1000*a+5*b) if __name__ == "__main__": print(solve(*(open(0).read().splitlines())))
p02601
s220207738
Accepted
i = list(map(int, input().split())) #i_1 i_2を取得し、iに値を入れる A = i[0] B = i[1] C = i[2] K = int(input()) count = 0 for i in range(K): if B<=A: B = B*2 count = count + 1 if B>A: break for i in range(K-count): if C<=B: C = C*2 if C>B: print("Yes") break if A>=B: print("No") elif B>=C: print("No")
p03041
s063473627
Accepted
n,k=map(int,input().split()) s=list(input()) if s[k-1]=="A": s[k-1]="a" elif s[k-1]=="B": s[k-1]="b" else: s[k-1]="c" print("".join(s))
p02779
s927275790
Accepted
N = int(input()) A = list(map(int, input().split())) if len(set(A)) == N: print('YES') else: print('NO')
p02661
s386842863
Wrong Answer
N = int(input()) AB = [] for _ in range(N): AB.append(list(map(int, input().split()))) if N % 2 == 1: idx = N // 2 ans = AB[idx][1] - AB[idx][0] + 1 else: idx1 = (N-1) // 2 idx2 = (N-1) //2 + 1 lower_bound = AB[idx1][0] + AB[idx2][0] upper_bbound = AB[idx1][1] + AB[idx2][1] diff = upper_bbound - lower_bound + 1 ans = diff print(ans)
p02705
s765173998
Wrong Answer
import math R = int(input()) print(R**2*math.pi)
p02718
s580521976
Accepted
n, m = map(int,input().split()) a = list(map(int,input().split())) t = sum(a) a.sort(reverse=True) for i in range(m): if a[i] < t * 1/(4*m): print("No") exit() print("Yes")
p03427
s502573456
Accepted
s = input() ans = 0 for c in s: ans += ord(c) - ord('0') ans = max(ans, ord(s[0])-ord('0')-1 + (len(s)-1)*9) print(ans)
p02684
s692861422
Wrong Answer
n,k = map(int, input().split()) a = [0] + list(map(int, input().split())) before=0 roop=0 cnt={} nxt=1 mp = [] for i in range(1, k+1): mp.append(nxt) if nxt not in cnt: cnt[nxt] = i nxt = a[nxt] else: roop = i - cnt[nxt] before = cnt[nxt]-1 break roop=1 before=0 print(mp[before + (k-before)%roop])
p02701
s468888271
Accepted
kuziNum=int(input()) nyuuryokuNum=0 prizeDictionary={} while kuziNum > nyuuryokuNum: nextPrize =input() if nextPrize not in prizeDictionary : prizeDictionary[nextPrize]=nextPrize nyuuryokuNum+=1 print(str(len(prizeDictionary.keys())))
p03448
s202794553
Wrong Answer
five = int(input()) one_hundred = int(input()) fifty = int(input()) total = int(input()) count = 0 x = total//50 if 0<= x <=fifty: if 0 <= x//2 <= one_hundred: if 0 <= x//10 <= five: count = ( 1 + (x//2 + 1) + (x//10 + 1)) else: count = ( 1 + (x//2 + 1) + five) else: count = (1 + one_hundred + five) else: count = (fifty + one_hundred + five) print(count)
p03474
s926889290
Accepted
import re A,B=map(int,input().split()) S=input() m = re.match(r'^(\d+)\-(\d+)$', S) if m: if len(m.groups()[0]) == A and len(m.groups()[1]) == B: print('Yes') else: print('No') else: print('No')
p02711
s073341700
Wrong Answer
N = input() s = str(N) if s.count("7")>0: print(True) else: print(False)
p02597
s100267821
Accepted
n = int(input()) string = input() Rcount = string.count('R') fixRcount = string.count('R', Rcount, n) print(fixRcount)
p02700
s244605223
Accepted
import sys A, B, C, D = list(map(int, input().split())) while True: C -= B if C <= 0: print("Yes") sys.exit() A -= D if A <= 0: print("No") sys.exit()
p02743
s531578726
Accepted
a, b, c = map(int, input().split()) if c-a-b>0 and 4*a*b<(c-a-b)**2: print('Yes') else: print('No')
p02963
s822473030
Accepted
s = int(input()) x1 = y1 = 0 x2, y2 = 10**9, 1 x3 = (10**9 - s % 10**9) % 10**9 y3 = (s + x3) // 10 ** 9 print(x1, y1, x2, y2, x3, y3)
p03565
s540615046
Accepted
import re s, t = input().replace('?', '.'), input() l, m = len(s), len(t) if l < m: print("UNRESTORABLE") exit() can = [] # candidates for i in range(l - m + 1): if re.match(s[i:i + m], t): can.append((s[:i] + t + s[i + m:]).replace('.', 'a')) print(min(can) if can else "UNRESTORABLE")
p02879
s795351655
Wrong Answer
a,b=map(int,input().split()) x=a*b c=0 for i in range(1,10): for j in range(1,10): if (j*i==x): c=c+1 if (c==0): print('-1') if (c!=0): print(x)
p03386
s604504878
Wrong Answer
a,b,k=list(map(int,input().split())) l=[] v=[] for i in range(a,b+1): l.append(i) for i in range(k): if i>=len(l): break v.append(l[i]) l.reverse() for i in range(k-1,-1,-1): if i>=len(l): continue v.append(l[i]) s=set(v) for i in s: print(i)
p03795
s241544597
Accepted
n = int(input()) print(n*800-(n//15)*200)
p02879
s122006044
Wrong Answer
a, b=map(int, input().split()) if a and b <=9: print(a*b) else: print(-1)
p03705
s317337449
Accepted
import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 7) n, a, b = map(int, input().split()) if a > b: print(0) sys.exit(0) if n == 1 and a != b: print(0) sys.exit(0) print((a + b * (n - 1)) - (b + a * (n - 1)) + 1)
p03087
s059376047
Wrong Answer
n,k=map(int,input().split()) s=input() l=[0] c=0 for i in range(1,n): if(s[i]=='C'): if(s[i-1]=='A'): c+=1 l.append(c) print(l) for q in range(k): x,y=map(int,input().split()) print(l[y-1]-l[x-1])
p02924
s956615017
Accepted
n=int(input()) print((n-1)*n//2)
p03030
s130079173
Wrong Answer
N=int(input()) d={} k=[] for x in range(N): S,P=input().split() if S not in k: k.append(S) d[S]=[] d[S].append([P,x+1]) k.sort() for y in k: d[y].sort(reverse=True) for z in range(len(d[y])): print(d[y][z][1])
p03778
s368355015
Accepted
w,a,b=map(int,input().split()) x=min(a,b) y=max(a,b) print(y-x-w if y-x>w else 0)
p02912
s249034454
Wrong Answer
N,M=map(int,input().split()) A=list(map(int,input().split())) for i in range(M): B=sorted(A) B[-1]=B[-1]//2 A=B print(B) print(sum(B))
p03767
s598321828
Accepted
N = int(input()) a = sorted(list(map(int,input().split()))) A = [a[i] for i in range(N,3 * N)] ans = 0 for i in range(0,N): ans += A[i * 2] print(ans)
p03264
s799155693
Accepted
n = int(input()) print((n//2)*(n//2+(n%2)))
p03472
s529667109
Accepted
import heapq n,h= map(int,input().split()) bl = [] heapq.heapify(bl) maxa = -1 for i in range(n): a,b=map(int,input().split()) maxa=max(maxa,a) heapq.heappush(bl,-b) count=0 while len(bl)>0: if -bl[0]>maxa: h-=-heapq.heappop(bl) count+=1 if h<=0:break else:break if h<=0:print(count) else:print(count + h//maxa + (1 if h%maxa>0 else 0))
p03351
s910277700
Accepted
a,b,c,d=map(int,input().split()) # 絶対値を出したいときはabs関数を使う! if abs(a-b)<=d and abs(b-c)<=d or abs(a-c)<=d: print('Yes') else: print('No')
p02773
s434668972
Accepted
N = int(input()) dic = {} for _ in range(N): inp = input() if inp not in dic: dic[inp] = 1 else: dic[inp] = dic[inp] + 1 num = max(dic.values()) ans = [] for i in dic: if dic[i] == num: ans.append(i) ans.sort() for i in ans: print(i)
p02765
s010659623
Wrong Answer
N,R=map(int,input().split()) if N>=10: print(R) else: print(100*(10-N))
p02628
s150945662
Accepted
sum=0 N,K=input().split(" ") array=input().split(" ") for i in range(int(N)): n=int(array[i]) array[i]=n array.sort() for j in range(int(K)): sum=sum+array[j] print(sum)
p03067
s460002286
Wrong Answer
a, b, c = map(int, input().split()) print("Yes" if (a < c < b) else "No")
p02773
s016090445
Wrong Answer
import sys import collections N = int(input()) S = [str(input()) for i in range(N)] # S_jadge1 = [s for s in S if s.islower()] # S_jadge2 = [s for s in S if 1 <= len(s) <= 10] # if len(S) != len(S_jadge1): # sys.exit() # if len(S) != len(S_jadge2): # sys.exit() if not 1 <= N <= 2*10*5: sys.exit() # if not S.islower(): # print("error:lower") # sys.exit() c = collections.Counter(S) max_val = max(c.values()) A = [key for key, value in c.items() if value == max_val] print('\n'.join(A)) # print(c.items())
p03359
s294978459
Accepted
a,b=map(int,input().split()) print(a if a<=b else a-1)
p02742
s048232337
Accepted
h, w = map(int, input().split()) if h == 1 or w == 1: print(1) else: if w % 2 == 0: a = (w//2) * 2 if h % 2 == 0: count = a * (h//2) else: count = a * (h//2) count += a // 2 else: a = (w//2) * 2 + 1 if h % 2 == 0: count = a * (h//2) else: count = a * (h//2) count += a//2+1 print(count)
p02552
s919072597
Wrong Answer
x=input() if x==0: print("1") else: print("0")
p03127
s883668844
Accepted
import fractions n = int(input()) a = list(map(int, input().split())) a.sort() mini = a.pop(0) ans = 10**9+1 for i in range(n-1): temp = fractions.gcd(mini, a[i]) if temp < ans: ans = temp print(ans)
p03061
s976957682
Accepted
from fractions import gcd N = int(input()) A = list(map(int, input().split())) L = [0] R = [0] M = [] maximum = 0 for n in range(N): L.append(gcd(A[n], L[-1])) R.append(gcd(A[-n-1], R[-1])) R.reverse() for n in range(N): M.append(gcd(L[n], R[n+1])) for n in range(N): maximum = max(maximum, M[n]) print(maximum)
p02711
s786209365
Wrong Answer
from math import gcd r = range(1, int(input()) + 1) print(sum(gcd(gcd(a, b), c)) for a in r for b in r for c in r)
p03386
s953354857
Accepted
a, b, k = [int(w) for w in input().split()] ak = a + k bk = b - k + 1 for i in range(a, min(ak, b+1)): print(i) for i in range(max(ak, bk), b + 1): print(i)
p02899
s421310808
Wrong Answer
n=int(input()) a=list(map(int,input().split())) b=a for i,j in enumerate(a,1): b[j-1]=i print(*b)
p03455
s080812634
Accepted
a,b = map(lambda x:int(x) % 2, raw_input().split()) print 'Odd' if (a == b == 1) else 'Even'
p03761
s282424128
Wrong Answer
import collections n=int(input()) S=[] for i in range(n): s=list(str(input())) cc=collections.Counter(s) S.append(cc) alphabet=['a','b','c','d','e','f','g','h','i','j','k','l','m','m','o','p','q','r','s','t','u','v','w','x','y','z'] ans=[] for lets in alphabet: nin=10**5 for i in range(n): nin=min(nin,S[i][lets]) if nin!=10**5: for j in range(nin): ans.append(lets) print("".join(ans))
p02848
s989550846
Accepted
n=int(input()) s=list(input()) temp=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] for i in range(len(s)): s[i]=temp[((temp.index(s[i]))+n)%26] print(*s,sep='')
p02608
s328374315
Accepted
import itertools n = int(input()) dic = {} for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): f_xyz = x**2 + y**2 + z**2 + x*y + y*z + z*x if f_xyz in dic: dic[f_xyz] += 1 else: dic[f_xyz] = 1 for i in range(1, n+1): if i in dic: print(dic[i]) else: print(0)
p02784
s962945654
Wrong Answer
from sys import stdin # S,T = stdin.readline().rstrip().split() H,N = [int(x) for x in stdin.readline().rstrip().split()] s = list(map(int,input().split())) if H>sum(s): print("NO") else : print("YES")
p02725
s258942293
Accepted
K, N = map(int, input().split()) A = list(map(int, input().split())) d = [A[i+1]-A[i] for i in range(N-1)] d.append(K-A[-1]+A[0]) print(sum(d)-max(d))
p02971
s037171971
Accepted
N = int(input()) lis = [int(input()) for _ in range(N)] lis_c = lis.copy() mx1 = max(lis_c) lis_c.remove(mx1) mx2 = max(lis_c) for i in lis: if i == mx1: print(mx2) else: print(mx1)
p03644
s699679718
Accepted
import sys from bisect import bisect_left, bisect_right def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) N = I() l = [1, 2, 4, 8, 16, 32, 64] if N >= 64: print(64) elif N >=32: print(32) elif N >=16: print(16) elif N >=8: print(8) elif N >=4: print(4) elif N >=2: print(2) elif N ==1: print(1)
p03720
s794498130
Accepted
n, m = map(int, input().split()) c = [0] * n for _ in range(m): a, b = map(int, input().split()) c[a - 1] += 1 c[b - 1] += 1 for i in c: print(i)
p03761
s723918567
Accepted
n = int(input()) alp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] list = [[] for _ in range(26)] ans = [] for i in range(n): s = input() for j in range(26): list[j].append(s.count(alp[j])) for i in range(26): for j in range(min(list[i])): ans.append(alp[i]) ans = sorted(ans) for i in ans: print(i, end = '')
p02595
s422742820
Accepted
n,d = map(int,input().split()) dl = [] for x in range(n): dd = [] d1,d2 = map(int,input().split()) dd.append(d1) dd.append(d2) dl.append(dd) count = 0 for dd in dl: if (dd[0]**2 + dd[1]**2) <= d**2: count += 1 print(count)
p03323
s904926219
Accepted
a,b = map(int,input().split()) if a<=8 and b<=8: print("Yay!") else: print(":(")
p03359
s227064886
Accepted
a, b = map(int, input().split()) ans = a if a <= b else a - 1 print(ans)
p04033
s853236871
Accepted
a,b = map(int,input().split()) if a < 0 and b < 0: if (b - a + 1) % 2 == 0: print("Positive") else: print("Negative") elif a <= 0 and b >= 0: print("Zero") else: print("Positive")
p03624
s532860562
Accepted
S = str(input()) chr = 'abcdefghijklmnopqrstuvwxyz' res ="" for i in range(len(chr)): if chr[i] not in S: res = chr[i] break if res =="": print("None") else: print(res)
p02556
s695751183
Wrong Answer
n=int(input()) s,p=10**9+1,10**9+1 t,q=-1,-1 for i in range(n): x,y=map(int,input().split()) s=min(s,x+y) t=max(t,x+y) p=min(p,x-y) q=max(q,x-y) print(max(t-s,q-p))
p03778
s962153088
Wrong Answer
w,a,b=map(int,input().split()) print(min(abs(a-b)-w,0))
p03854
s907174592
Wrong Answer
def main(): S = input() while len(S)>=5: if len(S)>=7 and S[:-7]=="dreamer": S = S[-7:] continue elif len(S)>=6 and S[:-6]=="eraser": S = S[-6:] continue elif S[:-5]=="dream" or S[:-5]=="erase": S = S[-5:] continue else: break if len(S)==0: print('Yes') else: print('No') main()
p03146
s546563592
Accepted
#abc116 b n=int(input()) a=[] a.append(n) i=0 while True: if a[i]%2==0: x=int(a[i]/2) if x in a: ans=i+1 break else: a.append(x) else: x=a[i]*3+1 if x in a: ans=i+1 break else: a.append(x) i+=1 print(ans+1)
p02682
s670631728
Wrong Answer
a, b, c, k = map(int, input().split()) if k <= a: print(k) if a < k <= b: print(a) if b < k <= c: print(a+(-1)*(k-a-b))
p02600
s518148377
Accepted
x = int(input()) for i in range(1,9): if x >= 200*(10-i): print(i) break
p04034
s357836282
Wrong Answer
n,m=map(int,input().split()) li=[list(map(int,input().split())) for _ in range(m)] box=[[1,0]] for i in range(n-1): box.append([0,1]) for x,y in li: tmp=box[x-1].copy() box[x-1][0]-=tmp[0]/(tmp[0]+tmp[1]) box[x-1][1]-=tmp[1]/(tmp[0]+tmp[1]) box[y-1][0]+=tmp[0]/(tmp[0]+tmp[1]) box[y-1][1]+=tmp[1]/(tmp[0]+tmp[1]) ans=0 for i in box: if i[0]>0.01: ans+=1 print(ans)
p03681
s217062643
Accepted
import math N_inu, M_saru = map(int, input().split()) d = abs(N_inu - M_saru) if (d > 1): ans = 0 else: if (d == 1): ans = math.factorial(N_inu) * math.factorial(M_saru) else: ans = 2 * math.factorial(N_inu) * math.factorial(M_saru) ans = ans % (10 ** 9 + 7) print(ans)
p02598
s671459696
Accepted
N, K = map(int, input().split()) A = list(map(int, input().split())) def isOk(x): cnt = 0 for a in A: cnt += (a - 1) // x return cnt <= K ok = max(A) ng = 0 while ok - ng > 1: mid = (ok + ng) // 2 if isOk(mid): ok = mid else: ng = mid print(ok)
p03617
s198517494
Accepted
Q,H,S,D = map(int, input().split()) N = int(input()) onelit = min((4*Q),(2*H),(S)) pattern1 = N * onelit pattern2 = ((N//2)*D) + ((N%2) * onelit) print(min(pattern1, pattern2))
p04031
s746624138
Accepted
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN n = int(input()) a = list(map(int,input().split())) h = Decimal(str(sum(a)/n)).quantize(Decimal('0'), rounding=ROUND_HALF_UP) a = list(map(lambda x:(x-h)**2,a)) print(sum(a))
p03693
s190697565
Accepted
r,g,b=[x for x in input().rstrip().split()] ans=int(r+g+b) if ans%4==0: print("YES") else: print("NO")
p02756
s259479153
Wrong Answer
import sys input = sys.stdin.readline S = list(input()) n = int(input()) s = [] for i in range(n): array = list(map(str,input().split())) s.append(array) for i in range(n): if s[i][0] == "1": S.reverse() else: if s[i][1] == "1": S.insert(0,s[i][2]) else: S.append(s[i][2]) print("".join(S))
p02612
s010921245
Accepted
N = int(input()) if N % 1000 == 0: print(0) else: payment = N // 1000 + 1 change = payment*1000 - N print(change)
p03289
s395935144
Wrong Answer
S=input() ans = "WA" if S[0] == "A" and ("a" <= S[1] <= "z") and ("a" <= S[-1] <= "z"): s0 = S[2:-2] for i in range(len(s0)): if s0[i] == "C": if ans == "AC": ans = "NG" else: ans = "AC" print(ans)
p02910
s140695085
Wrong Answer
import sys s = sys.stdin.readline() flag = True i = 0 while i < len(s): if i % 2: if s[i] != 'R' and s[i] != 'U' and s[i] != 'D': flag = False break else: if s[i] != 'L' and s[i] != 'U' and s[i] != 'D': flag = False break i += 1 if flag: print('Yes') else: print('No')
p02705
s849775766
Accepted
import math x = math.pi r = int(input()) print(2*x*r)
p03067
s049609050
Wrong Answer
a,b,c = map(int,input().split()) print("No" if a<b and b<c or c<b and b<a else "Yes")
p02682
s674038947
Accepted
# 初期入力 import sys input = sys.stdin.readline A,B,C,K = list(map(int, input().split())) a=1 b=0 c=-1 count =K point =0 if A< K: point +=A count -=A K -=A else: point +=K count =0 print(point) exit() if B < count: point +=0 count -=B K -=B else: point +=0 count =0 print(point) exit() if C <= count: point -=C else: point -=count count =0 print(point)
p03086
s592301834
Accepted
S = input() acgt = ['A', 'C', 'G', 'T'] c = 0 ans = 0 for i in S: if i in acgt: c += 1 ans = max(ans, c) else: c = 0 print(ans)
p02676
s323958398
Wrong Answer
K = int(input()) S = str(input()) if len(S) < K : print(S) else: print(S[0:K+1]+'...')
p03543
s548956083
Accepted
n = input() if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]: print('Yes') else: print('No')
p02820
s197921956
Accepted
n,k=map(int,input().split()) r,s,p=map(int,input().split()) t=list(input()) d={'r':p,'s':r,'p':s} #r:グー、s:チョキ、p:パー ans=t.count('r')*d['r']+t.count('s')*d['s']+t.count('p')*d['p'] #print(ans) for i in range(k,n): if t[i]==t[i-k]: ans-=d[t[i]] t[i]='x' print(ans)
p02641
s887919084
Accepted
x, n = map(int, input().split()) if n == 0: print(x) else: p_l = list(map(int, input().split())) p_x_l = [ x-i for i in p_l ] for i in range(101): if i not in p_x_l: print(x-i) break if -i not in p_x_l: print(x+i) break
p02963
s522863206
Wrong Answer
#!/usr/bin/env python3 def main(): S = int(input()) x1, y1 = 0, 0 x2, y2 = 1000000000, 1 x3 = (x2 - S % x2) % x2 y3 = (S + x3) / x2 print('{} {} {} {} {} {}'.format(x1, y1, x2, y2, x3, y3)) if __name__ == "__main__": main()
p02911
s927810487
Wrong Answer
n,k,q=[int(i) for i in input().split()] a=[] for i in range(q): a.append(int(input())) point=[k-q]*n for i in a: point[i-1]+=1 for i in point: if i>0: print("YES") else: print("NO")
p02630
s352634231
Wrong Answer
n = int(input()) A = list(map(int, input().split())) q = int(input()) ans = 0 for _ in range(q): b, c = map(int, input().split()) if b in A: A = [c if a==b else a for a in A] ans = sum(A) print(ans)
p02933
s709797876
Wrong Answer
a=input() s=input() a=int(a) if a>=3200: print(a) print(s) else: print('red')
p02627
s590158544
Accepted
a = input() print('a' if a.islower() == True else 'A')
p03162
s869507523
Wrong Answer
N=int(input()) DP=[0]*N h = list(map(int, input().split())) DP[0] = max(h) pidx = h.index(max(h)) for i in range(1,N): h=list(map(int,input().split())) h[pidx]=0 DP[i]=DP[i-1]+max(h) pidx=h.index(max(h)) print(DP[N-1])
p03944
s736226393
Wrong Answer
def main(): w, h, n = map(int, input().split()) a = [0, 0] b = [w, h] for _ in range(n): x, y, t = map(int, input().split()) if t == 1: a[0] = x elif t == 2: b[0] = x elif t == 3: a[1] = y else: b[1] = y print(max(b[0] - a[0], 0) * max(b[1] - a[1], 0)) if __name__ == '__main__': main()