Submission #74670275
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
int main(void){
int n;
cin >> n;
vector<set<char>> se(n);
vector<int> a(n), b(n);
for(int i = 0; i < n; i++){
cin >> a[i] >> b[i];
}
int m;
cin >> m;
vector<string> s(m);
for(int i = 0; i < m; i++){
cin >> s[i];
for(int j = 0; j < n; j++){
if(s[i].length() == a[j]){
se[j].insert(s[i][b[j]-1]);
}
}
}
for(int i = 0; i < m; i++){
if(s[i].length() != n){
cout << "No" << endl;
continue;
}
else {
bool flag = true;
for(int j = 0; j < n; j++){
if (se[j].count(s[i][j]) == 0){
flag = false;
}
}
if(flag){
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
}
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Fishbones |
| User | mrkm1627 |
| Language | C++23 (GCC 15.2.0) |
| Score | 300 |
| Code Size | 1024 Byte |
| Status | AC |
| Exec Time | 208 ms |
| Memory | 9664 KiB |
Compile Error
./Main.cpp: In function 'int main()':
./Main.cpp:17:30: 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<int>, int>::value_type' {aka 'int'} [-Wsign-compare]
17 | if(s[i].length() == a[j]){
./Main.cpp:25:26: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
25 | if(s[i].length() != 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 | 3636 KiB |
| 00-sample-02.txt | AC | 1 ms | 3636 KiB |
| 01-01.txt | AC | 15 ms | 4244 KiB |
| 01-02.txt | AC | 58 ms | 6800 KiB |
| 01-03.txt | AC | 102 ms | 9464 KiB |
| 01-04.txt | AC | 60 ms | 6932 KiB |
| 01-05.txt | AC | 86 ms | 7940 KiB |
| 01-06.txt | AC | 74 ms | 7316 KiB |
| 01-07.txt | AC | 187 ms | 9616 KiB |
| 01-08.txt | AC | 208 ms | 9656 KiB |
| 01-09.txt | AC | 15 ms | 4188 KiB |
| 01-10.txt | AC | 60 ms | 6760 KiB |
| 01-11.txt | AC | 15 ms | 4160 KiB |
| 01-12.txt | AC | 98 ms | 8896 KiB |
| 01-13.txt | AC | 70 ms | 7316 KiB |
| 01-14.txt | AC | 59 ms | 6584 KiB |
| 01-15.txt | AC | 163 ms | 9564 KiB |
| 01-16.txt | AC | 173 ms | 9664 KiB |
| 01-17.txt | AC | 144 ms | 9504 KiB |
| 01-18.txt | AC | 148 ms | 9604 KiB |
| 01-19.txt | AC | 142 ms | 9520 KiB |
| 01-20.txt | AC | 147 ms | 9576 KiB |
| 01-21.txt | AC | 146 ms | 9596 KiB |
| 01-22.txt | AC | 151 ms | 9616 KiB |
| 01-23.txt | AC | 151 ms | 9656 KiB |