Submission
Status:
----------
Subtask/Task Score:
0/100
Score: 0
User: Sense.exe
Problemset: สำรวจอาเรย์ 1
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-07 18:14:27
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s1,s2;
cin >> s1 >> s2;
map<char,int> m1,m2;
for(auto x:s1) {
m1[x]+=1;
}
for(auto x:s2) {
m2[x]+=1;
}
for(int i=0; i<8; i++) {
cout << m1[char('A'+i)] << " ";
}
cout << "\n";
for(int i=0; i<8; i++) {
cout << m2[char('A'+i)] << " ";
}
cout << "\n";
int count = 0;
//res
for(int i=0; i<8; i++) {
cout << abs(m1[char('A'+i)]-m2[char('A'+i)]) << " ";
if(abs(m1[char('A'+i)]-m2[char('A'+i)])!=0) {
count += abs(m1[char('A'+i)]-m2[char('A'+i)]);
}
}
cout << "\n";
if(count<=3) {
cout << "anagram";
}
else {
cout << "no";
}
}