Submission #139600

# Submission time Handle Problem Language Result Execution time Memory
139600 2019-08-01T07:07:48 Z mechfrog88 Exhibition (JOI19_ho_t2) C++14
0 / 100
3 ms 504 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
using namespace __gnu_pbds;
using namespace std;
 
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef long long ll;
typedef long double ld;

struct pic{
    ll v,s;
    bool operator <(const pic& rhs) const{
        return v < rhs.v;
    }
};
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,m;
    cin >> n >> m;
    vector <pic> arr(n);
    for (int z=0;z<n;z++){
        cin >> arr[z].s >> arr[z].v;
    }
    vector <ll> frame(m);
    for (int z=0;z<m;z++){
        cin >> frame[z];
    }
    sort(arr.begin(),arr.end());
    sort(frame.begin(),frame.end());
    ll i = 0;
    ll ans = 0;
    for (int z=0;z<m;z++){
        ll i = z;
        ll c = 0;
        for (int x=0;x<n && i < m;x++){
            while (arr[x].s > frame[i]){
                i++;
            }
            c++;
            i++;
        }
        ans = max(ans,c);
    }
    cout << ans << endl;
}

Compilation message

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:38:8: warning: unused variable 'i' [-Wunused-variable]
     ll i = 0;
        ^
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -