提出 #72503161


ソースコード 拡げる

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

using ll = long long;
using ld = long double;

#define pb push_back
#define si(x) int(x.size())
#define all(x) x.begin(), x.end()
#define fi first
#define se second

map <char, int> ima[2];

int main(){
    ios_base::sync_with_stdio(false), cin.tie(0);
    cout.precision(10);
    cout << fixed;

    int n, m;
    cin >> n >> m;
    string s, t;
    cin >> s >> t;
    for(auto c : s) ima[0][c] = 1;
    for(auto c : t) ima[1][c] = 1;
    int qrs;
    cin >> qrs;
    while(qrs--){
        bool p1 = 1, p2 = 1;
        string str;
        cin >> str;
        for(auto c : str){
            if(!ima[0][c]) p1 = 0;
            if(!ima[1][c]) p2 = 0;
        }
        if(p1 && !p2) cout << "Takahashi\n";
        else if(!p1 && p2) cout << "Aoki\n";
        else cout << "Unknown\n";
    }
    return 0;
}

提出情報

提出日時
問題 B - Two Languages
ユーザ JovanB
言語 C++23 (GCC 15.2.0)
得点 200
コード長 891 Byte
結果 AC
実行時間 2 ms
メモリ 3612 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 15
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 2 ms 3448 KiB
00_sample_01.txt AC 1 ms 3536 KiB
00_sample_02.txt AC 1 ms 3540 KiB
01_random_03.txt AC 1 ms 3592 KiB
01_random_04.txt AC 1 ms 3508 KiB
01_random_05.txt AC 1 ms 3448 KiB
01_random_06.txt AC 1 ms 3464 KiB
01_random_07.txt AC 1 ms 3524 KiB
01_random_08.txt AC 1 ms 3464 KiB
01_random_09.txt AC 1 ms 3540 KiB
01_random_10.txt AC 1 ms 3480 KiB
01_random_11.txt AC 1 ms 3480 KiB
01_random_12.txt AC 1 ms 3536 KiB
01_random_13.txt AC 1 ms 3612 KiB
01_random_14.txt AC 1 ms 3448 KiB