Submission #623352

# Submission time Handle Problem Language Result Execution time Memory
623352 2022-08-05T13:37:36 Z inksamurai Kralj (COCI16_kralj) C++17
56 / 140
487 ms 39336 KB
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define sz(a) (int)a.size()
#define vec(...) vector<__VA_ARGS__>
#define _3SgiE60 ios::sync_with_stdio(0),cin.tie(0)
typedef long long ll;
using pii=pair<int,int>;
using vi=vector<int>;
void print(){cout<<'\n';}
template<class h,class...t>
void print(const h&v,const t&...u){cout<<v<<' ',print(u...);}
// e

signed main(){
_3SgiE60;
	int n;
	cin>>n;
	vi a(n);
	rep(i,n){
		cin>>a[i];
	}
	rep(i,n){
		if(a[i]!=1){
			assert(0);
		}
	}
	vi b(n);
	rep(i,n){
		cin>>b[i];
	}
	vi c(n);
	rep(i,n){
		cin>>c[i];
	}
	sort(b.begin(), b.end());
	multiset<int> mst;
	rep(i,n){
		mst.insert(c[i]);
	}
	int res=0;
	rep(i,n){
		auto it=mst.lower_bound(b[i]);
		if(it!=mst.end()){
			mst.erase(it);
			res+=1;
		}
	}
	print(res);
}
# Verdict Execution time Memory Grader output
1 Correct 343 ms 32460 KB Output is correct
2 Correct 375 ms 31160 KB Output is correct
3 Correct 487 ms 38688 KB Output is correct
4 Correct 452 ms 39336 KB Output is correct
5 Runtime error 38 ms 7244 KB Execution killed with signal 6
6 Runtime error 45 ms 7188 KB Execution killed with signal 6
7 Runtime error 41 ms 7524 KB Execution killed with signal 6
8 Runtime error 35 ms 6712 KB Execution killed with signal 6
9 Runtime error 40 ms 8012 KB Execution killed with signal 6
10 Runtime error 41 ms 8028 KB Execution killed with signal 6