結果
問題 | No.365 ジェンガソート |
ユーザー |
![]() |
提出日時 | 2018-11-03 13:22:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 378 bytes |
コンパイル時間 | 2,231 ms |
コンパイル使用メモリ | 167,688 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-20 18:43:34 |
合計ジャッジ時間 | 6,542 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 38 |
ソースコード
#include "bits/stdc++.h" using namespace std; int main() { int N; cin >> N; vector<int> a(N); int Ma=0, MA=0, cnt=0; for (int i = 0; i < N; i++) { cin >> a[i]; if (Ma > a[i]) { cnt++; MA = max(MA,a[i]); cout << a[i] << endl; } Ma = max(Ma, a[i]); } int ans=0; for (int i = 0; i < N; i++) { if (a[i] <= MA) { ans++; } } cout << ans << endl; }