QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#693943 | #9529. Farm Management | lzy | WA | 0ms | 3712kb | C++23 | 449b | 2024-10-31 17:00:10 | 2024-10-31 17:00:14 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int N=1e5+10;
struct node{
ll l,r,w;
}a[N];
int main()
{
IOS;
ll n,m;
cin>>n>>m;
ll sum=0,ans=0;
ll min1=1e9;
for(int i=1;i<=n;i++)
{
cin>>a[i].w>>a[i].l>>a[i].r;
sum+=(a[i].r*a[i].w);
ans+=a[i].r;
min1=min(min1,a[i].w);
}
ll t=ans-m;
cout<<sum-(t*min1)<<"\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3712kb
input:
5 17 2 3 4 6 1 5 8 2 4 4 3 3 7 5 5
output:
109
result:
ok single line: '109'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3592kb
input:
12 62 503792 9 10 607358 1 3 600501 10 10 33249 4 4 774438 6 6 197692 3 6 495807 8 8 790225 5 9 77272 3 8 494819 4 9 894779 3 9 306279 5 6
output:
44007019
result:
wrong answer 1st lines differ - expected: '35204500', found: '44007019'