Created
December 20, 2016 00:38
-
-
Save KhaledElshamy/e6d605fc533a1290d22db118f0d56f1f to your computer and use it in GitHub Desktop.
Noel's Labels problem (CONTEST DE NATAL 2016) at URI Online Judge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() | |
| { | |
| int num1,num2; | |
| string line1,line2; | |
| cin>>num1; | |
| vector<string>lang(num1), k1(num1); | |
| for(int i=0;i<num1;i++) | |
| { | |
| cin>>k1[i]; | |
| getline(cin,line1); | |
| getline(cin,lang[i]); | |
| } | |
| cin>>num2; | |
| vector<string>name(num2),k2(num2); | |
| for(int i=0;i<num2;i++) | |
| { | |
| getline(cin,line2); | |
| getline(cin,name[i]); | |
| cin>> k2[i]; | |
| } | |
| for(int i=0;i<num2;i++) | |
| { | |
| for(int j=0;j<num1;j++) | |
| { | |
| if(k2[i]==k1[j]) | |
| { | |
| cout<<name[i]<<endl; | |
| cout<<lang[j]<<endl; | |
| cout<<endl; | |
| break; | |
| } | |
| } | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment