Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- const int SIZE = 101;
- string s[SIZE],T;
- int main(){
- ios_base::sync_with_stdio(false);
- int n;
- cin>>n;
- for(int i=1;i<=n;i++)cin>>s[i];
- cin>>T;
- vector<pair<int,int> >an;
- for(int i=1;i<=n;i++)
- for(int j=i+1;j<=n;j++){
- if(s[i]+s[j]==T||s[j]+s[i]==T)an.push_back(make_pair(i,j));
- }
- printf("%d\n",(int)an.size());
- for(int i=0;i<an.size();i++)printf("%d %d\n",an[i].first,an[i].second);
- }
Advertisement
Add Comment
Please, Sign In to add comment