problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03719
s760055483
Wrong Answer
A, B, C = map(int, input().split()) if C < B: if C > A: print('YES') else: print('NO')
p03548
s855223085
Wrong Answer
x, y, z = map(int, input().split()) print((x + z) // (y + z))
p03087
s124625058
Accepted
N, Q = map(int, input().split()) S = input() cnt = [0]*N for i in range(1,N): cnt[i] = cnt[i-1] if S[i-1] == 'A' and S[i] == 'C': cnt[i] += 1 for i in range(Q): l, r = map(int, input().split()) print(cnt[r-1]-cnt[l-1])
p02747
s562717787
Accepted
s = input() l = len(s)//2 if 'hi'*l == s: print('Yes') else: print('No')
p03627
s561844698
Accepted
from collections import Counter n = int(input()) A = list(map(int, input().split())) c = Counter(A) over4 = [] over2 = [] for k, v in c.items(): if v >= 4: over4.append(k) elif v >= 2: over2.append(k) over4.sort(reverse=True) over2.sort(reverse=True) s1, s2, s3 = 0, 0, 0 if len(over4) > 0: s1 = over4[0]**2 if len(over2) >= 2: s2 = over2[0]*over2[1] if len(over4) > 0 and len(over2) > 0: s3 = over4[0]*over2[0] print(max(s1, s2, s3))
p02873
s006704699
Accepted
s=input() n=len(s)+1 a=[0]*n b=[0]*n c=[0]*n for i in range(1,n): b[i]=(b[i-1]+1 if s[i-1]=='<' else 0) for i in range(n-2,-1,-1): c[i]=(c[i+1]+1 if s[i]=='>' else 0) for i in range(n): a[i]=max(b[i],c[i]) print(sum(a))
p03719
s646024628
Wrong Answer
i = list(map(int, input().split())) if i[0]<=i[2] and i[1]>=i[2]: print("YES") else: print("NO")
p02761
s235750857
Accepted
import numpy as np N,M=map(int, input().split()) sc=np.array([list(map(int,list(input().split()))) for i in range(M)]) ans = np.zeros(N) checked=False for i in range(M): s=sc[i][0] c=sc[i][1] if N!=1 and s==1 and c==0: checked=True break for j in range(i): if s==sc[j][0] and c!=sc[j][1]: checked=True break ans[s-1] = c if checked: print(-1) else: if N!=1 and ans[0]==0: ans[0]=1 res = '' for i in ans: res += str(int(i)) print(int(res))
p02600
s388118860
Accepted
from sys import stdin X = int(stdin.readline().rstrip()) print(10-X//200)
p02900
s825838985
Wrong Answer
import math from fractions import gcd a, b = map(int, input().split()) cd = set() ans = 0 g = gcd(a, b) if g == 1: cd.add(1) else: for i in range(1, g): if a % i == 0 and b % i == 0: cd.add(i) for s in cd: if s == 1: ans += 1 else: for t in range(2, int(math.sqrt(s)) + 1): if s % t == 0: break else: ans += 1 print(ans)
p02602
s234975289
Accepted
N,K = map(int , input().split()) A = list(map(int, input().split())) for i in range(N-K): if (A[i]<A[-(N-K)+i]): print("Yes") else: print("No")
p02576
s885481445
Accepted
N,X,T = map(int,input().split()) if N%X == 0: print(N//X*T) else: print((N//X+1)*T)
p02621
s306269417
Accepted
import sys input = lambda:sys.stdin.readline().strip() a = int(input()) print(a+a**2+a**3)
p03086
s588898946
Accepted
#ABC122-B s = input() atgc = set(['A','T','G','C']) cnt = 0 acgt_len = [] for i in range(len(s)): if s[i] in atgc: cnt += 1 else: acgt_len.append(cnt) cnt = 0 acgt_len.append(cnt) print(max(acgt_len))
p03145
s876304946
Wrong Answer
def mapt(fn, *args): return tuple(map(fn, *args)) def Input(): return mapt(int, input().split(" ")) def main(): a, b, c = Input() print(b * a * 1/2) main()
p02835
s785583423
Accepted
a = list(map(int,input().split())) if sum(a) >= 22: print('bust') else: print('win')
p02608
s165404595
Accepted
n=int(input()) k=int(n**0.5)+1 num=[0 for i in range(n+1)] for x in range(1,k): for y in range(1,k): for z in range(1,k): w=x**2+y**2+z**2+x*y+y*z+z*x if w<=n: num[w]+=1 for i in range(1,n+1): print(num[i])
p02771
s606214159
Accepted
def main(): a = list(map(int, input().split())) if len(set(a)) == 2: print("Yes") else: print("No") if __name__ == "__main__": main()
p02713
s854660006
Accepted
def gcd(a,b): while(b): a,b = b,a%b return a def main(): k = int(input()) ans=0 for a in range(1,k+1): for b in range(1,k+1): for c in range(1,k+1): ans+=gcd(a,gcd(b,c)) print(ans) if __name__ == '__main__': main()
p03339
s572503041
Accepted
N = int(input()) S = input() countE = [0]*(N+1) countW = [0]*(N+1) for i in range(N): countW[i + 1] = countW[i] if S[i] == 'W': countW[i+1] += 1 for i in range(1, N): countE[N-i-1] = countE[N-i] if S[N-i] == 'E': countE[N-i - 1] += 1 minx = N+1 for i in range(N): newv = countW[i] + countE[i] if minx > newv: minx = newv print(minx)
p03077
s997021630
Accepted
N = int(input()) A = int(input()) B = int(input()) C = int(input()) D = int(input()) E = int(input()) xs = [A, B, C, D, E] min_value = min(xs) min_index = xs.index(min_value) print(4 + (N + min_value - 1) // min_value)
p03417
s442368789
Wrong Answer
n,m=map(int,input().split()) if n==1 or m==1: print(max(n,m)-2) else: print(n*m-(2*n+2*m-4))
p02607
s631409399
Wrong Answer
n= int(input()) arr = list(map(int,input().split())) c=0 for i in range(1,n,2): if (arr[i])%2==1: c+=1 print(c)
p03385
s185403068
Accepted
print('Yes' if len(set(input())) == 3 else 'No')
p02600
s961790193
Accepted
x=int(input()) for i in range(9): if 400+200*i <= x and x <= 599+200*i: print(8-i) else: pass
p03565
s821484055
Wrong Answer
S = input().strip() T = input().strip() ans = "UNRESTORABLE" for i in range(len(S)-len(T), -1, -1): ok = True for j in range(len(T)): if not (S[i+j] == '?' or S[i+j] == T[j]): ok = False if ok: a = S[:i]+T a = a.replace("?", "a") if ans == "UNRESTORABLE" or a < ans: ans = a print(ans)
p03817
s126329694
Wrong Answer
x = int(input()) t = x // 11 if x % 11 <= 6: print(t*2 + 1) else: print(t * 2 + 2)
p02973
s312682672
Accepted
#6484898 from bisect import bisect N= int(input()) A = [] for i in range(N): t = int(input()) A.append(t) D = [1]*(N+1) D[0] = -10**10 for a in A: idx = bisect(D, -a) D[idx] = min(D[idx], -a) print(bisect(D, 0)-1)
p02681
s797528968
Wrong Answer
import sys s = input() t = input() for i in range(len(s)): if s[i] != t[i]: print('false') sys.exit() else: print('true')
p03469
s512553474
Accepted
s=list(input()) s[0],s[1],s[2],s[3]='2','0','1','8' print(''.join(s))
p03625
s962567289
Accepted
from collections import Counter N = int(input()) A = map(int, input().split()) edge = Counter(A) cand = [a for a in edge.keys() if edge[a] >= 2] cand.sort(reverse=True) e1 = e2 = 0 if len(cand) >= 1: if edge[cand[0]] >= 4: e1 = e2 = cand[0] elif len(cand) > 1: e1 = cand[0] e2 = cand[1] print(e1 * e2)
p02773
s026729638
Accepted
def main(): N = int(input()) dict = {} for _ in range(N): word = input() if word in dict: dict[word] += 1 else: dict[word] = 0 m = max(dict.values()) dict = sorted(dict.items(), key=lambda x: x[0]) for d in dict: if d[1] == m: print(d[0]) return 0 if __name__ == '__main__': main()
p03494
s120534080
Wrong Answer
#ABC081 n = int(input()) a = list(map(int,input().split())) s = sum(a) s // (2 ** n) c = True count = 0 while c: a = [a[i] // 2 for i in range(len(a))] count += 1 for i in range(n): if a[i] % 2 != 0: c = False print(count)
p03427
s530708613
Accepted
N = input() if N[1:] == "9" * (len(N) - 1): print(int(N[0]) + 9 * (len(N) - 1)) else: print((int(N[0]) - 1) + 9 * (len(N) - 1))
p03803
s057972886
Wrong Answer
a,b=map(int,input().split()) if a>b or (a==1 and b==13): print("Alice") elif a<b or (a==13 and b==1): print("Bob") else: print("Drew")
p02700
s439662129
Wrong Answer
a, b, c, d = map(int, input().split()) if (a//d) < (c//b): print("No") elif ((a//d) == (c//b)) and (c%b != 0) and (a%d == 0): print("No") else: print("Yes")
p02767
s978921299
Wrong Answer
N = int(input()) X = list(map(int, input().split())) import math av = math.ceil(sum(X)/N) total = 0 for i in X: total += ((i-av)**2) print(total)
p03457
s949618428
Accepted
N = int(input()) txy = [map(int, input().split()) for _ in range(N)] for t, x, y in txy: dist = x + y if t < dist or t % 2 != dist % 2: print('No') exit() print('Yes')
p03719
s623453771
Accepted
# A - Between Two Integers a,b,c=list(map(int,input().split())) if c>=a and c<=b: print("Yes") else: print("No")
p02818
s518591470
Wrong Answer
def solve(): A, B, K = map(int, input().split()) ans = [] if A + B == K: ans = [0, 0] elif A + B < K: ans = [0, 0] elif K <= A: ans = [A-K, B] elif A < K <= B: ans = [0, B+A-K] print(*ans) # print(solve()) solve()
p03107
s303012737
Wrong Answer
S = input() cnt_0 = 0 cnt_1 = 0 for i in S: if i == "0": cnt_0 += 1 else: cnt_1 +=1 print(min(cnt_0,cnt_1))
p04033
s798863839
Accepted
a, b = map(int, input().split()) # = list(map(int, input().split())) # = [list(map(int, input().split())) for i in range(N)] if a <0 and b>0: print("Zero") elif a==0 or b==0: print("Zero") elif a>0: print("Positive") elif a<0 and b<0: if (a-b)%2==0: print("Negative") else: print("Positive")
p03804
s741608373
Accepted
n,m = map(int,input().split()) a = [[str(i) for i in input()]for _ in range(n)] b = [[str(i) for i in input()]for _ in range(m)] for i in range(n-m+1): for j in range(n-m+1): c =0 for k in range(m): for l in range(m): if a[i+k][j+l] == b[k][l]: c +=1 if c == m**2: print("Yes") exit() print("No")
p02618
s309039117
Wrong Answer
import sys input = sys.stdin.buffer.readline import numpy as np D = int(input()) c = np.array(input().split(), dtype=np.int32) s = np.array([input().split() for _ in range(D)], dtype=np.int32) last = np.zeros(26, dtype=np.int32) ans = [] point = 0 for i in range(D): down = (i+1-last)*c loss = down * 3 + s[i,:] idx = np.argmax(loss) ans.append(idx+1) point += s[i, idx] - down.sum() last[idx] = i+1 print(down) for i in range(D): print(ans[i])
p02681
s719247711
Accepted
s = input() t = input() if len(s)+1 == len(t) and s == t[:len(t)-1]: print("Yes") else: print("No")
p03556
s267114490
Accepted
print(int(int(input())**.5)**2)
p03417
s460004201
Accepted
N, M = map(int, input().split()) if N > M: tmp = N N = M M = tmp # N <= M としても一般性を失わない if N == 1: if M == 1: print(1) elif M == 2: print(0) else: print(M-2) elif N == 2: print(0) else: print((N-2)*(M-2))
p03910
s080783692
Accepted
n = int(input()) cnt = 0 for i in range(1,n+1): cnt += i if cnt >= n: idx = i break sum = 0 for i in range(1,idx+1)[::-1]: if sum+i < n: print(i) sum += i else: print(n-sum) break
p03838
s135879393
Accepted
def main(): x,y = map(int,input().split()) ans = 10**10 if x<=y: ans = min(ans,y-x) if -x<=y: ans = min(ans,1+y-(-x)) if x<=-y: ans = min(ans,-y-x+1) if -x<=-y: ans = min(ans,-y-(-x)+2) print(ans) if __name__ == '__main__': main()
p02612
s511785917
Accepted
N=int(input()) print((-(-N//1000)*1000)-N)
p02814
s512273755
Wrong Answer
import math N, M = map(int, input().split()) a = list(map(int, input().split())) a = list(map(lambda x: x / 2, a)) a.sort() bound = int(M / a[0]) base = 0 for factor in range(bound): for i in range(1, N): if (a[0] * factor) % a[i]: break elif i == N-1: base = a[0] * factor break if base != 0: break if base != 0: print(math.ceil((M // base) / 2)) else: print(0)
p02994
s588512787
Accepted
from bisect import * N, L = map(int, input().split()) A = list(range(L,L+N)) res = sum(A) print(res - A[min(bisect_left(A,0),len(A)-1)])
p02577
s278173564
Accepted
n = int(input()) if n%9==0: print('Yes') else: print('No')
p02970
s350741637
Accepted
N, D = map(int, input().split()) print((N+D*2)//(D*2+1))
p02946
s379867724
Wrong Answer
k,x = map(int,input().split()) res = [i for i in range(x-k+1,x+k)] print(res)
p02732
s038131568
Accepted
n=int(input()) a=list(map(int,input().split())) cnt=[0]*(n+1) s=0 for x in a: cnt[x]+=1 for i in range(1,n+1): if cnt[i]>=2: s+=cnt[i]*(cnt[i]-1)//2 for k in range(1,n+1): if cnt[a[k-1]]>=2: print(s-cnt[a[k-1]]+1) else: print(s)
p03371
s995040868
Accepted
A,B,C,X,Y = map(int,input().split()) moneys = [] for i in range(0,2*max(X,Y)+1,2): if X-i//2 >= 0 and Y-i//2 >= 0: moneys.append((X-i//2)*A + (Y-i//2)*B + C*i) elif X-i//2 >= 0 and Y-i//2 < 0: moneys.append((X-i//2)*A + C*i) elif X-i//2 < 0 and Y-i//2 >= 0: moneys.append((Y-i//2)*B + C*i) else: moneys.append(C*i) print(min(moneys))
p02860
s093947481
Wrong Answer
t=input() s=raw_input() if t%2!=0: print "No" else: if s[0:t/2]==s[t/2+1:t-1]: print "No" else: print "Yes"
p03371
s268358044
Wrong Answer
a,b,c,x,y = map(int,input().split()) c *= 2 ans = 10 ** 8 for i in range(max(x,y)): p = 0 p += c * i p += a * (max(0,x - i)) p += b * (max(0,y - i)) ans = min(ans,p) print(ans)
p03252
s173697425
Accepted
S = input() T = input() length = len(S) flg = 1 dic = {} for i in range(length): data = S[i] if S[i] not in dic: dic[S[i]] = T[i] else: if dic[S[i]] != T[i]: flg = 0 dic = {} for i in range(length): data = T[i] if T[i] not in dic: dic[T[i]] = S[i] else: if dic[T[i]] != S[i]: flg = 0 if flg: print("Yes") else: print("No")
p03385
s611951656
Accepted
import sys def I(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def LMI(): return list(map(int, sys.stdin.readline().split())) MOD = 10 ** 9 + 7 INF = float('inf') S = input() print('Yes' if 'a' in S and 'b' in S and 'c' in S else 'No')
p02813
s709265379
Wrong Answer
import math n = int(input()) p = list(map(int, input().split())) q = list(map(int, input().split())) p_sort = sorted(p) q_sort = sorted(q) p_number = 0 q_number = 0 k = 0 for i in p: k += 1 i_index = p_sort.index(i) p_number += i_index * math.factorial(n-k) p.remove(i) p_sort.remove(i) k = 0 for i in q: k += 1 i_index = q_sort.index(i) q_number += i_index * math.factorial(n-k) q.remove(i) q_sort.remove(i) answer = abs(p_number - q_number) print(answer)
p02554
s776253988
Wrong Answer
N=int(input()) MOD=10**9+7 MAX=N+1 def powermod(base,p): powls=[0 for i in range(MAX)] powls[0]=1 if powls[p]!=0: return powls[p] elif p%2==0: return (powermod(base,p//2)**2)%MOD else: return (powermod(base,p-1)*base)%MOD print(powermod(10,N)-2*powermod(9,N)+powermod(8,N))
p02818
s569658499
Accepted
a,b,k = map(int,input().split()) if k <= a: a = a - k print("{} {}".format(a,b)) else: if k >= a + b: print("0 0") else: print("0 {}".format(b - (k - a)))
p03239
s470661872
Wrong Answer
N, T = map(int, input().split()) ct = [list(map(int, input().split())) for _ in range(N)] ct = sorted(ct, key=lambda x:x[1]) mx = float('inf') for c, t in ct: if t <= T: mx = min(mx, c) else: if mx != float('inf'): print(mx) exit() print('TLE')
p02773
s454542314
Accepted
n=int(input()) l=[input() for i in range(n)] l.sort() ll=list(set(l)) ll.sort() m=len(ll) ans=[0]*m count=0 j=0 for i in range(len(l)-1): if l[i]==l[i+1]: count+=1 if i+1==n-1: ans[j]+=count else: ans[j]+=count count=0 j+=1 g=max(ans) for i in range(m): if ans[i]==g: print(ll[i])
p03146
s473487547
Accepted
s=int(input()) a=[s] check=0 for i in range(1000000): n=a[i] if n%2==0: num=n//2 if num in a: check=i+2 break a.append(num) else: num=3*n+1 if num in a: check=i+2 break a.append(num) print(check) #print(*a)
p02835
s299017440
Accepted
a = list(map(int,input().split())) count=0 for i in a: count+=i if count < 22: print("win") else: print("bust")
p03493
s087989816
Accepted
s = input() print(s.count('1'))
p03456
s042910553
Wrong Answer
a, b = input().split() t = int(a + b) for i in range(1,10 ** 2 + 2): if t == (i * i): print('Yes') exit(0) print('No')
p03835
s936429207
Wrong Answer
K,S=map(int,input().split()) # if S%3==0: # x=int(S/3) # elif S%2==0: # x=int(S/2) # else: # x=int(S) ans=0 for i in range(0,K+1): for j in range(0,K+1): for k in range(0,K+1): print(i,j,k) if i+j+k==S: ans+=1 print(ans)
p02973
s944593940
Accepted
N = int(input()) A = [int(input()) for i in range(N)] import bisect bilist = [A[0]] ans = 0 for a in A[1:]: index = bisect.bisect_left(bilist,a) if index == 0: bisect.insort_left(bilist,a) else: bilist[index-1] = a print(len(bilist))
p04045
s484887132
Accepted
N, K = [int(i) for i in input().split(" ")] D = input().split(" ") for i in range(N, 1000000): if len(list(set(D) & set(str(i)))) == 0: print(i) break
p02766
s415934649
Wrong Answer
N,K=map(int,input().split()) ans=1 a=K while N>a: ans+=1 a=a*K print(ans)
p03796
s735450855
Wrong Answer
number = int(input()) power = 1; for i in range(number): power = power * i print(power)
p02755
s994923350
Wrong Answer
a,b = [int(x) for x in input().split()] amax = (a+1)*12.5 amin = a*12.5 bmax = int((b+1)*10) bmin = int(b*10) hantei = bmin if amax <= bmin: hantei = str(-1) elif bmax <= amin: hantei = str(-1) elif bmin < amin: hantei = round(amin) print(hantei)
p02631
s271845438
Accepted
n=int(input()) l=list(map(int,input().split())) s=0 for i in range(n): s=s^l[i] k=s y=0 for i in range(n): y=k^l[i] print(y,end=" ")
p03433
s606098749
Wrong Answer
N = int(input()) A = int(input()) if (N-A)%500 == 0: print("YES") else: print("NO")
p02600
s866914507
Wrong Answer
X = int(input()) if X <= 400 and X <= 599: print('8') elif 600 <= X and X <= 799: print('7') elif 800 <= X and X <= 999: print('6') elif 1000 <= X and X <= 1199: print('5') elif 1200 <= X and X <= 1399: print('4') elif 1400 <= X and X <= 1599: print('3') elif 1600 <= X and X <= 1799: print('2') elif 1800 <= X and X <= 1999: print('1') else: pass
p04033
s477520385
Wrong Answer
a, b = map(int, input().split()) if a <= 0 <= b: print("Zero") elif a < 0 and b < 0: subs = b - a + 1 if subs % 2 == 1: print("Negative") else: print("Positive")
p02600
s916110706
Accepted
x = int(input()) # = list(map(int, input().split())) # = map(int, input().split()) ans = 10 - x // 200 print(ans)
p02766
s793347059
Wrong Answer
n,k = map(int,input().split()) ans = 1 while n>k: n = n/k ans+=1 print(ans)
p03095
s470076531
Accepted
from collections import Counter n = int(input()) s = input() mod = 10 ** 9 + 7 cnt = 1 for i in Counter(list(s)).values(): cnt *= (i + 1) print((cnt - 1) % mod)
p02911
s826734761
Wrong Answer
""" - N players, K points each player has, Q correct answers - Substruct Q from K and add score to each players """ N,K,Q = map(int,input().split()) A = (int(x) for x in open(0).read().split()) score = [K-Q] * (N+1) for x in A: score[x] += 1 ans = '\n'.join('No' if x <= 0 else 'Yes' for x in score[1:]) print(ans)
p02873
s365869124
Wrong Answer
S = str(input()) N = len(S) + 1 ans = [0] * N for i in range(N): k = 0 right = 0 while(i + k < N-1 and S[i+k] == '>'): right += 1 k += 1 j = 0 left = 0 while (N-1 > i - j - 1 > 0 and S[i - j - 1] == '<'): left += 1 j += 1 ans[i] = max(right, left) #print(ans) print(sum(ans))
p03852
s821073070
Wrong Answer
c = str(input()) vowels = ['a','e','i','o','u'] if c in vowels: answer = "vowei" else: answer = "consonant" print(answer)
p03524
s147440554
Accepted
S = input() cnt_a = 0 cnt_b = 0 cnt_c = 0 for s in S: if s == 'a': cnt_a += 1 elif s == 'b': cnt_b += 1 else: cnt_c += 1 if abs(cnt_a - cnt_b) <= 1 and abs(cnt_b - cnt_c) <= 1 and abs(cnt_c - cnt_a) <= 1: print('YES') else: print('NO')
p03471
s185447855
Wrong Answer
N = 1000 Y = 1234000 ##N,Y = map(int,input().split()) ans = -1,-1,-1 for x in range(N+1): for y in range(N+1-x): z = N - x - y if 10000*x + 5000*y + 1000*z == Y: ans = x,y,z break else: break print(*ans)
p03377
s934287690
Accepted
a,b,x = map(int,input().split()) print('YES' if a <= x <= a+b else 'NO')
p03475
s962827357
Accepted
from math import ceil n = int(input()) cc = [0]*(n-1) ss = [0]*(n-1) ff = [0]*(n-1) ans = [0]*n for i in range(n-1): c,s,f = map(int,input().split()) cc[i] = c ss[i] = s ff[i] = f for i in range(n-1): for j in range(i,n-1): x = max(0,ceil((ans[i]-ss[j])/ff[j])) ans[i] = ss[j] + x*ff[j] + cc[j] for i in range(n): print(ans[i])
p03854
s099606373
Accepted
s = input() s = s[-1::-1] word = ['resare','esare','remaerd','maerd',] for i in word: s = s.replace(i,'') if s: print('NO') else: print('YES')
p03665
s918972284
Accepted
n,p=map(int,input().split()) a=list(map(lambda x:int(x)%2,input().split())) a0=a.count(0) a1=a.count(1) base=2**a0 import math def combinations_count(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) if p==1: ans=0 for i in range((a1+1)//2): b=combinations_count(a1, 2*i+1) ans+=base*b print(ans) else: ans=0 for i in range(a1//2+1): b=combinations_count(a1, 2*i) ans+=base*b print(ans)
p03611
s787597502
Accepted
n=int(input()) from collections import Counter as co var=co(list(map(int,input().split()))) ans=0 for k in var: p=var[k] if k-1 in var:p+=var[k-1] if k+1 in var:p+=var[k+1] ans=max(ans,p) print(ans)
p02994
s416774785
Accepted
# ABC 131: B – Bite Eating N, L = [int(s) for s in input().split()] tastes = [L + i - 1 for i in range(1, N + 1)] index = 0 taste = 500 for i in range(N): if abs(tastes[i]) < taste: index = i taste = abs(tastes[i]) tastes.pop(index) print(sum(tastes))
p03264
s295975343
Accepted
n = int(input()) print((n // 2) * ((n + 1)// 2))
p03632
s539860884
Accepted
a,b,c,d = map(int,input().split()) if a >= d or b <= c: print(0) elif a <= c: print(min(b,d)-c) else: print(min(b,d)-a)
p02796
s343061471
Accepted
n = int(input()) arm = [] for _ in range(n): x, l = map(int,input().split()) arm.append([x-l, x+l]) arm.sort(key=lambda x: x[1]) cnt = 0 pr = -float('inf') for a in arm: if pr <= a[0]: cnt += 1 pr = a[1] print(cnt)
p03041
s977131994
Accepted
n,k = map(int, input().split()) s = list(input()) s[k-1] = s[k-1].lower() print(*s, sep='')
p03285
s702917240
Accepted
#!/usr/bin/env python3 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines n = int(input()) ans = 0 for i in range(n//7+1): if (n - i*7) % 4 == 0: ans += 1 print("Yes" if ans > 0 else "No")
p02723
s402100008
Accepted
S = input() if S[2]==S[3] and S[4]==S[5]: print("Yes") else: print("No")