# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1111549 |
2024-11-12T09:28:38 Z |
awwads |
Drivers (BOI24_drivers) |
C++ |
|
1 ms |
336 KB |
#include <bits/stdc++.h>
using namespace std;
int arr[200001];
int bfs(int a, int b, int N, vector<vector<int>>map){
arr[a]=1;
for (int i:map[a]){
if (i==b){
return 1;
}
if (arr[i]!=1){
cout<<i<<b<<"\n";
return bfs(i,b,N,map);
}
}
return 0;
}
int main() {
int N,M,U; cin>>N>>M>>U;
int x[M], y[M], t[M];
for(int i=0; i<M; i++){
cin>>x[i]>>y[i]>>t[i];
}
int a[U], b[U], p[U];
for (int i=0; i<U; i++){
cin>>a[i]>>b[i]>>p[i];
}
for (int i=0; i<U; i++){
vector<vector<int>>map;
vector<int>empty;
for (int j=0; j<=N; j++){
map.push_back(empty);
}
for (int j=0; j<M; j++){
if (t[j]<=p[i]){
map[x[j]].push_back(y[j]);
map[y[j]].push_back(x[j]);
}
}
if(bfs(a[i],b[i],N,map)==1){
cout<<"TAIP\n";
}
else{
cout<<"NE\n";
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |