problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02796
s681013146
Accepted
n = int(input()) xl = [list(map(int, input().split())) for _ in range(n)] A = sorted([(x+l, x-l) for x, l in xl]) now = A[0][0] cnt = 1 for i, j in A: if now <= j: cnt += 1 now = i print(cnt)
p02994
s452025530
Wrong Answer
n,l=map(int,input().split()) taste = [l+i for i in range(n)] s=sum(taste) for i in range(l+n+2): if i in taste: print(s-i) exit() if -i in taste: print(s+i) exit()
p02747
s180643747
Wrong Answer
def main(): S = str(input()) if 'hi' in S: print('Yes') else: print('No') if __name__ == "__main__": main()
p02624
s103056764
Accepted
n = int(input()) ans = 0 for k in range(1, n + 1): m = n // k mc2 = (m * (m + 1)) // 2 ans += mc2 * k print(ans)
p02646
s262735682
Wrong Answer
def main(): a,v = map(int,input().split()) b,w = map(int,input().split()) t = int(input()) if v == w: print('NO') return 0 elif abs((a-b)/(v-w)) <= t: print('YES') else: print('NO') if __name__ == '__main__': main()
p03998
s463994094
Accepted
a = list(input()) b = list(input()) c = list(input()) t = a.pop(0) while True: if t == "a": if a == []: print("A") exit() else: t = a.pop(0) elif t == "b": if b == []: print("B") exit() else: t = b.pop(0) elif t == "c": if c == []: print("C") exit() else: t = c.pop(0)
p02684
s430418196
Accepted
from collections import defaultdict n,k=map(int,input().split()) l=list(map(int,input().split())) d=defaultdict(int) for i in range(n): d[i+1]=l[i] visited=set() l=[] i=1 while True: l.append(i) if i not in visited: visited.add(i) else: break i=d[i] first=l.index(l[-1]) if k<first: print(l[k]) else: k=(k-first)%((len(l)-1)-first) k+=first print(l[k])
p02754
s721809503
Accepted
N, A, B = map(int, input().split()) num = A if (N%(A+B)) > A else N%(A+B) ans = (N//(A+B))*A + num print(ans)
p03437
s995696565
Accepted
X, Y = map(int, input().split()) if (X % Y == 0): print(-1) else: print(X)
p02899
s156922005
Wrong Answer
n = int(input()) l = input().split(' ') d = {} for i in range(len(l)): d[i+1] = l[i] result = [] d2 = sorted(d.items(),key=lambda x:x[1]) for item in d2: result.append(str(item[0])) print(' '.join(result))
p02699
s996452971
Accepted
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) s, w = map(int, read().split()) if w >= s: print('unsafe') else: print('safe')
p02922
s206340523
Accepted
#!/usr/bin/python3 # -*- coding:utf-8 -*- from math import ceil def main(): a, b = map(int, input().strip().split()) print(ceil((b - 1) / (a - 1))) if __name__=='__main__': main()
p03860
s286148445
Accepted
a = input() print('A' + a[8] + 'C')
p02688
s088953971
Accepted
n,k = map(int,input().split()) for i in range(k): d = int(input()) a = list(map(int,input().split())) if i == 0: ans = [i for i in range(1,n+1)] for i in a: if i in ans: ans.remove(i) print(len(ans))
p02959
s159884091
Accepted
n = int(input()) aa = list(map(int, input().split())) bb = list(map(int, input().split())) ans = 0 for i in range(n): t1 = min(aa[i], bb[i]) aa[i] -= t1 bb[i] -= t1 ans += t1 t2 = min(aa[i+1], bb[i]) aa[i+1] -= t2 ans += t2 print(ans)
p02639
s983176137
Wrong Answer
a=list(map(int,input().split())) for v in range (4): if a[v]==0: print(v+1)
p02785
s378837681
Wrong Answer
N, K = map(int, input().split(" ")) H = list(map(int, input().split(" "))) if N <= K: print(0) else: if K == 0: c = sum(H) else: c = sum(H[:-K]) print(c)
p03059
s014213404
Accepted
A,B,T = map(int,input().split()) print(T//A*B)
p02819
s523381176
Accepted
X=int(input()) def isp(n): for i in range(2,n): if n%i==0:return False return True while True: if isp(X): print(X) exit(0) X+=1
p02732
s213880710
Accepted
from collections import Counter N = int(input()) A = list(map(int, input().split())) cnt_A = Counter(A) ans = sum([k * (k - 1) // 2 for k in cnt_A.values()]) for i in range(N): print(ans - (cnt_A[A[i]] - 1))
p02811
s253094467
Accepted
import sys input=sys.stdin.readline k,x=map(int,input().split()) if 500*k>=x: print('Yes') else: print('No')
p02576
s658908826
Accepted
n,x,t = map(int, input().split()) if n%x==0: print((n//x)*t) else: print((n//x + 1)*t)
p03076
s078945065
Accepted
from itertools import permutations import math menu=5 times=[int(input()) for i in range(menu)] orders=list(permutations(times,menu)) minimum=sum(math.ceil(time/10)*10 for time in times) for order in orders: total=order[0] for i in range(1,menu): total+=math.ceil(order[i]/10)*10 minimum=min(minimum,total) print(minimum)
p02918
s394766815
Wrong Answer
N,K = list(map(int,input().split())) S = input() if N == 1: print(0) else: lc = S.count('L') rc = N-lc maxc = lc+rc-2 nowc = 0 now = S[0] for i in range(1,N): if S[i] == now: nowc += 1 else: now = S[i] print(min(nowc+2*K,maxc))
p02719
s956052150
Accepted
N,K=map(int,input().split()) if abs(N-(N//K)*K)<abs((N-(N//K)*K)-K): print(N-(N//K)*K) else: print(abs((N-(N//K)*K)-K))
p03437
s767227653
Wrong Answer
import sys sys.setrecursionlimit(10 ** 5 + 10) def input(): return sys.stdin.readline().strip() def resolve(): def main(): x,y=map(int,input().split()) if y%x==0: return -1 else: i=1 while True: if i*x%y!=0: return i*x break print(main()) resolve()
p03998
s512007335
Accepted
from collections import deque def main(): sas = deque(list(input())) sbs = deque(list(input())) scs = deque(list(input())) deques = {"A": sas, "B": sbs, "C": scs} player = "A" while True: if len(deques[player]) == 0: ans = player break player_temp = deques[player].popleft() player = player_temp.upper() print(ans) if __name__ == "__main__": main()
p03293
s691146875
Wrong Answer
S = input() T = input() N = len(S) for i in range(1, N): if S[N-i:] + S[:N-i] == T: print('Yes') exit() print('No')
p02661
s001645439
Accepted
n=int(input()) AB=[] A=[] B=[] for _ in range(n): a,b = map(int,input().split()) AB.append((a,b)) A.append(a) B.append(b) A.sort() B.sort() #AB = sorted(AB,key=lambda x: x[1]) med = n//2 if n%2 != 0: print(B[n//2]-A[n//2]+1) else: p = (A[n//2] + A[n//2-1])/2 q = (B[n//2] + B[n//2-1])/2 print(int((q-p)*2+1))
p03282
s811029254
Wrong Answer
S = list(input()) for i in S: if i == "1": continue else: print(i) break
p02646
s785105379
Accepted
a,v = map(int,input().split()) b,w = map(int,input().split()) t = int(input()) dif = abs(b-a) waru = v - w if waru <= 0: print('NO') exit() tmp = dif/waru #print(tmp) if tmp<=t: print('YES') else: print('NO')
p03286
s595968163
Wrong Answer
from math import log2 def main(): N = int(input()) if N <= 0: print(0) return K = int(log2(abs(N))) + 1 Ans = [] for _ in range(K): r = N%2 Ans.append(r) N = -1*( N // 2) print(*Ans[::-1],sep="") return if __name__ == "__main__": main()
p03251
s379818647
Wrong Answer
import sys N,M,X,Y = map(int,input().split()) x = list(map(int,input().split())) y = list(map(int,input().split())) #print(x) #print(max(x),min(y)) for Z in range(X+1,Y+1): if max(x) < min(y): if max(x) >= Z and Z <= min(y): print("No War") sys.exit() print('War')
p02633
s453320056
Wrong Answer
x = int(input()) print(360//x)
p03827
s094198842
Accepted
N = int(input()) S = list(input()) dp = [0 for j in range(len(S)+1)] for i in range(len(S)): if S[i] == "I": dp[i+1] = dp[i] + 1 else: dp[i+1] = dp[i] - 1 print(max(dp))
p03107
s288546873
Accepted
s = list(input()) before = [] cnt = 0 for i,now in enumerate(s): if i == 0 or len(before) == 0: before.append(now) continue if before[-1] != now: before.pop() cnt += 2 else: before.append(now) print(cnt)
p04005
s354736842
Wrong Answer
a,b,c=map(int,input().split()) if a%2 or b%2 or c%2: ans=min([a*b,a*c,b*c]) else: ans=0 print(ans)
p03438
s639707437
Accepted
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) sousa=sum(b)-sum(a) cnt=0 for i in range(n): if b[i]>a[i]: cnt+=(b[i]-a[i]+1)//2 if sousa>=cnt: print("Yes") else: print("No")
p04029
s266512979
Accepted
N = int(input()) x = 0 for i in range(N): x += i + 1 print("{}".format(x))
p02971
s833302701
Wrong Answer
n=int(input()) arr=[0]*n for i in range(n): arr[i]=int(input()) tmp=sorted(arr,reverse=True) arrMax=tmp[0] for i in range(n): if arr[i]==arrMax: if tmp[0]==tmp[1]: print(tmp[1]) else: print(tmp[0]) else: print(tmp[1])
p02842
s808044540
Accepted
n = int(input()) if (n + 1) % 108 == 0: print(':(') else: if n % 108 == 0: print(n // 108 * 100) else: a = int(n / 1.08) for i in range(a, a + 3): s = i * 1.08 if n <= s and s < n + 1: print(i) break if i == a + 2: print(':(')
p02785
s819484733
Wrong Answer
n, k= map(int, input().split()) h = list(map(int, input().strip().split())) import numpy as np hnp = np.asarray(h) if(k >= n): print(0) else: s = n-k print(np.sum(hnp[:s]))
p02548
s159896818
Accepted
N = int(input()) cnt = 0 for a in range(1, N): for b in range(a, N, a): cnt += 1 print(cnt)
p03239
s595094610
Accepted
n,t=map(int,input().split()) ct=[list(map(int,input().split())) for i in range(n)] ans=10**8 for i in ct: if i[1]<=t: ans=min(ans,i[0]) if ans==10**8: print("TLE") else: print(ans)
p03360
s815334843
Wrong Answer
numeros = [int(x) for x in input().split()] k = int(input()) index_maior = 0 maior = numeros[0] for index, value in enumerate(numeros): if value > maior: maior = value index_maior = index numeros[index_maior] = numeros[index_maior] * 2 * k print(sum(numeros))
p02718
s183860162
Accepted
n, m = map(int, input().split()) alist = list(map(int, input().split())) alist.sort(reverse=True) tot = sum(alist) if alist[m-1] < tot/(4*m): print('No') else: print('Yes')
p02697
s889581999
Accepted
# E - Rotation Matching N, M = map(int, input().split()) if N%2: for i in range(M): print(i+1, N-(i)) else: for i in range(M): if (i+1)+(N-(N-(i+1))) < N-(i+1)-(i+1): print(i+1, N-(i+1)) else: print(i+2, N-(i+1))
p03679
s194576174
Accepted
import sys x,a,b = map(int,input().split()) if b <= a: print("delicious") elif a + x >= b: print("safe") else: print("dangerous")
p03145
s687429937
Accepted
l=list(map(int,input().split())) ans=l[0]*l[1]//2 print(ans)
p03723
s763898111
Accepted
def func(A, B, C): if A % 2 == 1 or B % 2 == 1 or C % 2 == 1: return 0 if A == B and B == C: return -1 return func((B+C)//2, (C+A)//2, (A+B)//2) + 1 A, B, C = map(int, input().split()) ans = func(A, B, C) print(ans)
p02783
s868766236
Accepted
z=list(map(int,input().split())) a=z[0]//z[1] if z[0]%z[1]!=0: a+=1 print(a)
p02813
s357776212
Accepted
from itertools import permutations n = int(input()) P = list(map(int, input().split())) Q = list(map(int, input().split())) comb = list(permutations([i for i in range(1, n + 1)])) comb.sort() a = 0 b = 0 for i in range(len(comb)): if list(comb[i]) == P: a = i if list(comb[i]) == Q: b = i ans = abs(a - b) print(ans)
p03385
s744702413
Wrong Answer
s=input() s=sorted(s) l=['a','b','c'] if s==l: print('YES') else: print('NO')
p03251
s812640308
Accepted
n,m,x,y = map(int,input().split()) x_L = list(map(int,input().split())) y_L = list(map(int,input().split())) L = [] for i in range(x+1,y+1): falg = True if max(x_L) < i and min(y_L) >= i: print("No War") exit() print("War")
p02613
s219014943
Wrong Answer
n = int(input()) ac,wa,tle,re = 0,0,0,0 for i in range (n): s = input() if s == "AC": ac += 1 elif s == "WA": wa += 1 elif s =="TLE": tle += 1 else: re += 1 print("AC × "+str(ac)) print("WA × "+str(wa)) print("TLE × "+str(tle)) print("RE × "+str(re))
p02647
s584659530
Wrong Answer
(N, K) = map(lambda a: int(a), input().split()) A = list(map(lambda a: int(a), input().split())) def proc(): global A B = [0 for _ in range(N)] for i in range(0,N): f = i - A[i] t = i + A[i] for j in range(max(0, f), min(N, t)): B[j] += 1 A = B for _ in range(0, K): proc() print(" ".join(map(lambda a: str(a), A)))
p03779
s722504439
Accepted
x = int(input()) rest = x for i in range(1,x+1): if i < rest: rest -= i else: print(i) break
p02628
s233861059
Accepted
n, k = map(int, input().split()) p = input().split() for i in range(n): p[i] = int(p[i]) p.sort() a = 0 for i in range(k): a += p[i] print(a)
p03693
s258124904
Accepted
if int("".join(input().split()))%4==0: print("YES") else: print("NO")
p02742
s284920466
Wrong Answer
h,w = map(int, input().split()) area = h*w ans = (-area) // 2 print(-ans)
p02848
s857470418
Wrong Answer
N = int(input()) S = input() ans = '' for i in range(len(S)): temp = ord(S[i]) - ord('A') ans += chr(ord("A") + temp%26 ) print(ans)
p03625
s650528159
Accepted
import collections n = int(input()) a = list(map(str,input().split())) c = collections.Counter(a) set_a = set(a) lists = [] for i in set_a: if int(c[i]) >= 2: lists.append(int(i)) if int(c[i]) >= 4: lists.append(int(i)) lists.sort() lists.reverse() if len(lists) > 1: ans = int(lists[0]) * int(lists[1]) else: ans = 0 print(ans)
p03679
s596314688
Accepted
X,A,B=map(int,input().split()) if A>=B: print('delicious') elif A<B<=X+A: print('safe') else: print('dangerous')
p02677
s263777577
Accepted
import math A, B, H, M = map(int, input().split()) A_degree = (360 / (60 * 12)) * (H * 60 + M) B_degree = (360 / 60) * M A_x = A * math.cos(math.radians(A_degree)) A_y = A * math.sin(math.radians(A_degree)) B_x = B * math.cos(math.radians(B_degree)) B_y = B * math.sin(math.radians(B_degree)) ans = math.sqrt((A_x - B_x)**2 + (A_y - B_y)**2) print(ans)
p02608
s964013269
Accepted
import itertools n = int(input()) lst = [0] * 10 ** 5 combs = list(itertools.combinations_with_replacement([_ for _ in range(1, 100)], 3)) st = {1:1, 2:3, 3:6} for _ in combs: x, y, z = _[0], _[1], _[2] num = x ** 2 + y ** 2 + z ** 2 + (x * y) + (y * z) + (z * x) lst[num-1] += st[len(set(_))] for _ in range(n): print(lst[_])
p02801
s010598074
Wrong Answer
a = input() alpha = ["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(alpha)): alphabet = alpha[i] if a == alphabet: print(alphabet) break
p03449
s224837283
Accepted
import itertools n = int(input()) aa1 = list(map(int, input().split())) aa2 = list(map(int, input().split())) aa2.reverse() aa1 = list(itertools.accumulate(aa1)) aa2 = list(itertools.accumulate(aa2)) aa2.reverse() ans = 0 for i in range(n): tmp = aa1[i] + aa2[i] ans = max(ans, tmp) print(ans)
p02630
s150003915
Wrong Answer
N = int(input()) A = list(map(int, input().split())) Q = int(input()) L = [list(map(int, input().split())) for i in range(Q)] a = [0] * (10 ** 5 + 1) ans = sum(A) for i in range(N): a[A[i]] += 1 for i in range(Q): a[L[i][1]] += a[L[i][0]] ans += a[L[i][0]] * (L[i][1] - L[i][0]) print(ans)
p02912
s813539473
Accepted
import heapq N, M = map(int, input().split()) A = list(map(lambda x: int(x)*(-1), input().split())) heapq.heapify(A) for _ in range(M): tmp = heapq.heappop(A) heapq.heappush(A, tmp/2) A = map(lambda x: int(x)*(-1), A) print(sum(A))
p02556
s283061777
Wrong Answer
p=[] for i in range(int(input())): m,n=map(int,input().split()) p.append([m,n]) g=p p.sort(key=lambda x:x[0]) d=-99999999 for i in range(1,len(p)): d=max(d,abs(p[i][1]-p[i-1][1])+abs(p[i][0]-p[i-1][0])) p=g p.sort(key=lambda x:x[1]) d1=-99999999 for i in range(1,len(p)): d1=max(d1,abs(p[i][1]-p[i-1][1])+abs(p[i][0]-p[i-1][0])) print(max(d,d1))
p02948
s525935412
Wrong Answer
n,m = map(int,input().split()) a = [] for i in range(n): a.append(list(map(int,input().split()))) a.sort(key= lambda x:x[1]) a = a[::-1] now = 0 ans = 0 for i in range(m): while((m-i) < a[now][0]): if now == n-1: break else: now += 1 if a[now][0] <= (m-i): ans += a[now][1] now += 1 if now == n: break print(ans)
p03861
s022261927
Accepted
a,b,x = map(int, input().split()) ans = b//x - (a-1)//x print(ans)
p03852
s260894637
Accepted
s = input() v = ['a','i','u','e','o'] if s in v: print("vowel") else: print('consonant')
p03827
s460474959
Wrong Answer
n = int(input()) s = input() ans = 0 x = 0 for i in s: if s == 'I': x += 1 else: x -= 1 ans = max(ans,x) print(ans)
p03799
s441505631
Accepted
n , m = map(int,input().split()) ans = 0 if m >= n*2: ans += n m -= n*2 ans += m//4 elif m < n*2: ans += m//2 print(ans)
p02791
s368727993
Wrong Answer
n,*p=map(int,open(0).read().split()) cnt=0 for i in range(1,n)[::-1]: if p[i-1]<p[i]: cnt+=1 print(n-cnt)
p02989
s751408534
Wrong Answer
import sys input=sys.stdin.readline n=int(input()) L=list(map(int,input().split())) L.sort() num=abs(L[n//2-1]-L[n//2]) print(num if num!=1 else 0)
p02570
s065122844
Wrong Answer
x,y ,z= map(int,input().split()) if x/z >=y: print('Yes') else: print('No')
p04033
s739764349
Accepted
a, b = list(map(int, input().split())) if a <= 0 <= b: ### a と b の間に0を含む時 print("Zero") elif 0 < a <= b: ### a と b が正の場合 print("Positive") elif a <= b < 0: ### a と b が負の場合 ### a と b の間に数字が偶数個なら正、奇数個なら負 if (b - a + 1) % 2 == 0: print("Positive") else: print("Negative")
p03998
s956195707
Accepted
S = {c: list(input()) for c in 'abc'} s = 'a' while S[s]: s = S[s].pop(0) print(s.upper())
p02924
s856544365
Wrong Answer
N = int(input()) print(int((1/2)*N*(N-1)))
p02918
s644306880
Wrong Answer
n,k=map(int,input().split()) s=input() p2=0 p1=0 if n==1: print(0) exit() if s[0]=="L": p1+=1 if s[n-1]=="R": p1+=1 for i in range(1,n): if not (s[i]=="L" and s[i-1]=="R"): continue p2+=1 if k<=p2-1: print(n-2*p2-p1+2*k) elif p2<k<p2+p1: print(n-p1+(k-p2)) else: print(n-1)
p02571
s773472539
Wrong Answer
string = input() sub_string = input() change = 0 for i in range(0, len(sub_string)): if sub_string[i] in string: if sub_string[i] != string[i]: change += 1 else: change += 1 print(change)
p03481
s443132742
Accepted
x, y = map(int, input().split()) ans = 0 while x <= y: ans += 1 x *= 2 print(ans)
p03679
s689672723
Accepted
x,a,b=map(int,input().split()) print("dangerous" if x<b-a else "safe" if a<b else "delicious")
p02646
s167241547
Wrong Answer
a, v = map(int, input().split()) b, w = map(int, input().split()) t = int(input()) a_place = a b_place = b if w >= v: print('No') else: for i in range(1,t): a_place += v b_place += w if a_place == b_place: print('Yes') break
p04031
s328544042
Accepted
def main(): N = int(input()) A = list(map(int, input().split(' '))) sum_A = sum(A) left, right = sum_A // N, sum_A // N + 1 loss_1 = sum([(a - left) ** 2 for a in A]) loss_2 = sum([(a - right) ** 2 for a in A]) if loss_1 < loss_2: print(loss_1) else: print(loss_2) if __name__ == '__main__': main()
p02996
s873941742
Wrong Answer
n = int(input()) a = [0] * n b = [0] * n sa = [0] * n for i in range(n): a[i], b[i] = map(int, input().split()) c = b.copy() c.sort() wa = 0 for i in c: wa += a[b.index(i)] print(wa, b[c.index(i)]) if wa > b[b.index(i)]: print("No") exit() print("Yes")
p02725
s776154545
Accepted
a=list(map(int,input().split())) b=list(map(int,input().split())) c=[b[0]+(a[0]-b[a[1]-1])] for i in range(a[1]-1): c.append(b[i+1]-b[i]) print(sum(c)-max(c))
p02766
s617751213
Accepted
n,k = map(int, input().split()) ans = 0 while True: n //= k ans += 1 if n == 0: break print(ans)
p03241
s303412959
Wrong Answer
import math n,m=map(int,input().split()) num=int(math.sqrt(m)) ans=1 if n==1: ans=m else: for i in range(1,num+1): if m%i==0 and m//i>=n: ans=i print(ans)
p02811
s517404645
Wrong Answer
K,X = map(int,input().split()) if K*500 >= X: print("YES") else: print("NO")
p03324
s822116370
Wrong Answer
d,n = map(int,input().split()) ans = 0 if d == 0: ans = n elif d == 1: ans = 100 * n else: ans = 10000 * n if n == 100: ans += n print(ans)
p02682
s495895422
Accepted
a,b,c,k = map(int, input().split()) if k <= a: print(k) else: ans = a k = k-a if k <= b: print(ans) else: k = k-b print(ans-k)
p02742
s279957900
Accepted
H, W = map(int, input().split()) if H == 1 or W == 1: print(1) elif H%2 == 0: print(H//2 * W) elif W%2 == 0: print((H//2 + 1) * int(W//2) + int(H//2) * int(W//2)) else: print(int(H//2 + 1) * int(W//2 + 1) + int(H//2) * int(W//2))
p02677
s637593985
Accepted
import math a,b,h,m=map(int,input().split()) h=h*30+0.5*m m*=6 x=min(abs(h-m),360-abs(h-m)) y=math.cos(math.radians(x)) if x==1: print(0) else: print(math.sqrt(a**2+b**2-2*a*b*y))
p03319
s476677504
Wrong Answer
N, K = map(int, input().split()) Alist = list(map(int, input().split())) if K >= N: print(1) else: from math import ceil one = Alist.index(1) left = N right = N - one - 1 print(ceil(left / K) + ceil(right / K))
p02725
s239822111
Accepted
k,n = map(int, input().split()) lst = list(map(int, input().split())) maxDis = (k-lst[-1]) + lst[0] for i in range(n-1): if lst[i+1] - lst[i] > maxDis: maxDis = lst[i+1] - lst[i] print(k-maxDis)
p02756
s556780649
Accepted
A = input() B = int(input()) C = "" for i in range(B): D = input().split() if D[0] == "1": C,A = A,C else: if D[1] == "1": C += D[2] else: A += D[2] C = C[::-1] print(C+A)
p02988
s521387422
Wrong Answer
n=int(input()) list=input().split() for f in list: f=float(f) def sec(a, b, c): l=[a, b, c] l.sort() return l[1] count=1 c=0 for i in range(n-2): if sec(list[count], list[count+1], list[count-1])==list[count]: c=c+1 count=count+1 print(c)