Alfabeto Alienígena

Problem Link

Solution by dudu100 pts

Code / Notes

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

int main() {
    int N, M;
    cin >> N >> M;

    string S, T;
    cin >> S >> T;

    vector<int> alfabeto(256);
    for (int i = 0; i < S.size(); i++) {
        alfabeto[S[i]] = 1;
    }

    int ans = 0;
    for (int i = 0; i < T.size(); i++) {
        ans += alfabeto[T[i]];
    }

    if (ans == T.size()) {
        cout << "S" << endl;
    } else {
        cout << "N" << endl;
    }
}

Last updated 1 month, 2 weeks ago


« Back to problem