結果
| 問題 |
No.3116 More and more teleporter
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-10 02:29:48 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 598 bytes |
| コンパイル時間 | 6,327 ms |
| コンパイル使用メモリ | 333,824 KB |
| 実行使用メモリ | 12,824 KB |
| 最終ジャッジ日時 | 2025-04-10 02:29:59 |
| 合計ジャッジ時間 | 9,710 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 16 |
ソースコード
#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using ll = long long;
using namespace atcoder;
ll n,q,t,x,c;
ll op(ll a, ll b){
return min(a,b);
}
ll e(){
return LLONG_MAX;
}
int main(){
cin >> n >> q;
vector<ll> a(n,1e18);
segtree<ll,op,e> left(a),right(a);
while(q--){
cin >> t;
if(t == 1){
cin >> x;
cout << min(x - 1,max(left.prod(0,x) + x,right.prod(x,n) - x)) << endl;
}
else{
cin >> x >> c;
left.set(x - 1,c - x);
right.set(x - 1,c + x);
}
}
}