Submission #72507029


Source Code Expand

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint998244353;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vmi = vector<mint>;
using vvmi = vector<vmi>;
using vvvmi = vector<vvmi>;
#define all(a) (a).begin(), (a).end()
#define rep2(i, m, n) for (int i = (m); i < (n); ++i)
#define rep(i, n) rep2(i, 0, n)
#define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i)
#define drep(i, n) drep2(i, n, 0)

void solve(){
    
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m; cin >> n >> m;
    string s, t; cin >> s >> t;
    vvi v(2, vi(26));
    rep(i, n){
        rep(j, s.length())v[0][s[j] - 'a'] = 1;
    }
    rep(i, n){
        rep(j, t.length())v[1][t[j] - 'a'] = 1;
    }
    int q; cin >> q;
    while(q--){
        string w; cin >> w;
        vector<bool> vb(2, true);
        rep(i, 2){
            rep(j, w.length()){
                vb[i] = vb[i] && (v[i][w[j] - 'a'] == 1);
            }
        }
        if((vb[0] && vb[1]) || (!vb[0] && !vb[1])){
            cout << "Unknown" << endl;
        }else if(vb[0]){
            cout << "Takahashi" << endl;
        }else{
            cout << "Aoki" << endl;
        }

    }
    return 0;
}

Submission Info

Submission Time
Task B - Two Languages
User applejam
Language C++23 (GCC 15.2.0)
Score 200
Code Size 1433 Byte
Status AC
Exec Time 4 ms
Memory 3668 KiB

Compile Error

./Main.cpp: In function 'int main()':
./Main.cpp:17:43: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 | #define rep2(i, m, n) for (int i = (m); i < (n); ++i)
      |                                           ^
./Main.cpp:18:19: note: in expansion of macro 'rep2'
   18 | #define rep(i, n) rep2(i, 0, n)
      |                   ^~~~
./Main.cpp:33:9: note: in expansion of macro 'rep'
   33 |         rep(j, s.length())v[0][s[j] - 'a'] = 1;
      |         ^~~
./Main.cpp:17:43: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 | #define rep2(i, m, n) for (int i = (m); i < (n); ++i)
      |                                           ^
./Main.cpp:18:19: note: in expansion of macro 'rep2'
   18 | #define rep(i, n) rep2(i, 0, n)
      |                   ^~~~
./Main.cpp:36:9: note: in expansion of macro 'rep'
   36 |         rep(j, t.length())v[1][t[j] - 'a'] = 1;
      |         ^~~
./Main.cpp:17:43: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 | #define rep2(i, m, n) for (int i = (m); i < (n); ++i)
      |                                           ^
./Main.cpp:18:19: note: in expansion of macro 'rep2'
   18 | #define rep(i, n) rep2(i, 0, n)
      |                   ^~~~
./Main.cpp:43:13: note: in expansion of macro 'rep'
   43 |             rep(j, w.length()){
      |             ^~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 15
Set Name Test Cases
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
Case Name Status Exec Time Memory
00_sample_00.txt AC 4 ms 3552 KiB
00_sample_01.txt AC 1 ms 3472 KiB
00_sample_02.txt AC 1 ms 3508 KiB
01_random_03.txt AC 1 ms 3536 KiB
01_random_04.txt AC 1 ms 3544 KiB
01_random_05.txt AC 1 ms 3640 KiB
01_random_06.txt AC 1 ms 3516 KiB
01_random_07.txt AC 1 ms 3472 KiB
01_random_08.txt AC 1 ms 3536 KiB
01_random_09.txt AC 1 ms 3604 KiB
01_random_10.txt AC 1 ms 3472 KiB
01_random_11.txt AC 1 ms 3668 KiB
01_random_12.txt AC 1 ms 3604 KiB
01_random_13.txt AC 1 ms 3604 KiB
01_random_14.txt AC 1 ms 3516 KiB