QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#396135 | #6691. Orders | DDT | AC ✓ | 1ms | 3712kb | C++23 | 706b | 2024-04-22 13:30:32 | 2024-04-22 13:30:32 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int INF=0x3f3f3f3f;
#define endl '\n'
#define x first
#define y second
typedef long long ll;
typedef pair<ll,ll> PII;
PII a[200];
void solve()
{
ll b[200]={0};
ll n,k;
cin>>n>>k;
for(int i=1;i<=n;i++)
cin>>a[i].x>>a[i].y;
sort(a+1,a+n+1);
for(int i=1;i<=n;i++)
b[i]+=b[i-1]+a[i].y;
// for(int i=1;i<=n;i++)
// cout<<a[i].x<<" "<<b[i]<<endl;
for(int i=1;i<=n;i++)
if(a[i].x*k-b[i]<0)
{
cout<<"No"<<endl;
return;
}
cout<<"Yes"<<endl;
}
int main()
{
ios::sync_with_stdio(false);
ios::sync_with_stdio(0);cin.tie(0),cout.tie(0);
int t;
cin>>t;
while(t--)
{
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3580kb
input:
2 4 5 6 12 1 3 6 15 8 1 3 100 3 200 4 300 6 100
output:
Yes No
result:
ok 2 token(s): yes count is 1, no count is 1
Test #2:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
100 22 5902 2156 41112 4784 2494327 2156 18332 1932 561243 7775 6411977 4325 42582 3982 5455884 7775 3752795 1932 268336 2156 43482 4325 1574341 4325 407463 2156 3547 2156 120919 8417 3789084 4784 214691 1932 4577101 7775 7488110 3982 2029754 1932 5995988 3982 3291414 2156 1094658 69 8933 6042 13932...
output:
No Yes Yes Yes Yes Yes Yes Yes No No Yes No Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes No No No Yes Yes No No Yes No No Yes No Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes No Yes Yes No Yes Yes No No No No No No Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes No No Yes No Yes Yes Yes No Yes ...
result:
ok 100 token(s): yes count is 62, no count is 38