| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1294734 | tofikk | Addk (eJOI21_addk) | Pypy 3 | 2098 ms | 56492 KiB |
#bu nədi gələn səfər daha çətin sal Tuncay
N,K=map(int, input().split())
A=list(map(int, input().split()))
Q=int(input())
for _ in range(Q):
query=input().split()
if query[0]=='1':
indices=[int(x)-1 for x in query[1:]]
temp=A[indices[0]]
for i in range(len(indices)-1):
A[indices[i]]=A[indices[i+1]]
A[indices[-1]]=temp
elif query[0]=='2':
l,r,m=map(int, query[1:])
l-=1
r-=1
total=0
length=r-l+1
for i in range(length):
x=i+l
w=min(i+1,m,length-i)
total+=A[x]*w
print(total)Compilation message (stdout)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
