Submission #74681047
Source Code Expand
#include<bits/stdc++.h>
//#define int long long
//#define MSOD
//#define READ_IN_FILE
#define endl '\n'
#define FAST ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
const int N=2e5+10,P=998244353,MOD=1e9+7,inf=0x3f3f3f3f;
bool cmpbig(int i,int j)
{
return i>j;
}
double mylog(int x,int y)
{
return log(x)/log(y);
}
long long qpow(long long a,long long b,long long mod=LLONG_MAX)
{
long long num=1;
while(b)
{
if(b&1)num=num*a%mod;
a=a*a%mod;
b>>=1;
}
return num;
}
int n,a[N],b[N],m;
string s[N];
bool vis[11][11][26];
void solve()
{
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i]>>b[i];
cin>>m;
for(int i=1;i<=m;i++)cin>>s[i],s[i]=' '+s[i];
for(int i=1;i<=m;i++)
for(int j=1;j<s[i].length();j++)
vis[s[i].length()-1][j-1][s[i][j]-'a']=1;
for(int j=1;j<=m;j++)
{
if(s[j].length()-1!=n)
{
cout<<"No"<<'\n';
continue;
}
bool ok=1;
for(int i=1;i<=n;i++)
if (!vis[a[i]][b[i]-1][s[j][i]-'a'])
{
ok=0;
break;
}
cout<<(ok?"Yes":"No")<<'\n';
}
return;
}
signed main()
{
FAST
#ifdef READ_IN_FILE
freopen(".in","r",stdin);
freopen(".out","w",stdout);
#endif
int _T_=1;
#ifdef MSOD
cin>>_T_;
#endif
while(_T_--)solve();
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Fishbones |
| User | Little_Cck |
| Language | C++23 (GCC 15.2.0) |
| Score | 300 |
| Code Size | 1387 Byte |
| Status | AC |
| Exec Time | 17 ms |
| Memory | 9920 KiB |
Compile Error
./Main.cpp: In function 'void solve()':
./Main.cpp:38:30: 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 j=1;j<s[i].length();j++)
| ~^~~~~~~~~~~~~~
./Main.cpp:42:27: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
42 | if(s[j].length()-1!=n)
| ~~~~~~~~~~~~~~~^~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-01.txt, 00-sample-02.txt |
| All | 00-sample-01.txt, 00-sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-20.txt, 01-21.txt, 01-22.txt, 01-23.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-01.txt | AC | 4 ms | 9828 KiB |
| 00-sample-02.txt | AC | 3 ms | 9912 KiB |
| 01-01.txt | AC | 5 ms | 9716 KiB |
| 01-02.txt | AC | 11 ms | 9920 KiB |
| 01-03.txt | AC | 16 ms | 9716 KiB |
| 01-04.txt | AC | 11 ms | 9920 KiB |
| 01-05.txt | AC | 13 ms | 9920 KiB |
| 01-06.txt | AC | 12 ms | 9828 KiB |
| 01-07.txt | AC | 15 ms | 9920 KiB |
| 01-08.txt | AC | 15 ms | 9868 KiB |
| 01-09.txt | AC | 5 ms | 9760 KiB |
| 01-10.txt | AC | 11 ms | 9760 KiB |
| 01-11.txt | AC | 5 ms | 9912 KiB |
| 01-12.txt | AC | 15 ms | 9748 KiB |
| 01-13.txt | AC | 12 ms | 9904 KiB |
| 01-14.txt | AC | 10 ms | 9716 KiB |
| 01-15.txt | AC | 16 ms | 9912 KiB |
| 01-16.txt | AC | 17 ms | 9872 KiB |
| 01-17.txt | AC | 15 ms | 9852 KiB |
| 01-18.txt | AC | 16 ms | 9920 KiB |
| 01-19.txt | AC | 15 ms | 9920 KiB |
| 01-20.txt | AC | 16 ms | 9912 KiB |
| 01-21.txt | AC | 15 ms | 9828 KiB |
| 01-22.txt | AC | 15 ms | 9912 KiB |
| 01-23.txt | AC | 16 ms | 9868 KiB |