Submission #1126175

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11261752024-12-12 08:09:36OI_AccountTwo Dishes (JOI19_dishes)C++20
100 / 100
4907 ms199804 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1'000'100;
const ll INF = 1'000'000'000'000'000'000;
int n, m, s[N + 10], t[N + 10];
ll a[N + 10], c[N + 10], x[N + 10];
ll b[N + 10], d[N + 10], y[N + 10];
ll sumA[N + 10], sumB[N + 10];
ll add[4 * N + 10], lazy[4 * N + 10];
vector<pair<int, pair<int, ll>>> vec[N + 10];
void readInput() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> a[i] >> x[i] >> c[i];
sumA[i] = sumA[i - 1] + a[i];
}
for (int i = 1; i <= m; i++) {
cin >> b[i] >> y[i] >> d[i];
sumB[i] = sumB[i - 1] + b[i];
}
}
void init() {
for (int i = 1; i <= n; i++) {
s[i] = upper_bound(sumB, sumB + m + 1, x[i] - sumA[i]) - sumB - 1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...