Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: rice_ot
Problemset: อะนาแกรม 2
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-14 11:49:23
#include <bits/stdc++.h>
using namespace std;
int main(){
string x;
vector<vector<int>> cnt(2, vector<int> (8, 0));
for(int i =0 ; i<2; i++){
cin>>x;
for(auto& s : x) cnt[i][s-'A']++;
}
for(int i =0 ; i<2; i++){
for(auto& s : cnt[i]) cout<<s<<" ";
cout<<"\n";
}
int check = 0;
for(int i =0 ; i<8; i++){
cout<<abs(cnt[0][i]-cnt[1][i])<<" ";
if(abs(cnt[0][i]-cnt[1][i]) > 0) check++;
}
cout<<"\n";
if(check > 3) cout<<"no";
else cout<<"anagram";
}