Submission #886018

# Submission time Handle Problem Language Result Execution time Memory
886018 2023-12-11T11:31:49 Z vjudge1 Curtains (NOI23_curtains) C++17
0 / 100
0 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll n,k;
	cin>>n>>k;
	vector<pair<ll,ll>> arr(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>arr[i].first;
	}
	for (int i = 0; i < n; ++i)
	{
		cin>>arr[i].second;
	}
	sort(arr.begin(), arr.end());
	ll crr = 0;
	int ans = 0;
	for (int i = 0; i < n; ++i)
	{
		if (crr<arr[i].first) break;
		ans++;
		crr+=arr[i].second;
	}
	cout<<ans<<endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -