답안 #1110627

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1110627 2024-11-10T06:25:12 Z vjudge1 Tuna (COCI17_tuna) C++17
0 / 50
1 ms 336 KB
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repi(i,a,b) for(int i=a-1;i>=b;i--)
#define fi first
#define se second
#define MOD 100000007
#define ll long long
#define endl '\n'
#define fast ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
//#define int long long

using namespace std;

int n,x;

int32_t main(){
    cin>>n;
    cin>>x;
    int a,b,c,ans=0;
    rep(i,0,n){
        cin>>a>>b;
        if(abs(a-b)<=2){
            ans+=max(a,b);
        }
        else{
            cin>>c;
            ans+=c;
        }
    }
    cout<<ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -