Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Jibhong
Problemset: อะนาแกรม 2
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-05 19:02:55
#include <bits/stdc++.h>
using namespace std;
int main(){
string a,b;
int A[8]={},B[8]={};
cin>>a>>b;
for(auto e:a) A[e-'A']++;
for(auto e:b) B[e-'A']++;
for(auto e:A)cout<<e<<' ';
cout<<'\n';
for(auto e:B)cout<<e<<' ';
cout<<'\n';
int cnt=0;
for(int i=0;i<8;++i){
cout<<abs(A[i]-B[i])<<' ';
cnt+=abs(A[i]-B[i]);
}
cout<<'\n';
cout<<((cnt<=3)?"anagram":"no");
}