제출 #581687

#제출 시각아이디문제언어결과실행 시간메모리
581687XJP12Cloud Computing (CEOI18_clo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
vi a;
int lis(int n) {
    int INF = INT_MAX;
    vector<int> d(n+1, INF);
    d[0] = -INF;

    for (int i = 0; i < n; i++) {
        int j = upper_bound(d.begin(), d.end(), a[i]) - d.begin();
        if (d[j-1] < a[i] && a[i] < d[j]) d[j] = a[i];
    }

    int ans = 0;
    for (int i = 0; i <= n; i++) {
        if (d[i] < INT_MAX)
            ans = i;
    }
    return ans;
}
int main(){
    int n;
    cin>>n;
    a.resize(n,0);
    for(int i=0; i<n; i++){
        cin>>a[i];
    }
    cout<<lis(n)<<endl;

 return 0;

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

clo.cpp: In function 'int main()':
clo.cpp:32:10: error: expected '}' at end of input
   32 |  return 0;
      |          ^
clo.cpp:23:11: note: to match this '{'
   23 | int main(){
      |           ^