# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
293397 | 7_7_7 | Tuna (COCI17_tuna) | C++17 | 1 ms | 384 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;
int main()
{
ios_base::sync_with_stdio(false);
int n, x;
cin >> n >> x;
long long res = 0;
for(int i = 1; i <= n; i ++){
int p1, p2, p3;
cin >> p1 >> p2;
if(abs(p1 - p2) > x){
cin >> p2;
p1 = 0;
}
res += max(p1, p2);
}
cout << res << "\n";
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |