Submission #581687

#TimeUsernameProblemLanguageResultExecution timeMemory
581687XJP12Cloud Computing (CEOI18_clo)C++14
Compilation error
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;

Compilation message (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(){
      |           ^