Posts

UVa 394 - Mapmaker

Problem Link: 394 - Mapmaker                                                  【 Accepted 】 /**   *  @Author: Pranta Sarker   *   **/ #include<bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0) #define bfast cin.tie(0) #define outs(x) cout << x << " " #define outn(x) cout << x << "\n" #define sf scanf #define pf printf #define pfn(x , k) printf(k , x) #define nl puts("") #define psb push_back #define mset(c,v) memset(c , v , sizeof c) #define loop0(n) for(int i=0; i<n; i++) #define loop1(n) for(int i=1; i<=n; i++) #define mpair(x , y) make_pair(x , y) #define all(x) x.begin(), x.end() #define pi acos(-1.0) #define psb push_back #define clr clear() typedef unsign...

URI 1397 Game of The Greatest

/*     @Author: Pranta Sarker */ // Nice Codeing Experience in linux(ubuntu 17.10) platform #include<bits/stdc++.h> using namespace std; int main() {     ios_base::sync_with_stdio(0);     int N;     int cntA = 0, cntB = 0;     while(cin >> N && N)     {         cntA = 0;         cntB = 0;         while(N--)         {             int A , B;             cin >> A >> B;             if(A > B) cntA += 1;             else if(A < B) cntB += 1;         }     ...

URI 1610 Dudu Service Maker

/**   *  @Author: Pranta Sarker   *   **/ // Cycle finding Problem // Used Algorithm: DFS #include<bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0) #define bfast cin.tie(0) #define outs(x) cout << x << " " #define outn(x) cout << x << "\n" #define sf scanf #define pf printf #define pfn(x , k) printf(k , x) #define nl puts("") #define psb push_back #define mset(c,v) memset(c , v , sizeof c) #define loop0(n) for(int i=0; i<n; i++) #define loop1(n) for(int i=1; i<=n; i++) #define mpair(x , y) make_pair(x , y) #define all(x) x.begin(), x.end() #define pi acos(-1.0) #define psb push_back #define clr clear() typedef unsigned long long ull; typedef long long LL; typedef vector<int>vii; typedef vector<LL>vll; typedef vector<string>vs; typedef map<int, int>mpii; typedef map<string, int>mpsi; typedef map<char, int>mpci; typedef map<LL, LL>mpll; const int mod =...

Uva 10986 - Sending email

/**   *  @Author: Pranta Sarker   *   **/ // Dijkstra // Accepted #include<bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0) #define bfast cin.tie(0) #define outs(x) cout << x << " " #define outn(x) cout << x << "\n" #define sf scanf #define pf printf #define pfn(x , k) printf(k , x) #define nl puts("") #define psb push_back #define mset(c,v) memset(c , v , sizeof c) #define loop0(n) for(int i=0; i<n; i++) #define loop1(n) for(int i=1; i<=n; i++) #define mpair(x , y) make_pair(x , y) #define all(x) x.begin(), x.end() #define pi acos(-1.0) #define psb push_back #define clr clear() #define inf 1000000000 typedef unsigned long long ull; typedef long long LL; typedef vector<int>vii; typedef vector<LL>vll; typedef vector<string>vs; typedef map<int, int>mpii; typedef map<string, int>mpsi; typedef map<char, int>mpci; typedef map<LL, LL>mpll; const int mod = ...

LightOJ 1245 - Harmonic Number (II)

Analysis Part: 1245 - Harmonic Number (II) Analysis Part /**   *  @Author: Pranta Sarker   *   **/ #include<bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0) #define bfast cin.tie(0) #define outs(x) cout << x << " " #define outn(x) cout << x << "\n" #define sf scanf #define pf printf #define pfn(x , k) printf(k , x) #define nl puts("") #define psb push_back #define mset(c,v) memset(c , v , sizeof c) #define loop0(n) for(int i=0; i<n; i++) #define loop1(n) for(int i=1; i<=n; i++) #define mpair(x , y) make_pair(x , y) #define all(x) x.begin(), x.end() #define pi acos(-1.0) #define psb push_back #define clr clear() typedef unsigned long long ull; typedef long long LL; typedef vector<int>vii; typedef vector<LL>vll; typedef vector<string>vs; typedef map<int, int>mpii; typedef map<string, int>mpsi; typedef map<char, int>mpci; typedef map<LL, LL>mpll; con...

Uva 721 - Invitation Cards

Problem Statement: 721 - Invitation Cards /**   *  @Author: Pranta Sarker   *   **/ // Algo: Dijkstra #include<bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0) #define bfast cin.tie(0) #define outs(x) cout << x << " " #define outn(x) cout << x << "\n" #define sf scanf #define pf printf #define pfn(x , k) printf(k , x) #define nl puts("") #define psb push_back #define mset(c,v) memset(c , v , sizeof c) #define loop0(n) for(int i=0; i<n; i++) #define loop1(n) for(int i=1; i<=n; i++) #define mpair(x , y) make_pair(x , y) #define all(x) x.begin(), x.end() #define pi acos(-1.0) #define psb push_back #define clr clear() typedef unsigned long long ull; typedef long long LL; typedef vector<int>vii; typedef vector<LL>vll; typedef vector<string>vs; typedef map<int, int>mpii; typedef map<string, int>mpsi; typedef map<char, int>mpci; typedef map<LL, LL>mpll; ...

Uva 13153 & Uvalive 7638 - Number of Connected Components

  Problem Statement Solution Code: Using Disjoint Set [ Faster than DFS ] Link:   Number of Connected Components(Disjoint Set Solution) Solution Code: Using DFS  /**   *  @Author: Pranta Sarker   *   **/ #include<bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0) #define bfast cin.tie(0) #define outs(x) cout << x << " " #define outn(x) cout << x << "\n" #define sf scanf #define pf printf #define pfn(x , k) printf(k , x) #define nl puts("") #define psb push_back #define mset(c,v) memset(c , v , sizeof c) #define loop0(n) for(int i=0; i<n; i++) #define loop1(n) for(int i=1; i<=n; i++) #define mpair(x , y) make_pair(x , y) #define all(x) x.begin(), x.end() #define pi acos(-1.0) #define psb push_back #define clr clear() typedef unsigned long long ull; typedef long long LL; typedef vector<int>vii; typedef vector<LL>vll; typedef vector<s...