提出 #72533848


ソースコード 拡げる

#if !__INCLUDE_LEVEL__
#include __FILE__

int main(){
  int n,m,q;
  cin >> n >> m;
  string s,t;
  cin >> s >> t;
  cin >> q;
  rep(i,0,q){
    string w;
    cin >> w;
    int l = w.length();
    int jud=0;
    bool tak=1;
    rep(i,0,l){
      bool tem=0;
      rep(j,0,n){
        if(w[i]==s[j]){
          tem=1;
        }
      }
      if(tem==0){
        tak=0;
      }
    }
    bool aok=1;
    rep(i,0,l){
      bool tem=0;
      rep(j,0,m){
        if(w[i]==t[j]){
          tem=1;
        }
      }
      if(tem==0){
        aok=0;
      }
    }
    if(tak==1&&aok==0){
      cout << "Takahashi" << el;
    }else if(tak==0&&aok==1){
      cout << "Aoki" << el;
    }else{
      cout << "Unknown" << el;
    }
  }
}


#else
#include <bits/stdc++.h>
using namespace std;
struct Init { Init() { ios::sync_with_stdio(0); cin.tie(0); cout << setprecision(13); } }init;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

#define rep(i, x, limit) for (ll i = (ll)x; i < (ll)limit; i++)
#define REP(i, x, limit) for (ll i = (ll)x; i <= (ll)limit; i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define el '\n'
#define spa " "
#define Yes cout << "Yes" << el
#define No cout << "No" << el
#define YES cout << "YES" << el
#define NO cout << "NO" << el
#define eps (1e-10)
#define Equals(a,b) (fabs((a) - (b)) < eps )
#define debug(x) cerr << #x << " = " << x << el

const double pi = 3.141592653589793238;
const int inf = 1073741823;
const ll infl = 1LL << 60;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const string abc = "abcdefghijklmnopqrstuvwxyz";

template<typename T1, typename T2>
std::ostream &operator<< (std::ostream &os, std::pair<T1,T2> p){
    os << "{" << p.first << "," << p.second << "}";
    return os;
}

// 配列の要素を空白区切りで出力 第二引数をtrueにすると改行区切り
template<typename T> inline void print_vec(const vector<T> &v, bool split_line=false) {
    if(v.empty()){
        cout << "This vector is empty." << el;
        return;
    }
    constexpr bool isValue = is_integral<T>::value;
    for (int i = 0; i < (int)v.size(); i++) {
        if constexpr(isValue){
            if((v[i]==inf) || (v[i]==infl)) cout << 'x' << " \n"[split_line];
            else cout << v[i] << " \n"[split_line || i+1==(int)v.size()];
        }else cout << v[i] << " \n"[split_line || i+1==(int)v.size()];
    }
}

template<typename T1, typename T2> inline void print_vec(const vector<pair<T1,T2>> &v, bool split_line=false){
    if(v.empty()){
        cout << "This vector is empty." << el;
        return;
    }
    for(int i = 0; i < (int)v.size(); i++){
        cout << '{';
        auto [a,b] = v[i];
        constexpr pair<bool,bool> isValue = {is_integral<T1>::value, is_integral<T2>::value};
        if constexpr(isValue.first){
            if(a==inf || a==infl) cout << "x,";
            else cout << a << ",";
        }else cout << a << ",";
        if constexpr(isValue.second){
            if(b==inf || b==infl) cout << "x,";
            else cout << b;
        }else cout << b;
        cout << "}" << " \n"[split_line || i+1==(int)v.size()];
    }
}

template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
    bool compare = a < b;
    if(compare) a = b;
    return compare;
}
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
    bool compare = a > b;
    if(compare) a = b;
    return compare;
}

// std::chronoを利用した時間計測用クラス
class Timer{
    chrono::system_clock::time_point start;
    public:
        Timer() : start(chrono::system_clock::now()) {}
    
        double count(){
            chrono::duration<double> Time_ = chrono::system_clock::now() - start;
            return Time_.count();
        }

        bool is_under(double x){
            return (this -> count()) < x;
        }
};
#endif

提出情報

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

コンパイルエラー

./Main.cpp: In function 'int main()':
./Main.cpp:14:9: warning: unused variable 'jud' [-Wunused-variable]
   14 |     int jud=0;
      |         ^~~

ジャッジ結果

セット名 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 1 ms 3568 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 3544 KiB
01_random_04.txt AC 1 ms 3632 KiB
01_random_05.txt AC 1 ms 3544 KiB
01_random_06.txt AC 1 ms 3472 KiB
01_random_07.txt AC 1 ms 3620 KiB
01_random_08.txt AC 1 ms 3632 KiB
01_random_09.txt AC 1 ms 3424 KiB
01_random_10.txt AC 1 ms 3544 KiB
01_random_11.txt AC 1 ms 3544 KiB
01_random_12.txt AC 1 ms 3400 KiB
01_random_13.txt AC 1 ms 3544 KiB
01_random_14.txt AC 1 ms 3544 KiB