結果

問題 No.1675 Strange Minimum Query
ユーザー aut_jul_duraut_jul_dur
提出日時 2021-09-10 23:31:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,346 bytes
コンパイル時間 4,357 ms
コンパイル使用メモリ 236,452 KB
実行使用メモリ 15,892 KB
最終ジャッジ日時 2023-09-02 22:29:13
合計ジャッジ時間 14,441 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,372 KB
testcase_02 WA -
testcase_03 AC 261 ms
7,944 KB
testcase_04 AC 236 ms
10,192 KB
testcase_05 AC 21 ms
7,352 KB
testcase_06 AC 308 ms
8,616 KB
testcase_07 AC 331 ms
11,512 KB
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 -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const long long MOD = 998244353;
//const long long INF = 9*1e18;
using ll = long long;
using mint = modint998244353;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
long double PI = 3.14159265358979;
using S = long long;
using F = long long;

const S INF = 8e18;
const F ID = 8e18;

S op(S a, S b){ return std::min(a, b); }
S e(){ return INF; }
S mapping(F f, S x){ return (f == ID ? x : f); }
F composition(F f, F g){ return (f == ID ? g : f); }
F id(){ return ID; }

int main(){
  ll N,Q;
  cin>>N>>Q;
  vector<ll> v;
  v.assign(N,INF);
  lazy_segtree<S,op,e,F,mapping,composition,id> seg(v);
  vector<tuple<ll,ll,ll>> A(Q);
  rep(i,Q){
    ll a,b,c;
    cin>>a>>b>>c;
    a--;
    A[i] = {c,a,b};
  }
  sort(all(A));
  rep(i,Q){
    seg.apply(get<1>(A[i]),get<2>(A[i]),get<0>(A[i]));
  }
  bool d = 0;
  rep(i,Q){
    if(seg.prod(get<1>(A[i]),get<2>(A[i])) != get<0>(A[i])){
      d = 1;
    }
  }
  if(d){
    cout << -1 << endl;
  }
  else{
    rep(i,N){
      cout << seg.get(i) << " ";
    }
    cout << endl;
  }
  return 0;
}
0