Submission #934649

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9346492024-02-27 18:34:44LaviniaTornaghiFireworks (APIO16_fireworks)C++14
100 / 100
326 ms60496 KiB
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
typedef long long i64;
typedef __gnu_pbds::priority_queue<i64, less<i64>, binomial_heap_tag> pairing_heap;
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int N, M; cin >> N >> M;
vector<vector<int>> adj(N);
vector<int> t(N + M);
for (int i = 1; i < N + M; i++) {
int p; cin >> p >> t[i];
adj[p - 1].push_back(i);
}
auto dfs = [&](auto &&dfs, int node) {
pairing_heap q;
if (node >= N) {
q.push(t[node]);
q.push(t[node]);
return q;
}
for (auto child: adj[node]) {
pairing_heap cq = dfs(dfs, child);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

fireworks.cpp: In instantiation of 'main()::<lambda(auto:1&&, int)> [with auto:1 = main()::<lambda(auto:1&&, int)>&]':
fireworks.cpp:44:30:   required from here
fireworks.cpp:33:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |     for (int i = 0; i < adj[node].size() - 1; i++) q.pop();
      |                     ~~^~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...