From 95f803a83f666e86fa981b415f7efc9324363be1 Mon Sep 17 00:00:00 2001 From: Tokir Manva <38378125+tokirmanva22@users.noreply.github.com> Date: Thu, 1 Oct 2020 01:21:21 +0530 Subject: [PATCH 1/2] made faster used fast i/o --- basic_algorithms_implementations/lcs.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/basic_algorithms_implementations/lcs.cpp b/basic_algorithms_implementations/lcs.cpp index de0b454..4a7d30a 100644 --- a/basic_algorithms_implementations/lcs.cpp +++ b/basic_algorithms_implementations/lcs.cpp @@ -104,6 +104,10 @@ void printallLCS(int i , int j) int main() { +// make it fast + ios_base::sync_with_stdio(false); + cin.tie(0); + cout.tie(0); memset(dp,-1 , sizeof(dp)); memset(visited, false , sizeof(visited[0][0]) * maxC * maxC); From c9f5e1d942b02f3f1685f767328389c2d9bc68e0 Mon Sep 17 00:00:00 2001 From: Tokir Manva <38378125+tokirmanva22@users.noreply.github.com> Date: Thu, 1 Oct 2020 01:22:44 +0530 Subject: [PATCH 2/2] Fast code made fast --- basic_algorithms_implementations/dijkstra.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/basic_algorithms_implementations/dijkstra.cpp b/basic_algorithms_implementations/dijkstra.cpp index 488b590..47cd589 100644 --- a/basic_algorithms_implementations/dijkstra.cpp +++ b/basic_algorithms_implementations/dijkstra.cpp @@ -74,6 +74,11 @@ void dijkstra(int s) int main() { + // make it fast + ios_base::sync_with_stdio(false); + cin.tie(0); + cout.tie(0); + int T, a, b, h, m, n; cin >> T;