Submission #74688488
Source Code Expand
//競プロ C++テンプレ
#include <bits/stdc++.h>
using namespace std;
int vector_finder(vector<char> vec, char xx) {
auto itr = find(vec.begin(), vec.end(), xx);
size_t index = distance( vec.begin(), itr );
if (index != vec.size()) { // 発見できたとき
return 1;
}
else { // 発見できなかったとき
return 0;
}
}
int main() {
int N;
cin >> N ;
vector<pair<int, int>> vec(N);
vector<vector<char>> kak(N);
for(int i = 0; i < N; i++){
cin >> vec.at(i).first >> vec.at(i).second;
}
int M; cin >> M;
vector<string> str(M);
for(int i = 0; i < M; i++){
cin >> str.at(i);
}
for(int i = 0; i < N;i++){
for(int j = 0; j < M; j++){
int siz = vec.at(i).first;
int moji = vec.at(i).second - 1;
int bo = str.at(j).size();
if(siz == bo){
kak.at(i).push_back(str.at(j).at(moji));
//cout << str.at(j).at(moji);
}
}
}
for(int i = 0; i < M; i++){
int maxx = str.at(i).size();
if(maxx > N){
cout << "No" << endl; continue;
}
bool isok = true;
for(int j = 0; j < maxx; j++){
if(!vector_finder(kak.at(j),str.at(i).at(j))){
isok = false;
}
}
if(isok) cout << "Yes" << endl;
else cout << "No" << endl;
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Fishbones |
| User | gumi11ta |
| Language | C++23 (GCC 15.2.0) |
| Score | 0 |
| Code Size | 1389 Byte |
| Status | WA |
| Exec Time | > 2000 ms |
| Memory | 11884 KiB |
Judge Result
| Set Name | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 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 | 1 ms | 3636 KiB |
| 00-sample-02.txt | AC | 1 ms | 3448 KiB |
| 01-01.txt | AC | 16 ms | 4180 KiB |
| 01-02.txt | WA | 60 ms | 6880 KiB |
| 01-03.txt | WA | 132 ms | 9552 KiB |
| 01-04.txt | WA | 79 ms | 6744 KiB |
| 01-05.txt | WA | 327 ms | 8148 KiB |
| 01-06.txt | WA | 273 ms | 7532 KiB |
| 01-07.txt | TLE | > 2000 ms | 11544 KiB |
| 01-08.txt | TLE | > 2000 ms | 11800 KiB |
| 01-09.txt | WA | 18 ms | 4232 KiB |
| 01-10.txt | WA | 134 ms | 6920 KiB |
| 01-11.txt | WA | 21 ms | 4120 KiB |
| 01-12.txt | WA | 458 ms | 9044 KiB |
| 01-13.txt | WA | 294 ms | 7380 KiB |
| 01-14.txt | WA | 225 ms | 6680 KiB |
| 01-15.txt | TLE | > 2000 ms | 11604 KiB |
| 01-16.txt | TLE | > 2000 ms | 11736 KiB |
| 01-17.txt | TLE | > 2000 ms | 11756 KiB |
| 01-18.txt | TLE | > 2000 ms | 11884 KiB |
| 01-19.txt | TLE | > 2000 ms | 11800 KiB |
| 01-20.txt | TLE | > 2000 ms | 11884 KiB |
| 01-21.txt | TLE | > 2000 ms | 11876 KiB |
| 01-22.txt | TLE | > 2000 ms | 11872 KiB |
| 01-23.txt | TLE | > 2000 ms | 11884 KiB |