結果
| 問題 | No.365 ジェンガソート |
| コンテスト | |
| ユーザー |
dnish
|
| 提出日時 | 2017-05-03 06:58:32 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 376 bytes |
| 記録 | |
| コンパイル時間 | 1,048 ms |
| コンパイル使用メモリ | 180,032 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2026-04-04 10:29:44 |
| 合計ジャッジ時間 | 6,873 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 8 TLE * 1 -- * 21 |
ソースコード
#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