Submission #467239

#TimeUsernameProblemLanguageResultExecution timeMemory
467239levsog2004Divide and conquer (IZhO14_divide)C++14
48 / 100
1089 ms2416 KiB
#include <iostream> #include <iomanip> #include <fstream> #include <algorithm> #include <cstring> #include <string> #include <vector> #include <queue> #include <deque> #include <stack> #include <cmath> #include <list> #include <set> #include <map> using namespace std; typedef long long ll; const ll N = 2000004; ll n, m, l, k, t, x, y,a[N],b[N],c[N]; int main() { cin >> n; for (int i = 0; i < n; ++i) { cin >> a[i] >> b[i] >> c[i]; } x = 0; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { x += b[j]; y += c[j]; if ((a[j] - a[i]) <= y) m = max(m, x); } x = 0; y = 0; } cout << m << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...