Submission #1868051


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back

const int maxn = 1e5 + 20;

ll n, p, a[maxn];
ll sum;

int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> n >> p;
	for (int i = 0; i < n; i++)
	{
		int w, b;
		cin >> w >> b;
		a[i] = (100 - p) * w + p * b;
		sum += (100 - p) * w;
	}
	sort (a, a + n);
	for (int i = 0; i < n; i++)
	{
		sum -= a[i];
		if (sum < 0)
			return cout << n-i << endl, 0;
	}
	return 0;
}

Submission Info

Submission Time
Task E - White and Blue
User mahan_sh
Language C++14 (GCC 5.4.1)
Score 100
Code Size 488 Byte
Status AC
Exec Time 23 ms
Memory 1152 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 23
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23
Case Name Status Exec Time Memory
a01 AC 1 ms 256 KB
a02 AC 1 ms 256 KB
a03 AC 1 ms 256 KB
b04 AC 1 ms 256 KB
b05 AC 23 ms 1024 KB
b06 AC 23 ms 1152 KB
b07 AC 22 ms 1024 KB
b08 AC 22 ms 1024 KB
b09 AC 23 ms 1024 KB
b10 AC 22 ms 1024 KB
b11 AC 22 ms 1024 KB
b12 AC 15 ms 1024 KB
b13 AC 18 ms 1024 KB
b14 AC 18 ms 1024 KB
b15 AC 22 ms 1024 KB
b16 AC 19 ms 1024 KB
b17 AC 21 ms 1024 KB
b18 AC 19 ms 1024 KB
b19 AC 21 ms 1024 KB
b20 AC 22 ms 1024 KB
b21 AC 22 ms 1024 KB
b22 AC 22 ms 1024 KB
b23 AC 22 ms 1024 KB