Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define itloop(it,x) for(auto it=x.begin();it!=x.end();it++)
- #define reloop(i,e,b) for(auto i=e;i>=b;i--)
- #define loop(i,b,e) for(auto i=b;i<=e;i++)
- #define ALL(x) x.begin(),x.end()
- #define SZ(x) x.size()
- #define PB push_back
- #define MP make_pair
- #define F first
- #define S second
- #define sf scanf
- #define pf printf
- typedef long long LL;
- typedef vector<int> VI;
- typedef vector<LL> VLL;
- typedef pair<int,int> PI;
- typedef pair<LL,LL> PL;
- const int N=1e5+1;
- char a[N],b[N];
- int n;
- int main()
- {
- sf("%d",&n);
- loop(i,1,n) {
- map<char,int> m;
- int cnt=0;
- sf("%s%s",&a,&b);
- int lb = strlen(b)-1;
- int la = strlen(a)-1;
- loop(i,0,lb)
- m[b[i]]++;
- loop(i,0,min(lb,la)) {
- if(m[a[i]] != 0) {
- cnt++;
- m[a[i]]--;
- }
- }
- pf("%d\n",cnt);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement