제출 #299831

#제출 시각아이디문제언어결과실행 시간메모리
299831MarcoMeijerMountains (IOI17_mountains)C++14
0 / 100
1 ms384 KiB
#include "mountains.h"
#include <bits/stdc++.h>
 
using namespace std;
 
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--)
#define RE(a,b) REP(a,0,b)
#define FOR(a,b) for(auto& a:b)
#define pb push_back
#define fi first
#define se second
#define all(a) a.begin(), a.end()
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
 
const int INF=1e9;
const int MX=1e5;
const ld EPS=1e-17;
 
int maximum_deevs(vi y) {
    int n = y.size();
    vi z;
    z.pb(INF+4);
    RE(i,n) if(y[i] != z.back()) z.pb(y[i]);
    z.pb(INF+4);
    n = z.size();
    int ans = 0;
    REP(i,1,n-1) if(z[i] < z[i-1] && z[i] < z[i+1]) ans++;
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...