답안 #738511

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
738511 2023-05-09T01:12:04 Z mzv Tuna (COCI17_tuna) C++17
50 / 50
1 ms 320 KB
#include <bits/stdc++.h>

#define ccd ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define endl '\n'

using namespace std;

/* ------------------------ hi lol ------------------------ */

ll n,v,x,y,ans=0;

int main() {
    ccd
    cin >> n >> v;
    while (n--) {
    	cin >> x >> y;
    	if (abs(x-y)>v) {
    		cin >> x;
    		ans+=x;
    	}
    	else {
    		ans+=max(x,y);
    	}
    }
    cout << ans << endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 308 KB Output is correct
5 Correct 0 ms 316 KB Output is correct
6 Correct 0 ms 320 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 316 KB Output is correct
10 Correct 1 ms 316 KB Output is correct