結果
| 問題 | No.1675 Strange Minimum Query |
| コンテスト | |
| ユーザー |
kazuppa
|
| 提出日時 | 2026-04-25 12:05:55 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 710 bytes |
| 記録 | |
| コンパイル時間 | 7,206 ms |
| コンパイル使用メモリ | 380,712 KB |
| 実行使用メモリ | 19,008 KB |
| 最終ジャッジ日時 | 2026-04-25 12:06:19 |
| 合計ジャッジ時間 | 10,712 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 5 WA * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i,a,b) for(int i=a;i<b;i++)
int op(int a,int b){return min(a,b);}
int e(){return 1e9;}
int main(){
int n,q;cin>>n>>q;
vector<vector<pair<int,int>>> g(n);
rep(i,0,q){
int l,r,b;cin>>l>>r>>b;
g[l-1].emplace_back(b,r);
}
priority_queue<pair<int,int>> que;
vector<int> a(n);
que.push({1,n});
rep(i,0,n){
for(auto j:g[i])que.push(j);
while(que.top().second<=i)que.pop();
a[i]=que.top().first;
}
segtree<int,op,e> seg(a);
rep(i,0,n)for(auto [v,j]:g[i])
if(seg.prod(i,j)!=v){
cout<<-1<<endl;
return 0;
}
for(int i:a)cout<<i<<' ';
cout<<endl;
}
kazuppa