-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1930.cpp
76 lines (63 loc) · 1.09 KB
/
1930.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include"iomanip"
#include"iostream"
#include"limits"
#include"cmath"
#include"vector"
#include"algorithm"
#include"list"
#include"queue"
#include"stack"
#include"set"
#include"unordered_set"
#include"map"
#include"unordered_map"
#include"string"
#include"cstring"
#include"assert.h"
using namespace std;
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define mp make_pair
#define pb push_back
#define mset(a,b) memset(a,b,sizeof(a))
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int maxn=10000+10;
bool touch[maxn],u[maxn],d[maxn];
ll dist[maxn];
vector<list<int> >up,down;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,m;cin>>n>>m;
up.resize(n+1);down.resize(n+1);
for(int i=0;i<m;++i)
{
int x,y;cin>>x>>y;
up[x].pb(y);
down[y].pb(x);
}
int st,fin;
cin>>st>>fin;
for(int i=0;i<maxn;++i)
{
dist[i]=1e10;
}
dist[st]=0;
u[st]=1;d[st]=1;
queue<int>qq;
qq.push(st);
while(!qq.empty())
{
int vert=qq.front();
qq.pop();
touch[vert]=1;
for(int v:up[vert])
{
}
}
}