제출 #779570

#제출 시각아이디문제언어결과실행 시간메모리
779570Trisanu_DasGlobal Warming (CEOI18_glo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int n, x, a[200005], BIT[2][200005], sort_a[200005]; void upd(int k, int idx, int val){ for(int i = idx; i <= n; i += (i & (-i))) BIT[k][i] = max(BIT[k][i], val); } int qry(int k, int idx){ int ans = 0; for(int i = idx; i; i -= (i & (-i))) ans = max(ans, BIT[k][i]); return ans; } int main(){ cin >> n >> x; for(int i = 0; i < n; i++){ cin >> a[i]; sort_a[i] = a[i]; } sort(sort_a, sort_a + n); for(int i = 0; i < n; i++){ int last = lower_bound(sort_a, sort_a + n, a[i]) - sort_a; int a_ = qry(0, last), b = qry(0, lower_bound(sort_a, sort_a + n, a[i] + x) - sort_a), c = qry(1, last); upd(0, last, a_ + 1); upd(1, last, max(b, c) + 1); } cou

컴파일 시 표준 에러 (stderr) 메시지

glo.cpp: In function 'int main()':
glo.cpp:28:3: error: 'cou' was not declared in this scope; did you mean 'cos'?
   28 |   cou
      |   ^~~
      |   cos
glo.cpp:28:3: error: expected '}' at end of input
glo.cpp:16:11: note: to match this '{'
   16 | int main(){
      |           ^