Submission #75819


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <bits/stdc++.h>
#define endl "\n"
#define rep(i, a, b) for(int i = a; i < b; i++)
#define rrep(i, a, b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(),(x).end()
#define inf 1001001001
using namespace std;
template<class T> bool chmax(T &a, const T &b) { if(a < b) {a = b; return true;} return false; }
template<class T> bool chmin(T &a, const T &b) { if(b < a) {a = b; return true;} return false; }
//================================================================================================
int main(){
int n, max, ans = 1;
cin >> n;
int r[n];
for(int i = 0; i < n; i++) cin >> r[i];
max = r[n - 1];
for(int i = n - 2; i >= 0; i--){
if(chmax(max, r[i])){
ans++;
}
}
cout << ans << endl;
return(0);
}

ステータス

項目 データ
問題 1440 - カラフル円盤通し
ユーザー名 ei2212
投稿日時 2023-09-08 17:29:39
言語 C++17
状態 Accepted
得点 6
ソースコード長 811 Byte
最大実行時間 33 ms
最大メモリ使用量 652 KB

セット

セット 得点 Cases
1 ALL 6 / 6 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in1 AC 24 ms 604 KB
1
in2 AC 21 ms 460 KB
1
in3 AC 20 ms 556 KB
1
in4 AC 17 ms 652 KB
1
in5 AC 33 ms 628 KB
1
in6 AC 19 ms 596 KB
1
in7 AC 16 ms 564 KB
1
in8 AC 17 ms 536 KB
1
in9 AC 19 ms 504 KB
1
in10 AC 19 ms 452 KB
1
in11 AC 28 ms 428 KB
1
in12 AC 23 ms 404 KB
1
in13 AC 22 ms 372 KB
1
in14 AC 24 ms 476 KB
1
in15 AC 18 ms 444 KB
1
in16 AC 23 ms 544 KB
1
in17 AC 23 ms 508 KB
1
in18 AC 16 ms 612 KB
1