Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: UNJE0o

Problemset: อะนาแกรม 2

Language: cpp

Time: 0.003 second

Submitted On: 2026-10-11 09:08:42

#include<iostream>
#include<ios>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<stdio.h>
#include<string>
#include<iomanip>
#include<set>
#include<vector>
using namespace std;
#define en '\n'

int main(){
    string s1,s2;
    int arr1[8] = {0},arr2[8] = {0},c = 0;;
    cin >> s1;
    for(int i = 0;i < s1.size();i++){
        arr1[(int)(s1[i] - 'A')] += 1;
    }


    cin >> s2;
    for(int i = 0;i < s2.size();i++){
        arr2[(int)(s2[i] - 'A')] += 1;
    }

    //////
    for(int i = 0;i < 8;i++){
        cout << arr1[i] << " ";
    } cout << en;

    for(int i = 0;i < 8;i++){
        cout << arr2[i] << " ";
    } cout << en;


    for(int i = 0;i < 8;i++){
        if(arr1[i] - arr2[i] != 0) c+=1;
        cout << abs(arr1[i] - arr2[i]) << " ";
    } cout << en;

    if(c > 3) cout << "no";
    else cout << "anagram";



}