Advertisement
welleyth

UTPC 03.09.21. Problem K Template (Flow on matrix)

Sep 9th, 2021
1,065
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.02 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define int long long
  6.  
  7. const int N = (int)500 + 11;
  8.  
  9. bool gr[N][N];
  10. struct edge{
  11.     int a,b,cap,flow;
  12.     cap = 1;
  13.     flow = 1;
  14.     edge(){};
  15.     edge(int a,int b):a(a),b(b){}
  16. };
  17.  
  18. vector<edge> e;
  19. vector<int> g[N];
  20.  
  21. void add_edge(int a,int b){
  22.     edge t;
  23.     t.a = a, t.b = b;
  24.     t.cap = 1, t.flow = 0;
  25.     g[a].push_back(e.size());
  26.     e.push_back(t);
  27.     swap(t.a,t.b);
  28.  
  29.     t.cap = 0, t.flow = 0;
  30.     g[b].push_back(e.size());
  31.     e.push_back(t);
  32.  
  33.     return;
  34. }
  35.  
  36. bool bfs(){
  37.     queue<int> q; /// id = x * m + y
  38.     q.push(start);
  39.     while(!q.empty()){
  40.  
  41.     }
  42. }
  43.  
  44. signed main(){
  45.     #ifndef _WIN32
  46.     freopen("three.in","r",stdin);
  47.     freopen("three.out","w",stdout);
  48.     #endif // _WIN32
  49.  
  50.     int n,m;
  51.     cin >> n >> m;
  52.  
  53.     char ch;
  54.     for(int i = 1; i <= n; i++){
  55.         for(int j = 1; j <= m; j++){
  56.             cin >> ch;
  57.             if(ch == '#')
  58.                 gr[i][j] = 1;
  59.         }
  60.     }
  61.  
  62.  
  63.  
  64.     return 0;
  65. }
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement