結果

問題 No.1438 Broken Drawers
ユーザー どららどらら
提出日時 2021-03-27 03:54:15
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 748 bytes
コンパイル時間 3,589 ms
コンパイル使用メモリ 238,556 KB
実行使用メモリ 14,048 KB
最終ジャッジ日時 2023-08-19 14:41:35
合計ジャッジ時間 8,159 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 119 ms
14,048 KB
testcase_07 AC 96 ms
9,400 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 6 ms
4,380 KB
testcase_12 AC 45 ms
5,940 KB
testcase_13 AC 74 ms
7,552 KB
testcase_14 AC 30 ms
5,004 KB
testcase_15 AC 124 ms
10,036 KB
testcase_16 AC 118 ms
9,848 KB
testcase_17 AC 124 ms
10,220 KB
testcase_18 AC 126 ms
10,168 KB
testcase_19 AC 130 ms
10,300 KB
testcase_20 AC 129 ms
10,440 KB
testcase_21 AC 126 ms
10,232 KB
testcase_22 AC 129 ms
10,440 KB
testcase_23 AC 139 ms
10,748 KB
testcase_24 AC 133 ms
10,824 KB
testcase_25 AC 130 ms
10,704 KB
testcase_26 AC 133 ms
10,780 KB
testcase_27 AC 131 ms
10,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;
//using mint = modint1000000007;
//using mint = modint998244353;



int main(){
  int N;
  cin >> N;
  vector<pair<int,int>> v;
  rep(i,N){
    int a;
    cin >> a;
    v.emplace_back(a,i+1);
  }
  sort(ALLOF(v));

  int ret = 0;
  map<int,int> m;
  for(int i=N-1; i>=0; i--){
    if(m.count(v[i].second-1) > 0) continue;
    m[v[i].second]++;
    ret++;
  }

  cout << ret << endl;
  
  return 0;
}
0