Submission #274626

# Submission time Handle Problem Language Result Execution time Memory
274626 2020-08-19T13:20:59 Z johutha Arcade (NOI20_arcade) C++17
0 / 100
1 ms 256 KB
#include <iostream>
#include <vector>
#include <algorithm>

#define int int64_t

using namespace std;

signed main()
{
    int n, m;
    cin >> n >> m;

    vector<pair<int,int>> ip(m);
    for (int i = 0; i < m; i++) cin >> ip[i].first;
    for (int i = 0; i < m; i++) cin >> ip[i].second;

    for (int i = 0; i < m; i++) ip[i] = make_pair(ip[i].first - ip[i].second, -ip[i].first - ip[i].second);
    sort(ip.begin(), ip.end());

    vector<int> ls(m + 1, (int)1e9);
    ls[0] = 0;
    for (int i = 0; i < m; i++)
    {
        int v = -ip[i].second;
        *lower_bound(ls.begin(), ls.end(), v) = v;
    }
    cout << m - count(ls.begin(), ls.end(), (int)1e9) << "\n";
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -