# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
597097 |
2022-07-15T13:39:23 Z |
kabika |
Tuna (COCI17_tuna) |
C++14 |
|
1 ms |
320 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, x;
cin >> n >> x;
int tot = 0;
while(n--)
{
int p1, p2;
cin >> p1 >> p2;
if(abs(p2-p1) <= x)
tot += max(p1,p2);
else
{
int p3;
cin >> p3;
tot += p3;
}
}
cout << tot << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
320 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |