結果
| 問題 |
No.1705 Mode of long array
|
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2024-08-08 21:05:25 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 647 ms / 3,000 ms |
| コード長 | 450 bytes |
| コンパイル時間 | 433 ms |
| コンパイル使用メモリ | 82,036 KB |
| 実行使用メモリ | 95,212 KB |
| 最終ジャッジ日時 | 2024-08-08 21:05:52 |
| 合計ジャッジ時間 | 25,868 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 51 |
ソースコード
n,m=map(int,input().split())
a=list(map(int,input().split()))
B=317
st1=[(0,i) for i in range(B*B)]
for i in range(m):
st1[i]=(a[i],i)
st2=[max(st1[i*B:i*B+B]) for i in range(B)]
q=int(input())
for _ in range(q):
t,x,y=map(int,input().split())
x-=1
if t==1:
st1[x]=(st1[x][0]+y,x)
i=x//B
st2[i]=max(st1[i*B:i*B+B])
if t==2:
st1[x]=(st1[x][0]-y,x)
i=x//B
st2[i]=max(st1[i*B:i*B+B])
if t==3:
print(max(st2)[1]+1)
sasa8uyauya