problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03379
s547341530
Accepted
n = int(input()) x_1 = list(map(int, input().split())) x_2 = sorted(x_1) median_1 = x_2[n//2-1] median_2 = x_2[n//2] for v in x_1: if v <= median_1: print(median_2) else: print(median_1)
p02836
s558887980
Accepted
s = input() count=0 for i in range(len(s)//2): if s[i] != s[-1-i]: count+=1 print(count)
p02571
s855339235
Wrong Answer
s=input() t=input() for i in range(len(t),0,-1): for j in range(0,len(t)-i+1): sum=t[j:j+i] if sum in s[j:]: k=s[j:].find(sum) if len(s)-(k+j)>=len(t): print(sum,j,k) print(len(t)-len(sum)) exit() print(len(t))
p04011
s352344026
Wrong Answer
n=int(input()) k=int(input()) x=int(input()) y=int(input()) if n <= k: print(n*y) else: print(k*x+ (n-k)*y)
p02694
s360166060
Accepted
x = int(input()) money = 100 i=0 while(money<x): money = int(money*1.01) i+=1 print(i)
p03624
s721517292
Accepted
from string import ascii_lowercase alpha = {i for i in ascii_lowercase} s = set([i for i in input()]) ans = sorted(alpha - s) if ans==[]: print('None') else: print(ans[0])
p02923
s235131923
Accepted
n=int(input()) mas=list(map(int,input().split())) out=[] mx=0 i=0 while i<n: if mx>n-i: break j=i ans=0 while j<n-1: if mas[j]>=mas[j+1]: ans+=1 else: break j+=1 if ans>mx: mx=ans i+=ans+1 print(mx)
p03345
s138339733
Wrong Answer
A,B,C,K = map(int, input().split()) MAX = 10**18 for i in range(K): temp_a = A temp_b = B temp_c = C A = temp_b + temp_c B = temp_a + temp_c C = temp_a + temp_b if A > MAX or B > MAX or C > MAX: print("Unfair") exit() if abs(A-B) > MAX: print("Unfair") else: print(A-B)
p02720
s449084553
Accepted
k = int(input()) ans = [] def dfs(x): if x > 10**10: return 0 else: ans.append(x) y = x % 10 for i in range(10): if abs(y-i) <= 1: dfs(10*x+i) for i in range(1, 10): dfs(i) ans.sort() print(ans[k-1])
p02813
s520450889
Wrong Answer
from itertools import permutations N = int(input()) P = tuple(map(int, input().split())) Q = tuple(map(int, input().split())) pi = 0 qi = 0 cnt = 0 for p in permutations(range(1,1+N)): cnt += 1 #print(p) if p == P: pi = cnt elif p == Q: qi = cnt print(abs(qi-pi))
p02633
s430893042
Accepted
x = int(input()) i = 1 while x*i%360 != 0: i+= 1 print(i)
p03785
s702352081
Accepted
N,C,K=list(map(int,input().split())) import sys l=[r.rstrip() for r in sys.stdin.readlines()] l=list(map(int,l)) l.sort() ans=0 now=0 for i in range(N): X=l[now] for j in range(C): if X <= l[now] <= X+K: now+=1 if now==N: break else: break ans+=1 if now==N: break print(ans)
p02705
s175019037
Accepted
R = int(input()) print(2*3.14159*R)
p03086
s077862578
Accepted
S = input() cnt = 0 ans = 0 for s in S: if s not in ("A", "C", "G", "T"): cnt = 0 else: cnt += 1 ans = max(ans, cnt) print(ans)
p03730
s392848814
Accepted
from fractions import gcd A, B, C = map(int, input().split()) print('YES' if C % gcd(A, B) == 0 else 'NO')
p03206
s169672547
Accepted
d=int(input()) print("Christmas" + " Eve"*(25-d))
p03136
s603805591
Accepted
n = int(input()) l = list(map(int,input().split())) s = sum(l) m = max(l) if m<s-m: print("Yes") else: print("No")
p02687
s621428883
Wrong Answer
N = input() print('ABC' if N == 'ARC' else 'ABC')
p02801
s507483800
Accepted
C = input() print(chr(ord(C)+1))
p02681
s607630815
Accepted
S = input() T = input() a = T.find(S) if a == 0: T = T[len(S):] if len(T) == 1: print("Yes") else: print("No") else: print("No")
p03623
s881637851
Wrong Answer
x, a, b = map(int, input().split()) if abs(a - x) > abs(b - x): print("A") else: print("B")
p02888
s059465976
Accepted
# solution import io import math import heapq import bisect MOD = 10**9+7 N = int(input()) array = list(map(int, input().split())) array.sort() result = 0 for a in range(N-2): for b in range(a+1,N-1): c = bisect.bisect_left(array,array[a]+array[b]) result += c-b-1 print(result)
p03254
s211983481
Accepted
n,x=map(int,input().split()) a=list(map(int,input().split())) a.sort() ans=0 for i in range(n): if x>=a[i]: x-=a[i] ans+=1 else: break else: if x>0: ans-=1 print(ans)
p02724
s671387304
Accepted
x = int(input()) ans = 0 ans += x//500*1000 x = x%500 ans += x//5*5 print(ans)
p02708
s153260083
Accepted
import math n, k = list(map(int, input().split())) mod = 10**9 +7 sn = (n*(n+1)*(n+2)/6 +n+1)% mod sk = ((k-1)*k*(3*n-2*k+4)/6 +k-1)% mod snk = math.floor((sn - sk)% mod) print(snk)
p03774
s222776545
Accepted
n, m = map(int, input().split()) ab = [tuple(map(int, input().split())) for _ in range(n)] cd = [tuple(map(int, input().split())) for _ in range(m)] dist = [0] * m for a, b in ab: dist = [0] * m for j in range(m): dist[j] = abs(a-cd[j][0]) + abs(b-cd[j][1]) ans = dist.index(min(dist)) + 1 print(ans)
p02729
s512178246
Accepted
from operator import mul from functools import reduce def combinations_count(n, r): if n<r: return 0 r = min(r, n - r) numer = reduce(mul, range(n, n - r, -1), 1) denom = reduce(mul, range(1, r + 1), 1) return numer // denom def main(): N,M = map(int, input().split()) ans = combinations_count(M,2) + combinations_count(N,2) print(ans) main()
p02707
s989089998
Wrong Answer
from collections import deque as dq n = int(input()) a = dq(int(i) for i in input().split()) l = [0] * (n - 1) for i in a: l[i - 1] += 1 for i in l: print(i)
p03639
s482943867
Wrong Answer
n = int(input()) aa = list(map(int, input().split())) c2 = 0 c4 = 0 for a in aa: if a % 4 == 0: c4 += 1 elif a % 2 == 0: c2 += 1 if c2 == 0 and c4 == 0: print('No') exit() if c4 + c2 == n: print('Yes') elif n/2 -1 < c4 < n/2 + 1: print('Yes') elif n % 4 == 2: if c4 == n / 2 - 1 and c2 == 2: print('Yes') else: print('No')
p03282
s610946359
Accepted
S = str(input()) K = int(input()) s = list(S) i = 0 p = 0 for i in range(len(s)): s[i] = int(s[i]) i = 0 while i < len(s): if s[i] == 1: p = i + 1 else: q = s[i] break i = i+1 if K < p + 1: print(1) else: print(q)
p02953
s174256738
Wrong Answer
n=int(input()) h =list(map(int,input().split())) if n ==1: print('Yes') exit() for i in range(n-1): if h[i] >= h[i+1]: h[i] -=1 if h == sorted(h): print('Yes') else: print('No')
p02584
s200549902
Accepted
from sys import stdin,stdout for _ in range(1):#int(stdin.readline())): # n=int(stdin.readline()) x,k,d=list(map(int,stdin.readline().split())) '''if x==k==d: print(0 if k&1 else x) continue''' x=abs(x) des=x%d op=x//d # print(des,op) a=[des,des-d] if k<op:#check for eq print(x-k*d) else: print(abs(a[(k-op)%2]))
p02766
s352932506
Accepted
n, k = [int(w) for w in input().split()] d = 0 while n != 0: n //= k d += 1 print(d)
p02718
s718288315
Wrong Answer
n,m = map(int,input().split()) lists = list(map(int, input().split())) lists.sort() sums = sum(lists)/4/m lens = len(lists) for i in range(m): if lists[lens-1-i] < sums: print("No") break print("Yes")
p02628
s515221911
Accepted
N, K = map(int, input().split()) p = list(map(int, input().split())) p.sort() print(sum(p[:K]))
p02881
s972852444
Wrong Answer
import math N = int(input()) a = math.floor(math.sqrt(N)) while N % a != 0: a -= 1 b =N/a print(a + b -2)
p03324
s394726723
Accepted
d,n = map(int, input().split()) print((100**d)*n if n <= 99 else (100**d)*101)
p03013
s222436272
Accepted
n, m = map(int, input().split()) s = [1] * (n + 1) for i in range(m): a = int(input()) s[a] = 0 for i in range(2, n + 1): if s[i] == 0: continue else: if s[i - 2] == 0 and s[i - 1] == 0: print(0) exit() else: s[i] = s[i - 1] + s[i - 2] print(s[n] % 1000000007)
p03126
s778845368
Accepted
N, M = map(int, input().split()) res = [0] * (M + 1) for _ in range(N): A = list(map(int, input().split())) K = A.pop(0) for a in A: res[a] += 1 ans = 0 for r in res: if r == N: ans += 1 print(ans)
p03481
s672128919
Wrong Answer
X, Y = map(int, input().split()) res = 0 while X < Y: res += 1 X *= 2 print(res)
p02646
s560596579
Wrong Answer
import sys a, v = map(int, input().split()) b, w = map(int, input().split()) t = int(input()) if a>b or w>v: print('NO') sys.exit() for tt in range(1,t): res = (w - v) * tt + (b - a) if res == 0: print('YES') sys.exit() print('NO')
p02717
s428786616
Accepted
from collections import Counter,defaultdict,deque from heapq import heappop,heappush,heapify from bisect import bisect_left import sys,math,itertools,fractions,pprint sys.setrecursionlimit(10**8) mod = 10**9+7 INF = float('inf') def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, sys.stdin.readline().split())) a = inpl() print(a[2],a[0],a[1])
p03437
s019752225
Accepted
import sys readline = sys.stdin.readline MOD = 10 ** 9 + 7 INF = float('INF') sys.setrecursionlimit(10 ** 5) def main(): x, y = map(int, readline().split()) if x % y == 0: print(-1) else: print(x * (y - 1)) if __name__ == '__main__': main()
p02795
s938660898
Accepted
H = int(input()) W = int(input()) N = int(input()) print((N + max(H, W) - 1) // max(H, W))
p02791
s904078498
Accepted
n = int(input()) pl = list(map(int, input().split())) count = 1 min_e = pl[0] for e in pl[1:]: if (e < min_e): count += 1 min_e = e print(count)
p03137
s737879878
Accepted
import itertools N,M = map(int,input().split()) ary1 = map(int,input().split()) if N>=M: print(0) else: ary2 = sorted(list(ary1)) ary3 = ary2[1:] ary4 = ary2[:-1] d1 = ary2[M-1]-ary2[0] dist1 = sorted([i-j for i,j in zip(ary3,ary4)])[M-N:M] d2 = sum(dist1) print(d1-d2)
p02556
s678653010
Accepted
import sys input = sys.stdin.readline def main(): N = int(input()) Z = []; W = [] for i in range(N): x, y = map(int, input().split()) z = x + y w = x - y Z.append(z) W.append(w) ans = max(max(Z) - min(Z), max(W) - min(W)) print(ans) if __name__ == "__main__": main()
p02548
s423164712
Wrong Answer
max = int(input()) - 1 cnt = 0 for A in range(max): for B in range(max): if A*B > max: break cnt += 1
p02792
s272430290
Wrong Answer
N = int(input()) dp = [[0] * 10 for _ in range(10)] for x in range(1, N + 1): j = x % 10 while x > 10: x //= 10 i = x % 10 dp[i][j] += 1 ans = 0 for i in range(1, 10): for j in range(1, 10): ans += dp[i][j] * dp[j][i] print(ans)
p03759
s422772805
Wrong Answer
a, b, c = list(map(int, input().split())) if b-a == c-b: print("Yes") else: print("No")
p02576
s556144463
Accepted
import math n,x,t = map(int, input().split()) print(math.ceil(n/x)*t)
p02678
s814522415
Accepted
N,M=list(map(int,input().split())) g=[[] for i in range(N+1)] for i in range(M): a,b=list(map(int,input().split())) g[a].append(b) g[b].append(a) from collections import deque queue = deque([1]) d = [None] * (N+1) while queue: v = queue.popleft() for i in g[v]: if d[i] is None: d[i] = v queue.append(i) print("Yes") print(*d[2:],sep='\n')
p02829
s785016946
Accepted
#!/usr/bin/env python3 A = int(input()) B = int(input()) for i in [1, 2, 3]: if i != A and i != B: print(i)
p03632
s592528228
Accepted
l=list(map(int,input().split())) print(max(0,min(l[1],l[3])-max(l[0],l[2])))
p03474
s822306401
Accepted
a, b = map(int, input().split()) s = str(input()) lst = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'] for i in range(len(s)): if(i != a): if(s[i] not in lst): print("No"); exit(0) else: if(s[i] != '-'): print("No"); exit(0) print("Yes")
p03623
s210139018
Wrong Answer
a,b,c=(int(x) for x in input().split()) if a < b < c: print( 'A' ) elif a < c < b: print( 'A' ) elif b < a < c: print( 'B' ) elif b < c < a: print( 'B' ) else: print( 'C' )
p02793
s604297325
Wrong Answer
def gcd(a, b): while b: a, b = b, a % b return a def lcm(a, b): return a * b // gcd(a, b) N = int(input()) A = list(map(int, input().split())) MOD = 1 * 10**9 + 7 LCM = A[0] for i in range(1, N): LCM = lcm(LCM, A[i]) ans = 0 for i in range(N): ans += (LCM // A[i]) % MOD # print(LCM) print(ans)
p03557
s957994539
Accepted
import bisect n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort(),c.sort() x=len(c) ans=0 for bi in b: xa=bisect.bisect_right(c,bi) xb=bisect.bisect_left(a,bi) ans+=xb*(x-xa) print(ans)
p02783
s184994691
Wrong Answer
h,a = map(int,input().split()) b = h/a if b%1 == int(0): print(b) elif b%1 < 0: print(1) else: print(b//1)
p03951
s765440881
Accepted
n = int(input()) s = input() t = input() for zurasu in range(0, n+1): if s[zurasu:] == t[:n-zurasu]: print(n+zurasu) exit(0)
p02866
s306092877
Wrong Answer
from collections import Counter N = int(input()) D = list(map(int, input().split())) D = Counter(D) ans = 0 cnt = 0 if D[0] == 1: cnt = 1 ans = 1 for i in range(1, max(D)+1): if D[i] == 0: ans = 0 break else: ans *= cnt ** D[i] cnt = D[i] ans = ans % 998244353 print(ans)
p03030
s281031502
Wrong Answer
n=int(input()) l=[] for i in range(n): a,b=map(str, input().split()) b=100-int(b) if b<10: b=str('0')+str(b) else: b=str(b) a=a+b l.append(a) l2=sorted(l) for i in range(n): print(l.index(l2[i])+1)
p03838
s594493249
Wrong Answer
x,y = map(int,input().split()) if x == y: print(0) elif x < y: print(y-x) else: if x > 0 and y >= 0: print(1+abs(x-y)) elif x > 0 and y < 0: if x+y >= 0: print(1+x+y) else: print(1+abs(x+y)) else: print(2+x-y)
p02958
s541829982
Accepted
n = int(input()) a = [int(k) for k in input().split()] cnt = 0 for i in range(n): if a[i] != i+1:cnt += 1 print("YES" if cnt <= 2 else "NO")
p03723
s026575556
Accepted
a, b, c = map(int, input().split()) cnt = 0 while cnt <= 10**6: if (a%2 != 0 or b%2 != 0 or c%2 != 0): print(cnt) exit() if a==b==c: print(-1) exit() a_ = b//2 + c//2 b_ = a//2 + c//2 c_ = a//2 + b//2 a = a_ b = b_ c = c_ cnt += 1
p04005
s565092068
Accepted
import math import sys input = sys.stdin.readline a, b, c = map(int, input().split()) x = (a//2)*b*c x = abs(abs(x-a*b*c)-x) y = (b//2)*a*c y = abs(abs(y-a*b*c)-y) z = (c//2)*a*b z = abs(abs(z-a*b*c)-z) print(min(x, y, z))
p03241
s823704964
Accepted
N,M=map(int,input().split()) for i in range(M//N,0,-1): if M%i==0: break print(i)
p02773
s209107126
Wrong Answer
N=int(input()) listS=[] for i in range(N): S=input() listS+=[S] listS.sort() counter=[] count=1 for i in range(N-1): if listS[i]==listS[i+1]: count+=1 if count==N: counter+=[count] else: counter+=[count] count=1 MAX=max(counter) count=1 for i in range(N-1): if listS[i]==listS[i+1]: count+=1 if count==MAX: print(listS[i+1]) else: counter+=[count] count=1
p02708
s194990181
Accepted
n, m = map(int, input().split(' ')) b = (n + 1)*(n**2 + 2*n + 6) a = m*(2*m**2 - 3*m*(n + 2) + 3*n - 2) ans = (a + b)//6+1 ans = ans % 1000000007 print(ans)
p02661
s888276189
Wrong Answer
N = int(input()) AB = [] for i in range(N): AB.append(list(map(int, input().split()))) l = 0 r = 0 AB.sort() if N % 2 == 0: l = AB[N//2][0] + AB[N//2 - 1][0] else: l = AB[N//2][0] AB.sort(key = lambda x: x[1]) if N % 2 == 0: r = AB[N//2][1] + AB[N//2 - 1][0] else: r = AB[N//2][1] if N % 2 == 0: print((r - l) * 2 + 1) else: print(r - l + 1)
p03796
s796764380
Accepted
import math n = int(input()) print(math.factorial(n)%(10**9+7))
p02819
s754787849
Accepted
import math x = int(input()) while True: for i in range(2,int(math.sqrt(x))+1): if x%i==0: break else: print(x) break x += 1
p03371
s199019048
Accepted
a,b,c,x,y = map(int,input().split()) cur = a*x+b*y z = 0 while True: x,y,z = x-1,y-1,z+2 if a*max(0,x)+b*max(0,y)+c*z <= cur: cur = a*max(0,x)+b*max(0,y)+c*z else: print(cur) exit()
p02677
s538571595
Accepted
def mp(): return map(int, input().split()) def lmp(): return list(map(int, input().split())) import math a,b,h,m = mp() hkaku = h*30+m*0.5 mkaku = m*6 cos = math.cos((mkaku-hkaku)*math.pi/180) u = a**2+b**2-2*a*b*cos print(math.sqrt(u))
p02689
s774729756
Accepted
import sys input=sys.stdin.readline N,M=(int(x) for x in input().rstrip('\n').split()) Hs = [int(x) for x in input().rstrip('\n').split()] nums = [1 for x in Hs] for i in range(M): roads = [int(x) for x in input().rstrip('\n').split()] if Hs[roads[0]-1] < Hs[roads[1]-1]: nums[roads[0]-1] = 0 elif Hs[roads[0]-1] > Hs[roads[1]-1]: nums[roads[1]-1] = 0 else: nums[roads[0]-1] = 0 nums[roads[1]-1] = 0 print(sum(nums))
p03069
s818516987
Wrong Answer
N = int(input()) S = list(input()) cnt = 0 for i in range(N-1): if (S[i] == "#" and S[i+1] == "."): cnt += 1 S[i+1] = "#" print(cnt)
p03632
s641577384
Wrong Answer
a,b,c,d = map(int,input().split()) print(max(0,min(b,d)-c))
p03795
s177844077
Accepted
import math #A,B=list(map(int, input().split())) N=int(input()) print(N*800-N//15*200)
p02663
s831884071
Wrong Answer
H1, M1, H2, M2, K = map(int,input().split()) import math p=(H2-H1)*60 if M1-M2<0: a=M1-M2+60 p-=60 else: a=M1-M2 p+=a time = K*math.floor(p/K) if p%K==0: time=time-K print(time)
p02600
s876945708
Wrong Answer
X=int(input()) print(X)
p03804
s058826934
Accepted
n, m = map(int, input().split()) a = [input() for _ in range(n)] b = [input() for _ in range(m)] ans = 'No' for i in range(n-m+1): for j in range(n-m+1): match = 1 for k in range(m): for l in range(m): if a[i+k][j+l] != b[k][l]: match = 0 if match: ans = 'Yes' print(ans)
p02582
s105821039
Accepted
S=input() if S=="RSR": print(1) else: print(S.count("R"))
p03971
s260559630
Accepted
N, A, B = map(int,input().split()) S = list(input()) b = 0 c = 0 for i in range(N) : if (S[i] == 'a') and (c < A + B) : print('Yes') c += 1 elif S[i] == 'b' and (c < A + B) and b < B: print('Yes') b += 1 c += 1 else : print('No')
p03799
s284958983
Accepted
n,m=map(int,input().split()) cnt=0 if m-2*n>=0: m=m-2*n cnt+=n num=m//4 cnt+=num else: num=m//2 n=n-num if n>=0: cnt+=num print(cnt)
p02608
s873818136
Accepted
n = int(input()) ans = [0] * (n+1) for x in range(100): for y in range(100): for z in range(100): m = x**2 + y**2 + z**2 + x*y + y*z + z*x if 1 <= x * y * z and 0 <= m <= n: ans[m] += 1 for i in range(n): print(ans[i+1])
p02811
s930327321
Accepted
K,X = map(int,input().split()) if K*500>=X: print("Yes") else: print("No")
p02606
s934165388
Accepted
in_1 = input() L, R, d = in_1.split() L, R, d = int(L), int(R), int(d) cnt = 0 for i in range(L, R + 1): if i % d == 0: cnt += 1 print(cnt)
p03524
s178982001
Accepted
from collections import Counter s=Counter(input()) b,m=max(s.values()),min(s.values()) kind = len(s.keys()) if kind==3: if b-m<=1: print("YES") else: print("NO") elif kind==2: if b==1 and m==1: print("YES") else: print("NO") else: if b==1: print("YES") else: print("NO")
p02618
s787580207
Wrong Answer
import numpy as np D = int(input()) c = list(map(int,input().split())) s=[] f=[] for i in range(D): if(i%26 == 0): f = [0]*26 x = np.array(list(map(int, input().split()))) for j in range(26): if(f[j]!=0): x.delete(1,j) s.append(x.argmax()) for i in range(D): print(s[i])
p03323
s289556039
Wrong Answer
a,b = map(int,input().split()) if a + b > 16 or a > 8 or b > 8: print(":(") else: print("yey!")
p02571
s804845328
Wrong Answer
S = input() T = input() ans=float('inf') for start in range(len(S) - len(T)): ans = min(ans, sum(s != t for s, t in zip(S, T))) print(ans)
p02880
s800586211
Accepted
num1 = [i for i in range(1,10)] num2 = [i for i in range(1,10)] ans = [] for i in num1: for j in num2: ans.append(i*j) n = int(input()) if n in ans: print("Yes") else: print("No")
p03243
s609740842
Wrong Answer
import math def main(): n=int(input()) a=int(n/100) b=int((n-a*100)/10) c=n%10 max=a if b > max: max = b if c > max: max = c print(max*100+max*10+max) main()
p02795
s263281035
Accepted
h=int(input()) w=int(input()) n=int(input()) x=max(h,w) for i in range(10**4): if x>=n: print(i+1) exit() if h>w: x+=h else: x+=w
p02819
s391568711
Wrong Answer
X = int(input()) def isprime(n): if n < 2: # 2未満は素数でない return False if n == 2: # 2は素数 return True for p in range(2, n): if n % p == 0: # nまでの数で割り切れたら素数ではない return False # nまでの数で割り切れなかったら素数 return True while isprime(X)==False: isprime(X) X = X + 1 print(X)
p02628
s765094897
Wrong Answer
n,k = map(int, input().split()) p = list(map(int, input().split())) p.sort() print(sum(p[:3]))
p02963
s374597699
Wrong Answer
S=int(input()) x1,y1,x2,y2,x3,y3=0,0,-(-S//10**9),10**9-S%10**9,1,10**9 print(x1,y1,x2,y2,x3,y3)
p03852
s368062563
Accepted
c = input() bo = "aeiou" if c in bo: print("vowel") else: print("consonant")
p02556
s342905872
Wrong Answer
import sys input = sys.stdin.readline INF = 10**18 sys.setrecursionlimit(10**6) def li(): return [int(x) for x in input().split()] N = int(input()) md = [] for i in range(N): x, y = li() md.append(x + y) maxv = max(md) minv = min(md) print(maxv - minv)
p02899
s672751759
Accepted
n=int(input()) b =list(map(int,input().split())) res=[0] * n for i in range(n): res[b[i]-1] = i+1 for i in res: print(i,end=' ')