Submission #72552411
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m,q;
string s,t,w;
cin>>n>>m>>s>>t>>q;
for(int i=1;i<=q;i++)
{
int sum1=0,sum2=0;
cin>>w;
for(int j=w.size()-1;j>0;j--)
{
for(int k=0;k<j;k++)
{
if(w[k]==0)
{
continue;
}
if(w[k]==w[j])
{
w[k]=33;
}
}
}
for(int j=0;j<n;j++)
{
for(int k=0;k<w.size();k++)
{
if(s[j]==w[k])
{
sum1++;
}
}
}
for(int j=0;j<m;j++)
{
for(int k=0;k<w.size();k++)
{
if(t[j]==w[k])
{
sum2++;
continue;
}
}
}
if(sum1!=sum2)
{
if(sum1>sum2)
{
cout<<"Takahashi"<<endl;
}
else if(sum1<sum2)
{
cout<<"Aoki"<<endl;
}
}
else
{
cout<<"Unknown"<<endl;
}
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Two Languages |
| User | loser_qwq |
| Language | C++23 (GCC 15.2.0) |
| Score | 200 |
| Code Size | 828 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3640 KiB |
Compile Error
./Main.cpp: In function 'int main()':
./Main.cpp:28:38: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
28 | for(int k=0;k<w.size();k++)
| ~^~~~~~~~~
./Main.cpp:38:38: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
38 | for(int k=0;k<w.size();k++)
| ~^~~~~~~~~
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 | 3480 KiB |
| 00_sample_01.txt | AC | 1 ms | 3524 KiB |
| 00_sample_02.txt | AC | 1 ms | 3492 KiB |
| 01_random_03.txt | AC | 1 ms | 3556 KiB |
| 01_random_04.txt | AC | 1 ms | 3556 KiB |
| 01_random_05.txt | AC | 1 ms | 3592 KiB |
| 01_random_06.txt | AC | 1 ms | 3632 KiB |
| 01_random_07.txt | AC | 1 ms | 3524 KiB |
| 01_random_08.txt | AC | 1 ms | 3544 KiB |
| 01_random_09.txt | AC | 1 ms | 3632 KiB |
| 01_random_10.txt | AC | 1 ms | 3592 KiB |
| 01_random_11.txt | AC | 1 ms | 3524 KiB |
| 01_random_12.txt | AC | 1 ms | 3640 KiB |
| 01_random_13.txt | AC | 1 ms | 3468 KiB |
| 01_random_14.txt | AC | 1 ms | 3452 KiB |