Submission #737140

# Submission time Handle Problem Language Result Execution time Memory
737140 2023-05-06T17:15:31 Z Ronin13 Arcade (NOI20_arcade) C++14
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>
#define ll long long
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define epb emplace_back
#define ull unsigned ll
using namespace std;



int32_t main(){
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n; cin >> n;
    int m; cin >> m;
    int t[m + 1], x[m + 1];
    for(int i= 1; i <= m; i++){
        cin >> t[i];
    }
    for(int i = 1; i <= m; i++){
        cin >> x[i];
    }
    pair<pll, ll> c[m + 1];
    for(int i= 1; i <= m; ++i){
        c[i].f.f = x[i] - t[i];
        c[i].f.s = -x[i] - t[i];
        c[i].s = i;
    }
    sort(c + 1, c + 1 + m);
    set <pll> st;
    for(int i = 1; i <= m; i++){
        int ind = c[i].s;
        auto it = st.lower_bound({x[ind] + t[ind], -1});
        if(it != st.end())st.erase(it);
        st.insert({x[ind] + t[ind], ind});
        cout << st.size() << ' ';
    }
    cout << st.size();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -