# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
727414 | model_code | Passport (JOI23_passport) | C++17 | 531 ms | 49224 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.
/*
FULL-SCORE SOLUTION OF "PASSPORT"
- The way of implementation is a bit different from official review
- It does not create graph explicitly
- It uses Dijkstra's algorithm instead of BFS, but the time complexity does not change in this implementation
- Time Complexity: O(N log N)
*/
#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
class state {
public:
int pos, cost;
state() : pos(-1), cost(0) {}
state(int pos_, int cost_) : pos(pos_), cost(cost_) {}
bool operator<(const state& s) const {
return cost > s.cost;
}
};
vector<int> solve(int N, int Q, const vector<int>& L, const vector<int>& R, const vector<int>& X) {
const int INF = 1012345678;
// step #1. do segment-tree-like precalculation
int sz = 1;
while (sz < N) {
# | 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... |