結果

問題 No.2092 Conjugation
ユーザー twooimp2twooimp2
提出日時 2024-03-06 21:42:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 877 bytes
コンパイル時間 6,765 ms
コンパイル使用メモリ 304,168 KB
実行使用メモリ 8,064 KB
最終ジャッジ日時 2024-03-06 21:42:40
合計ジャッジ時間 9,695 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,168 KB
testcase_01 AC 14 ms
7,168 KB
testcase_02 AC 13 ms
7,168 KB
testcase_03 AC 13 ms
7,168 KB
testcase_04 AC 13 ms
7,168 KB
testcase_05 AC 13 ms
7,168 KB
testcase_06 AC 13 ms
7,168 KB
testcase_07 AC 26 ms
7,168 KB
testcase_08 AC 45 ms
7,680 KB
testcase_09 AC 35 ms
7,424 KB
testcase_10 AC 37 ms
7,424 KB
testcase_11 AC 36 ms
7,424 KB
testcase_12 AC 34 ms
7,424 KB
testcase_13 AC 29 ms
7,296 KB
testcase_14 AC 27 ms
7,296 KB
testcase_15 AC 33 ms
7,424 KB
testcase_16 AC 53 ms
7,936 KB
testcase_17 AC 58 ms
8,064 KB
testcase_18 AC 57 ms
8,064 KB
testcase_19 AC 36 ms
7,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0