Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: punzacp555

Problemset: สตริงซ้ำซ้ำ

Language: cpp

Time: 0.004 second

Submitted On: 2026-09-24 22:32:35

#include <bits/stdc++.h>
using namespace std;

int main() {
    cin.tie(0)->sync_with_stdio(0);
    string a, b;   
    cin >> a >> b;
    
    bool p1[58], p2[58];
    memset(p1, 0, sizeof(p1));
    memset(p2, 0, sizeof(p2));

    for(int i=0; i<a.size(); i++) p1[a[i]-'A']=1;
    for(int i=0; i<b.size(); i++) p2[b[i]-'A']=1;

    for(int i=0; i<58; i++) {
        if(p1[i] && p2[i]) cout << char(i+65) << ' ';
    }

    return 0;
}