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>, stringcode;
    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(int i=0;i<q;i++){
        int x,y;
        cin>>x>>y;
        name[i]=code[{x,y}];
    }
    for(int i=0;i<q;i++){
        cout<<name[i]<<'\n';
    }
    return 0;
}

Comments

Popular posts from this blog

Solution of 'The Two Dishes' (Codechef)

Solution of 'Tom Riddle's Diary' (Codeforces)

Solution to the problem 'Red Light, Green Light' from Codechef