Regionals Asia-dhaka A Mapping

Source: Internet
Author: User

Test instructions: give you a string and a character conversion rule, ask you what the string looks like after you put it.

The idea of solving problems: vector simulation Mapping

Problem Solving Code:

1 //File name:a.cpp2 //Author:darkdream3 //Created time:2015 April 04 Saturday 13:39 13 seconds4 5#include <vector>6#include <list>7#include <map>8#include <Set>9#include <deque>Ten#include <stack> One#include <bitset> A#include <algorithm> -#include <functional> -#include <numeric> the#include <utility> -#include <sstream> -#include <iostream> -#include <iomanip> +#include <cstdio> -#include <cmath> +#include <cstdlib> A#include <cstring> at#include <ctime> - #defineLL Long Long -  - using namespacestd; - intT; - intfa[ +]; invector<int> mp[ -]; - Charstr[1000005]; to Charstr1[Ten]; + Charstr2[Ten]; - intMain () { thescanf"%d",&t); *      while(t--) $     {Panax Notoginsengscanf"%s", str); -        intLen =strlen (str); the         for(inti =1; I <=299; i + +) + Mp[i].push_back (i); A        intQ; thescanf"%d",&q); +         for(inti =1; I <= Q;i + +) -        { $scanf"%s%s", STR1,STR2); $             intTA = str1[0]; -             intTB = str2[0]; -              for(inti =0; i < mp[tb].size (); i + +)      the Mp[ta].push_back (Mp[tb][i]); - mp[tb].clear ();Wuyi        } the        //printf ("***\n"); -         for(inti =1; I <=299; i + +) Wu        { -            for(intj =0; J < Mp[i].size (); j + +) About           { $FA[MP[I][J]] =i; -           } - mp[i].clear (); -        } A         for(inti =0; i < Len; i + +) +        { theprintf"%c", Fa[str[i]]); -        } $printf"\ n"); the     } the  the return 0; the}
View Code

Regionals Asia-dhaka A mapping

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.