結果

問題 No.1438 Broken Drawers
ユーザー ocvret_ocvret_
提出日時 2021-03-26 21:30:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 659 bytes
コンパイル時間 1,654 ms
コンパイル使用メモリ 174,968 KB
実行使用メモリ 13,808 KB
最終ジャッジ日時 2023-08-19 07:32:22
合計ジャッジ時間 5,644 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 147 ms
13,808 KB
testcase_07 AC 108 ms
9,452 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 7 ms
4,380 KB
testcase_12 AC 50 ms
5,888 KB
testcase_13 AC 85 ms
7,604 KB
testcase_14 AC 33 ms
4,988 KB
testcase_15 AC 143 ms
9,852 KB
testcase_16 AC 141 ms
9,628 KB
testcase_17 AC 149 ms
10,168 KB
testcase_18 AC 155 ms
10,260 KB
testcase_19 AC 150 ms
10,188 KB
testcase_20 AC 165 ms
10,420 KB
testcase_21 AC 154 ms
10,152 KB
testcase_22 AC 162 ms
10,376 KB
testcase_23 AC 164 ms
10,420 KB
testcase_24 AC 162 ms
10,480 KB
testcase_25 AC 162 ms
10,420 KB
testcase_26 AC 155 ms
10,420 KB
testcase_27 AC 155 ms
10,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
// #include<atcoder/all>
// #include<boost/multiprecision/cpp_int.hpp>

using namespace std;
// using namespace atcoder;
// using bint = boost::multiprecision::cpp_int;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007



int main(){

  int n;
  cin >> n;
  vector<P> a(n);
  rep(i,n)cin >> a[i].first,a[i].second = i;
  sort(ALL(a));
  set<int> st;
  int res = 0;
  rep(i,n){
    if(st.count(a[i].second+1))continue;
    res++;
    st.insert(a[i].second);
  }
  cout << res << "\n";
  

  return 0;
}
0