提出 #72529873


ソースコード 拡げる

#include<map>
#include<string>
#include<iostream>
using namespace std;
int n,m,q;
string s1,s2,s;
map<char,int> mp;
int main(){
	cin>>n>>m;
	cin>>s1>>s2;
	for(int i=0;i<n;i++){
		mp[s1[i]]=1;
	}
	for(int i=0;i<m;i++){
		if(mp[s2[i]]) mp[s2[i]]=-1;
		else mp[s2[i]]=2;
	}
	cin>>q;
	while(q--){
		int f=1;
		cin>>s;
		for(int i=0;i<s.size();i++){
			if(mp[s[i]]==1){
				cout<<"Takahashi"<<endl;
				f=0;
				break;
			}
			if(mp[s[i]]==2){
				cout<<"Aoki"<<endl;
				f=0;
				break;
			}
		}
		if(f) cout<<"Unknown"<<endl;
	}
	return 0;
}

提出情報

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

コンパイルエラー

./Main.cpp: In function 'int main()':
./Main.cpp:22:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |                 for(int i=0;i<s.size();i++){
      |                             ~^~~~~~~~~

ジャッジ結果

セット名 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 3420 KiB
00_sample_01.txt AC 1 ms 3448 KiB
00_sample_02.txt AC 1 ms 3352 KiB
01_random_03.txt AC 1 ms 3620 KiB
01_random_04.txt AC 1 ms 3468 KiB
01_random_05.txt AC 1 ms 3576 KiB
01_random_06.txt AC 1 ms 3704 KiB
01_random_07.txt AC 1 ms 3660 KiB
01_random_08.txt AC 1 ms 3660 KiB
01_random_09.txt AC 1 ms 3524 KiB
01_random_10.txt AC 1 ms 3468 KiB
01_random_11.txt AC 1 ms 3512 KiB
01_random_12.txt AC 1 ms 3588 KiB
01_random_13.txt AC 1 ms 3580 KiB
01_random_14.txt AC 1 ms 3564 KiB