| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 173085 | tourist | Money (IZhO17_money) | C++14 | 2 ms | 376 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <set>
#include <vector>
using namespace std;
#define ll long long
#define sz(x) (int)x.size()
#define pii pair < int, int >
#define endl "\n"
#define METH ios::sync_with_stdio(0); cin.tie(0);
#define BEGIN cout << "BEGIN" << endl;
#define END cout << "END" << endl;
const int mod = 1e9 + 7;															/// ANOTHER HASH MOD: 228228227
const int prime = 29;																	/// ANOTHER HASH PRIME: 997
const int INF = ((long long) 0xCAFEBABE - 1e9 - 4e8);
int n;
multiset < int > nw;
vector < int > v;
inline void read() {
	v.push_back(0);
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		int a; scanf("%d", &a);
		v.push_back(a);
	}
}
bool ok(int a, int b, int c) {
	if (a <= b && b <= c) {
		return true;
	}
	return false;
}
inline void solve() {
	int ans = 1;
	nw.insert(-INF);
	nw.insert(INF);
	for (int i = 1; i <= n; i++) {
		if (ok(v[i - 1], v[i], *nw.upper_bound(v[i - 1]))) {
		} else {
			ans++;
		}
		nw.insert(v[i]);
	}
	cout << ans << endl;
}
int main() {
	int t = 1;
	while (t--) {
		read();
		solve();
	}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
