結果
問題 | No.2092 Conjugation |
ユーザー | twooimp2 |
提出日時 | 2024-03-06 21:42:30 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 55 ms / 2,000 ms |
コード長 | 877 bytes |
コンパイル時間 | 6,346 ms |
コンパイル使用メモリ | 303,804 KB |
実行使用メモリ | 7,936 KB |
最終ジャッジ日時 | 2024-09-29 18:36:42 |
合計ジャッジ時間 | 8,378 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include<bits/stdc++.h> #include<atcoder/all> using namespace std; using namespace atcoder; using ll=long long; void IO(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); } using S = long long; using F = long long; const S INF = 8e18; S op(S a, S b){ return std::min(a, b); } S e(){ return INF; } S mapping(F f, S x){ return f+x; } F composition(F f, F g){ return f+g; } F id(){ return 0; } int main(){ IO(); ll n; cin>>n; vector<ll> a(n); for(ll i=0;i<n;i++){ cin>>a[i]; } lazy_segtree<S,op,e,F,mapping,composition,id> seg(1e5+1); for(ll i=0;i<=1e5;i++){ seg.set(i,0); } for(ll i=0;i<n;i++){ seg.apply(0,a[i],1); } for(ll i=0;i<=1e5;i++){ ll ans=seg.get(i); if(ans==0){ break; } cout<<ans<<" "; } cout<<endl; }