Submission #719745

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7197452023-04-06 15:18:23keta_tsimakuridzeAlternating Current (BOI18_alternating)C++14
0 / 100
211 ms10884 KiB
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<queue>
#define f first
#define s second
#define ll long long
#define pii pair<int,int>
#define Pii pair<pair<int, int>, int>
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7;
int n, from[N], last2[N], last3[N];
set<Pii> S;
struct seg{
int a, b, id;
} p[N];
int try_(seg s) {
queue<int> q;
q.push(s.id);
from[s.id] = 0;
while(q.size()) {
int u = q.front();
q.pop();
if(p[u].b == n) return u;
if(p[u].b > n && (s.a > p[u].b - n || last3[p[u].b - n] < s.a) && last2[p[u].b - n] == 0) return u;
if (p[u].b >= n) continue;
while (S.upper_bound({{p[u].b + 2, 0}, 0}) != S.begin()) {
Pii x = *--S.upper_bound({{p[u].b + 2, 0}, 0});
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...