# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1111467 | 2024-11-12T08:43:27 Z | Informatics271 | Drivers (BOI24_drivers) | C++17 | 4 ms | 11088 KB |
#include <iostream> #include <queue> #include <vector> #include <functional> #include <algorithm> using namespace std; int N; int M; int U; int X[200005]; int Y[200005]; int T[200005]; long long D[200005]; int A[200005]; int B[200005]; int P[200005]; vector<pair<long long, int>> E[200005]; priority_queue<pair<long long, int>, vector<pair<long long, int>>, greater<pair<long long, int>>> pq; int main(){ cin >> N >> M >> U; for (int i=0;i<M;i++) cin>>X[i]>>Y[i]>>T[i]; for (int i=0;i<U;i++) cin>>A[i]>>B[i]>>P[i]; for (int i=0;i<M;i++){ E[X[i]].push_back({T[i], Y[i]}); E[Y[i]].push_back({T[i], X[i]}); } fill_n(D, N+5, 1<<30); for (int i=0;i<U;i++){ pq.push({0, A[i]}); while (pq.size()){ long long t=pq.top().first; int a=pq.top().second; pq.pop(); //cout << t << a << '\n'; if (D[a]<=t) continue; D[a]=t; for (int i=0; i<E[a].size(); i++) pq.push({max(t,E[a][i].first),E[a][i].second}); } if (D[B[i]]<(1<<30)&&D[B[i]]<P[i]) cout << "TAIP\n"; else cout << "NE\n"; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 10832 KB | Output is correct |
2 | Incorrect | 4 ms | 11088 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 10832 KB | Output is correct |
2 | Correct | 2 ms | 10832 KB | Output is correct |
3 | Incorrect | 4 ms | 10832 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 10832 KB | Output is correct |
2 | Incorrect | 4 ms | 11088 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 10832 KB | Output is correct |
2 | Incorrect | 4 ms | 11088 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 10832 KB | Output is correct |
2 | Incorrect | 4 ms | 11088 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |