Submission #942070

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9420702024-03-10 07:53:39PanndaAnts and Sugar (JOI22_sugar)C++17
6 / 100
4070 ms144880 KiB
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
const int CL = 0, CR = 1e9 + 1;
const long long INF = 1e18;
struct Node {
int ln = 0, rn = 0;
long long ant = 0, sugar = 0, sugar2 = 0;
long long lazy_sugar = 0, lazy_sugar2 = 0;
vector<vector<long long>> mn = { { 0, 0 }, { 0, 0 } };
Node operator+(Node b) {
Node a = *this;
Node res;
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
res.mn[i][j] = INF;
res.mn[i][j] = min(res.mn[i][j], a.mn[i][0] + b.mn[0][j]);
res.mn[i][j] = min(res.mn[i][j], a.mn[i][0] + b.mn[1][j]);
res.mn[i][j] = min(res.mn[i][j], a.mn[i][1] + b.mn[0][j]);
res.mn[i][j] = min(res.mn[i][j], a.mn[i][1] + b.mn[1][j] - a.sugar2);
}
}
res.sugar2 = b.sugar2;
return res;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...