# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596991 | f1nder | Tuna (COCI17_tuna) | C++17 | 1 ms | 212 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
void solve();
int main()
{
ios_base::sync_with_stdio(false);cin.tie(NULL);
int t=1;
while(t--)
{
solve();
cout<<"\n";
}
return 0;
}
void solve()
{
int n,k;cin>>n>>k;
int ans=0;
for (int i = 0; i < n; i++) {
/* code */
int h,j;cin>>h>>j;
if(abs(h-j)<=k) ans+=max(h,j);
else{
int l;cin>>l;
ans+=l;
}
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |