結果
| 問題 |
No.1675 Strange Minimum Query
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-17 17:22:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,679 bytes |
| コンパイル時間 | 4,336 ms |
| コンパイル使用メモリ | 260,580 KB |
| 最終ジャッジ日時 | 2025-01-24 14:24:53 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 28 WA * 6 |
ソースコード
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using mint = modint1000000007;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
using vb = vector<bool>; using vvb = vector<vb>;
using vm = vector<mint>; using vvm = vector<vm>;
using vpi = vector<pii>; using vvpi = vector<vpi>;
using vpl = vector<pll>; using vvpl = vector<vpl>;
const int inf = 1e9;
const ll INF = 1LL << 60;
#define rep(i,m,n) for (int i = m; i < (int)(n); i++)
#define rrep(i,m,n) for (int i = m; i > (int)(n); i--)
using S = int;
using F = int;
S op(S a, S b){ return min(a, b); }
S e(){ return inf; }
S mapping(F f, S x){ return (f == inf ? x : f); }
F composition(F f, F g){ return (f == inf ? g : f);}
F id(){ return inf; }
int main(){
int n,q; cin >> n >> q;
lazy_segtree<S, op, e, F, mapping, composition, id> seg(n);
vvi vec;
rep(_,0,q){
int l,r,b; cin >> l >> r >> b; --l;
vec.push_back({b,l,r});
}
sort(vec.begin(),vec.end());
//reverse(vec.begin(),vec.end());
rep(i,0,q){
int b = vec[i][0],l = vec[i][1],r = vec[i][2];
seg.apply(l,r,b);
}
rep(i,0,q){
int b = vec[i][0],l = vec[i][1],r = vec[i][2];
if (seg.prod(l,r) != b){
cout << l << " " << r << " " << b << endl;
cout << -1 << endl;
return 0;
}
}
rep(i,0,n){
cout << seg.get(i);
if (i != n-1){
cout << " ";
}
}
cout << endl;
}