QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#410557 | #6691. Orders | xuan_y | WA | 0ms | 3612kb | C++14 | 553b | 2024-05-14 09:25:38 | 2024-05-14 09:25:38 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int t , n , k , f;
long long sum;
struct s{
int a;
int b;
}ss[105];
bool cmp(s q , s w){
return q.a<w.a;
return q.a;
}
int main(){
cin >> t;
cin >> n >> k;
while(t--){
f=0;
for(int i = 0 ; i < n ; i++){
cin >> ss[i].a >> ss[i].b;
}
sort(ss,ss+n,cmp);
for(int i = 0 ; i < n ; i++){
sum+=((ss[i].a-ss[i-1].a)*k);
sum -=ss[i].b;
if(sum < 0){
f=1;
break;
}
}
if(f==0)cout << "Yes" << endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3612kb
input:
2 4 5 6 12 1 3 6 15 8 1 3 100 3 200 4 300 6 100
output:
Yes
result:
wrong answer Answer contains longer sequence [length = 2], but output contains 1 elements