UVA 12592 - Slogan Learning of Princess

Problem PDF

Solution:

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define ll long long
#define sc scanf
#define pf printf
#define pi 2*acos(0.0)
using namespace std;
int main()
{
    string s[200],p[100],r;
    int n,k,q;
    while(cin>>n)
    {
        getchar();
        for(int i=0;i>q;
        getchar();
        while(q--)
        {
            getline(cin,r);
            for(int i=0;i
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/12592/12592.cpp