66292023-12-13 23:01:53mmatedIrány a döntőcpp17Accepted 100/1003ms3612 KiB
#include <bits/stdc++.h>
using namespace std;
#define f(i,k,n) for(int i=k; i<n; i++)
#define ll long long
const int inf = INT_MAX;

void solve()
{
    int n,p;
    cin>>n>>p;
    int a,b,c;
    int maxi=0;
    cin>>a>>b>>c;
    int d=a+b+c;
    f(i,1,n)
    {
        cin>>a>>b>>c;
        maxi=max(maxi,a+b+c);
    }
    if(d>maxi+p*100 +1) cout<<0<<"\n";
    else    cout<<maxi+p*100 -d+1<<"\n";
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t=1;
    //cin>>t;
    while(t--)  solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1892 KiB
2Accepted3ms2268 KiB
subtask250/50
3Accepted3ms2304 KiB
4Accepted3ms2512 KiB
5Accepted3ms2744 KiB
6Accepted3ms2984 KiB
subtask350/50
7Accepted3ms3044 KiB
8Accepted3ms3172 KiB
9Accepted3ms3380 KiB
10Accepted3ms3612 KiB
11Accepted3ms3604 KiB
12Accepted3ms3608 KiB