Posts

Showing posts with the label Maps-STL

Solution of 'FIGUREFUL' (SPOJ)

  Hey everyone! Here's my solution of the question- 'FIGUREFUL' from SPOJ. Do comment your suggestions for my blogs and code. TY and Happy coding! question link: https://www.spoj.com/problems/ACMCEG2B/ #include   <bits/stdc++.h> using   namespace   std ; int   main () {      map < pair < int , int >,  string >  code ;      int   n , q ;      cin >> n ;      for ( int   i = 0 ; i < n ; i ++){          int   x , y ;          string   s ;          cin >> x >> y >> s ;          code [ { x , y } ] = s ;     }      cin >> q ;      string   name [ q ];      for ( in...

Solution of 'Maps-STL' (Hackerrank)

So, here's my solution of the question- Maps-STL of Hackerrank. If you guys have any suggestions, do comment. Thank you and Happy coding. link: https://www.hackerrank.com/challenges/cpp-maps/problem #include   <cstdio>   #include   <cmath> #include   <vector> #include   <iostream> #include   <set> #include   <map> #include   <algorithm> using   namespace   std ; int   main () {      int   q ;      cin >> q ;      int   a [ q ];      map < string , int >  mark ;      for ( int   i = 0 ; i < q ; i ++){          cin >> a [ i ];          if ( a [ i ]== 1 ){              string   p ;     ...