Submission #74659998
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ll N,M;
string ans;
cin >> N;
vector<ll> A(N),B(N);
vector<unordered_set<char>> X(N);
for(ll i = 0;i < N;i++){
cin >> A[i] >> B[i];
B[i]--;
}
cin >> M;
vector<string> S(M);
for(ll i = 0;i < M;i++){
cin >> S[i];
for(ll j = 0;j < N;j++){
if(S[i].size() != A[j]){
continue;
}
X[j].insert(S[i][B[j]]);
}
}
for(ll i = 0;i < M;i++){
if(S[i].size() != N){
cout << "No" << endl;
continue;
}
ans = "Yes";
for(ll j = 0;j < N;j++){
if(!X[j].count(S[i][j])){
ans = "No";
break;
}
}
cout << ans << endl;
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Fishbones |
| User | MI6174 |
| Language | C++23 (GCC 15.2.0) |
| Score | 300 |
| Code Size | 750 Byte |
| Status | AC |
| Exec Time | 125 ms |
| Memory | 12508 KiB |
Compile Error
./Main.cpp: In function 'int main()':
./Main.cpp:20:22: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} [-Wsign-compare]
20 | if(S[i].size() != A[j]){
./Main.cpp:27:20: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'll' {aka 'long long int'} [-Wsign-compare]
27 | if(S[i].size() != 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 | 2 ms | 6336 KiB |
| 00-sample-02.txt | AC | 2 ms | 6300 KiB |
| 01-01.txt | AC | 15 ms | 7144 KiB |
| 01-02.txt | AC | 56 ms | 9644 KiB |
| 01-03.txt | AC | 97 ms | 11984 KiB |
| 01-04.txt | AC | 56 ms | 9652 KiB |
| 01-05.txt | AC | 75 ms | 10816 KiB |
| 01-06.txt | AC | 65 ms | 10176 KiB |
| 01-07.txt | AC | 109 ms | 12500 KiB |
| 01-08.txt | AC | 118 ms | 12460 KiB |
| 01-09.txt | AC | 15 ms | 6912 KiB |
| 01-10.txt | AC | 56 ms | 9548 KiB |
| 01-11.txt | AC | 15 ms | 6956 KiB |
| 01-12.txt | AC | 90 ms | 11596 KiB |
| 01-13.txt | AC | 65 ms | 10004 KiB |
| 01-14.txt | AC | 54 ms | 9344 KiB |
| 01-15.txt | AC | 119 ms | 12436 KiB |
| 01-16.txt | AC | 125 ms | 12508 KiB |
| 01-17.txt | AC | 121 ms | 12460 KiB |
| 01-18.txt | AC | 118 ms | 12408 KiB |
| 01-19.txt | AC | 120 ms | 12480 KiB |
| 01-20.txt | AC | 119 ms | 12376 KiB |
| 01-21.txt | AC | 114 ms | 12436 KiB |
| 01-22.txt | AC | 117 ms | 12432 KiB |
| 01-23.txt | AC | 119 ms | 12508 KiB |