# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
172188 | HellAngel | Bitaro’s Party (JOI18_bitaro) | C++14 | 24 ms | 17528 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 2e5 + 7;
const int magic = 320;
int n, m, q, dp[maxn], block[maxn];
vector<int> qr;
vector<int> vt[maxn], vt2[maxn];
vector<pair<int, int>> graph[maxn];
void Merge(int x, int y)
{
int cntx = 0;
int cnty = 0;
vector<pair<int, int>> newvt = {};
while(cntx < graph[x].size() || cnty < graph[y].size())
{
if(newvt.size() == magic) break;
if(cntx == graph[x].size()) newvt.push_back({graph[y][cnty].first + 1, graph[y][cnty].second}), cnty++;
else if(cnty == graph[y].size()) newvt.push_back(graph[x][cntx++]);
else
{
if(graph[y][cnty].first + 1 > graph[x][cntx].first)
{
newvt.push_back({graph[y][cnty].first + 1, graph[y][cnty].second});
cnty++;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |