結果
| 問題 | No.365 ジェンガソート |
| コンテスト | |
| ユーザー |
dnish
|
| 提出日時 | 2017-05-03 06:58:32 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 376 bytes |
| 記録 | |
| コンパイル時間 | 1,586 ms |
| コンパイル使用メモリ | 167,052 KB |
| 実行使用メモリ | 13,880 KB |
| 最終ジャッジ日時 | 2024-09-14 05:11:39 |
| 合計ジャッジ時間 | 5,502 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 WA * 7 TLE * 1 -- * 23 |
ソースコード
#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=(n);i<(int)N;i++)
#define p(s) cout<<(s)<<endl
#define ck(n,a,b) ((a)<=(n)&&(n)<(b))
using namespace std;
int main(){
int N;
cin>>N;
int a[100010];
REP(i,0,N) cin>>a[i];
int ans,mx;
ans=mx=0;
REP(i,0,N){
if(mx>a[i]) continue;
REP(j,i+1,N){
if(ck(a[j],mx,a[i])) ans++;
}
mx=a[i];
}
p(ans);
return 0;
}
dnish