Submission #1195406

#TimeUsernameProblemLanguageResultExecution timeMemory
1195406GabrielBulldozer (JOI17_bulldozer)C++20
5 / 100
0 ms328 KiB
#include "bits/stdc++.h"
using namespace std;
struct Punto{
    long long x, y, w;
};
bool o(Punto &a, Punto &b){
    return a.x < b.x;
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    long long n;
    cin>>n;
    vector<Punto> a(n);
    long long Suma = 0;
    for(long long i = 0; i < n; i++){
        cin>>a[i].x>>a[i].y>>a[i].w;
    }
    long long Mejor = 0, Actual = 0;
    sort(a.begin(), a.end(), o);
    for(long long i = 0; i < n; i++){
        Actual += a[i].w;
        Mejor = max(Mejor, Actual);
        Actual = max(Actual, 0LL);
    }
    cout<<Mejor;
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...