Posts

Showing posts from November, 2016

UVA 10319 - Manhattan ( 2SAT, SCC )

UVA 10319 - Manhattan ( 2SAT, SCC ) /// Is there is a way to assign direction of all rows /// and Column such that there will be a way to reach /// from every (a,b) to (c,d)? /// Idea: for each location to reach from (a,b) to (c,d) /// either we have to go from dir of (a&d) or (b&c), which /// is further reducible to (a|b) & (a&c) & (d|b) & (d&c) ///==================================================/// /// HELLO WORLD !! /// /// IT'S ME /// /// BISHAL GAUTAM /// /// [ bsal.gautam16@gmail.com ] /// ///==================================================/// #include <bits / stdc + + .h> #define X first #define Y second #define mpp make_pair #define nl printf( " \n " ) #define SZ( x ) ( int )( x . size ()) #define pb( x ) push_back( x ) #define pii pair< int , int > #define pll pair<ll,ll> ///-