Submission #62644

# Submission time Handle Problem Language Result Execution time Memory
62644 2018-07-29T15:36:31 Z win11905 Tuna (COCI17_tuna) C++11
50 / 50
4 ms 640 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, m, sum = 0; cin >> n >> m;
    while(n--) {
        int a, b; cin >> a >> b;
        if(a < b) swap(a, b);
        if(a - b <= m) sum += a;
        else sum += *istream_iterator<int>(cin);
    }
    printf("%d\n", sum);
}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 248 KB Output is correct
2 Correct 3 ms 360 KB Output is correct
3 Correct 3 ms 600 KB Output is correct
4 Correct 4 ms 600 KB Output is correct
5 Correct 3 ms 640 KB Output is correct
6 Correct 3 ms 640 KB Output is correct
7 Correct 2 ms 640 KB Output is correct
8 Correct 3 ms 640 KB Output is correct
9 Correct 3 ms 640 KB Output is correct
10 Correct 3 ms 640 KB Output is correct