結果
問題 | No.2036 Max Middle |
ユーザー |
![]() |
提出日時 | 2022-08-12 21:44:37 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 89 ms / 2,000 ms |
コード長 | 291 bytes |
コンパイル時間 | 2,734 ms |
コンパイル使用メモリ | 245,640 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-23 01:48:07 |
合計ジャッジ時間 | 4,430 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int N; cin>>N; vector<int> S(N); for(int i=0;i<N;i++) cin>>S[i]; int ans = 0; int now = 0; for(int i=0;i<N-1;i++){ if(S[i] < S[i+1]) now++; else ans += now; } cout<<ans<<endl; }