Submission #72523688
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#include <climits>
#define no cout << "No" << endl;
#define yes cout << "Yes" <<endl;
using ll = long long ;
using P=pair<int,int>;
//N×M vector<vector<int>> A(N,vector<int>(M)); A[i][j] A.push_back(data);
//sort (b.begin(),b.end()); if(b.size() >=2);
//int keta = to_string(b).length(); pow(10,keta);
//set<int> a; a.insert(da); a.count(da) for(auto v: a)
//using P=pair<int,int>;vector<P> c;c.emplace_back(da,i) //index保持
//auto dfs =[&](auto f, int i, int j) -> void {};
//b ha kihon zentansaku
//shoujin houhou komentodake nokosite mosha
//set<pair<int,int>> st;st.insert({r,c});st.count({x,y})
int main() {
int n,m;
cin >> n >> m;
string s,t;
cin >> s >> t;
set<char> tkst;
rep(i,s.size())tkst.insert(s[i]);
set<char> aost;
rep(i,t.size())aost.insert(t[i]);
int q;cin >> q;
rep(i,q){
string w; cin >> w;
bool taka = true;
rep(j,w.size()){
if(!tkst.count(w[j])){
taka = false;
break;
}
}
bool ao = true;
rep(j,w.size()){
if(!aost.count(w[j])){
ao = false;
break;
}
}
if(ao && !taka)cout << "Aoki" << endl;
else if(taka && !ao) cout << "Takahashi " << endl;
else cout << "Unknown" << endl;
}
}
Submission Info
| Submission Time |
|
| Task |
B - Two Languages |
| User |
BvBDnl26 |
| Language |
C++23 (GCC 15.2.0) |
| Score |
200 |
| Code Size |
1478 Byte |
| Status |
AC |
| Exec Time |
1 ms |
| Memory |
3620 KiB |
Compile Error
./Main.cpp: In function 'int main()':
./Main.cpp:3:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
3 | #define rep(i,n) for(int i=0;i<n;i++)
| ^
./Main.cpp:25:5: note: in expansion of macro 'rep'
25 | rep(i,s.size())tkst.insert(s[i]);
| ^~~
./Main.cpp:3:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
3 | #define rep(i,n) for(int i=0;i<n;i++)
| ^
./Main.cpp:27:5: note: in expansion of macro 'rep'
27 | rep(i,t.size())aost.insert(t[i]);
| ^~~
./Main.cpp:3:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
3 | #define rep(i,n) for(int i=0;i<n;i++)
| ^
./Main.cpp:33:9: note: in expansion of macro 'rep'
33 | rep(j,w.size()){
| ^~~
./Main.cpp:3:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
3 | #define rep(i,n) for(int i=0;i<n;i++)
| ^
./Main.cpp:40:9: note: in expansion of macro 'rep'
40 | rep(j,w.size()){
| ^~~
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
200 / 200 |
| Status |
|
|
| 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 |
1 ms |
3620 KiB |
| 00_sample_01.txt |
AC |
1 ms |
3472 KiB |
| 00_sample_02.txt |
AC |
1 ms |
3520 KiB |
| 01_random_03.txt |
AC |
1 ms |
3616 KiB |
| 01_random_04.txt |
AC |
1 ms |
3404 KiB |
| 01_random_05.txt |
AC |
1 ms |
3584 KiB |
| 01_random_06.txt |
AC |
1 ms |
3412 KiB |
| 01_random_07.txt |
AC |
1 ms |
3588 KiB |
| 01_random_08.txt |
AC |
1 ms |
3616 KiB |
| 01_random_09.txt |
AC |
1 ms |
3404 KiB |
| 01_random_10.txt |
AC |
1 ms |
3500 KiB |
| 01_random_11.txt |
AC |
1 ms |
3500 KiB |
| 01_random_12.txt |
AC |
1 ms |
3412 KiB |
| 01_random_13.txt |
AC |
1 ms |
3616 KiB |
| 01_random_14.txt |
AC |
1 ms |
3404 KiB |