結果
問題 |
No.365 ジェンガソート
|
ユーザー |
![]() |
提出日時 | 2023-03-03 07:25:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 525 bytes |
コンパイル時間 | 3,317 ms |
コンパイル使用メモリ | 249,492 KB |
最終ジャッジ日時 | 2025-02-11 01:20:19 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 41 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using namespace std; using ll=long long; using ld=double; ld pie=3.14159265359; ll mod=998244353; long long inf=100000000000000001; int main(){ ll n; cin >> n; vector<ll>a(n); for (ll i = 0; i < n; i++) { cin >> a[i]; } ll dai=a[0]; ll ans=0; for (ll i = 1; i < n; i++) { if (dai>a[i]) { ans=max(ans,a[i]); } dai=max(dai,a[i]); } cout << ans << endl; }