結果
問題 |
No.3116 More and more teleporter
|
ユーザー |
|
提出日時 | 2025-04-10 02:25:22 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 572 bytes |
コンパイル時間 | 5,854 ms |
コンパイル使用メモリ | 332,992 KB |
実行使用メモリ | 12,796 KB |
最終ジャッジ日時 | 2025-04-10 02:25:33 |
合計ジャッジ時間 | 9,969 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; segtree<ll,op,e> left(n),right(n); 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); } } }