結果

問題 No.875 Range Mindex Query
ユーザー 2bit2bit
提出日時 2023-01-24 09:37:03
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,584 bytes
コンパイル時間 3,553 ms
コンパイル使用メモリ 202,572 KB
実行使用メモリ 6,164 KB
最終ジャッジ日時 2023-09-08 06:38:29
合計ジャッジ時間 5,084 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define fix(x) fixed << setprecision(x)
#define eb emplace_back
constexpr char nl='\n';
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<long long>;
using vvl = vector<vector<long long>>;
using vs = vector<string>;
using pl = pair<long long, long long>;
template <typename T> inline bool chmin(T& a, const T& b) {bool compare = a > b; if (a > b) a = b; return compare;}
template <typename T> inline bool chmax(T& a, const T& b) {bool compare = a < b; if (a < b) a = b; return compare;}
template<class T>using rp_queue=priority_queue<T,vector<T>,greater<T>>;
void fast_io(){cin.tie(nullptr);ios_base::sync_with_stdio(false);}
template <typename T> T gcd(T a, T b) {if (b == 0)return a; else return gcd(b, a % b);}
template <typename T> inline T lcm(T a, T b) {return a /gcd(a, b)*b;}
const ll INF = 1LL << 60;
const ld PI = 3.14159265358979323846L;
#include<atcoder/segtree>
using namespace atcoder;
ll op(ll a,ll b){
  return min(a,b);
}
ll e(){
  return INF;
}
void solve(){
  int N,Q;cin>>N>>Q;
  vl A(N);rep(i,N)cin>>A[i];
  segtree<ll,op,e> seg(A);
  while(Q--){
    int t,l,r;
    cin>>t>>l>>r;
    if(t==1){
      l--;
      r--;
      ll L = seg.get(l),R =seg.get(r);
      seg.set(l,R);
      seg.set(r,L);
    }else{
      l--;
      cout<<seg.prod(l,r)<<endl;
    }
  }
}
int main(){
  fast_io();
  int num_tc = 1;
  //cin >> num_tc;
  rep(tc,num_tc){
    //cout << "Case #" << tc+1 << ": " ;// << endl;
    solve();
  }
}
0