# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1123563 | LucaIlie | Fire (JOI20_ho_t5) | C++20 | 561 ms | 40848 KiB |
#include <bits/stdc++.h>
using namespace std;
struct query {
int t, l, r;
long long ans;
};
const int MAX_N = 2e5;
const int MAX_Q = 2e5;
int a[MAX_N + 1], leftt[MAX_N + 1], rightt[MAX_N + 1], timeIncrease[MAX_N + 1];
vector<int> queriesByTime[MAX_N + 1];
vector<int> increasingSegmentsByTime[MAX_N + 1], constantSegmentsByTime[MAX_N + 1];
query queries[MAX_Q];
void computeSegmentEvents( int n, long long sign ) {
set<int> increasingSegments, constantSegments;
for ( int t = 0; t <= n; t++ ) {
for ( int i: increasingSegmentsByTime[t] ) {
if ( increasingSegments.find( i ) == increasingSegments.end() )
increasingSegments.insert( i );
else
increasingSegments.erase( i );
}
for ( int i: constantSegmentsByTime[t] ) {
if ( constantSegments.find( i ) == constantSegments.end() )
constantSegments.insert( i );
else
constantSegments.erase( i );
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |