提出 #74661020
ソースコード 拡げる
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int n, m;
int a[12], b[12];
bool f[12][12][26];
string s[200010];
main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
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];
int l = s[i].size();
for (int j = 0; j < l; j++)
f[l][j + 1][s[i][j] - 'a'] = 1;
}
for (int i = 1; i <= m; i++)
{
int l = s[i].size();
if (l != n)
{
cout << "No" << endl;
continue;
}
int flag = 1;
for (int j = 1; j <= n; j++)
{
int c = s[i][j - 1] - 'a';
if (!f[a[j]][b[j]][c])
{
flag = 0;
break;
}
}
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - Fishbones |
| ユーザ | xzy404 |
| 言語 | C++23 (GCC 15.2.0) |
| 得点 | 300 |
| コード長 | 1032 Byte |
| 結果 | AC |
| 実行時間 | 17 ms |
| メモリ | 9944 KiB |
コンパイルエラー
./Main.cpp:10:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
10 | main()
| ^~~~
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 300 / 300 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00-sample-01.txt | AC | 4 ms | 9924 KiB |
| 00-sample-02.txt | AC | 4 ms | 9816 KiB |
| 01-01.txt | AC | 6 ms | 9852 KiB |
| 01-02.txt | AC | 11 ms | 9824 KiB |
| 01-03.txt | AC | 17 ms | 9816 KiB |
| 01-04.txt | AC | 11 ms | 9884 KiB |
| 01-05.txt | AC | 13 ms | 9804 KiB |
| 01-06.txt | AC | 12 ms | 9804 KiB |
| 01-07.txt | AC | 15 ms | 9876 KiB |
| 01-08.txt | AC | 16 ms | 9752 KiB |
| 01-09.txt | AC | 6 ms | 9840 KiB |
| 01-10.txt | AC | 12 ms | 9944 KiB |
| 01-11.txt | AC | 6 ms | 9820 KiB |
| 01-12.txt | AC | 15 ms | 9824 KiB |
| 01-13.txt | AC | 12 ms | 9876 KiB |
| 01-14.txt | AC | 11 ms | 9752 KiB |
| 01-15.txt | AC | 16 ms | 9884 KiB |
| 01-16.txt | AC | 16 ms | 9804 KiB |
| 01-17.txt | AC | 15 ms | 9904 KiB |
| 01-18.txt | AC | 16 ms | 9944 KiB |
| 01-19.txt | AC | 16 ms | 9788 KiB |
| 01-20.txt | AC | 15 ms | 9924 KiB |
| 01-21.txt | AC | 16 ms | 9828 KiB |
| 01-22.txt | AC | 15 ms | 9884 KiB |
| 01-23.txt | AC | 16 ms | 9924 KiB |