Submission #443227

# Submission time Handle Problem Language Result Execution time Memory
443227 2021-07-10T07:59:09 Z LittleCube Global Warming (CEOI18_glo) C++14
0 / 100
1 ms 428 KB
#pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
using namespace std;

ll N, x, val[100], ans;

signed main()
{
    ios::sync_with_stdio(0), cin.tie(0);

    cin >> N >> x;
    for (int i = 1; i <= N; i++)
        cin >> val[i];

    vector<int> v;
    for (int i = 1; i <= N; i++)
    {
        int idx = lower_bound(v.begin(), v.end(), val[i]) - v.begin();
        if (idx == v.size())
            v.emplace_back(val[i]);
        else
            v[idx] = val[i];
    }

    cout << v.size() << '\n';
}

Compilation message

glo.cpp: In function 'int main()':
glo.cpp:24:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |         if (idx == v.size())
      |             ~~~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 428 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -