# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
51335 | Nicksechko | Money (IZhO17_money) | C++11 | 1541 ms | 51600 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <bitset>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <queue>
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef long double ld;
using namespace std;
const int MX = 1001000;
int n;
int a[MX];
set<int> ss;
int main() {
// freopen("money.in", "r", stdin);
// freopen("money.out", "w", stdout);
scanf("%d", &n);
for (int i = 0; i < n; ++i)
scanf("%d", a + i);
int cnt = 0;
int now = 0;
while (now < n) {
++cnt;
auto it = ss.upper_bound(a[now]);
int rb = 1e7;
if (it != ss.end())
rb = *it;
int lb = a[now];
while (now < n && a[now] >= lb && a[now] <= rb)
ss.insert(a[now]), lb = a[now], ++now;
}
cout << cnt << "\n";
return 0;
}
컴파일 시 표준 에러 (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... |