답안 #883282

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
883282 2023-12-05T04:06:12 Z marcid Money (IZhO17_money) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6+9;
#define int long long
set<int> k; int ans;
signed main() {
  int n; cin >> n;
  int a[n]; for (int &i:a) cin >> i;
  for (int i = 0; i < n;) {
    ans++;
    int it = *k.upper_bound(a[i]);
    k.insert(a[i]); int j = i + 1;
    for (; a[j-1]<=a[j] && a[j] < pos && j < n; j++) {
      k.insert(a[j]);
    } i = j;
  } cout << ans;
}

Compilation message

money.cpp: In function 'int main()':
money.cpp:13:35: error: 'pos' was not declared in this scope; did you mean 'pow'?
   13 |     for (; a[j-1]<=a[j] && a[j] < pos && j < n; j++) {
      |                                   ^~~
      |                                   pow
money.cpp:11:9: warning: unused variable 'it' [-Wunused-variable]
   11 |     int it = *k.upper_bound(a[i]);
      |         ^~