# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
875451 | lalig777 | Traffic (CEOI11_tra) | C++14 | 5099 ms | 37324 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 <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
void dfs(int nodo, int &count, vector<bool> &visitado, vector<bool> &east, vector<vector<int> > &listaAdy){
visitado[nodo]=true;
if (east[nodo]==true) count++;
for (int j=0; j<listaAdy[nodo].size(); j++){
int conexion=listaAdy[nodo][j];
if (visitado[conexion]!=true) dfs(conexion, count, visitado, east, listaAdy);
}return;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n, m, A, B;
cin>>n>>m>>A>>B;
vector<pair<int, int> >west;
vector<bool>east(n, false);
int x, y;
for (int i=0; i<n; i++){
cin>>x>>y;
if (x==0) west.push_back(make_pair(y, i));
else if (x==A) east[i]=true;
}sort(west.begin(), west.end());
reverse(west.begin(), west.end());
vector<vector<int> >listaAdy(n);
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... |
# | 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... |
# | 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... |