QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#687428 | #9350. Fixing Banners | wlkmok369 | WA | 59ms | 3628kb | C++14 | 1.1kb | 2024-10-29 19:00:37 | 2024-10-29 19:00:39 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define INF 0x3f
const ll mod = 1e9 + 7;
const ll MAXN = 500005;
ll _ = 1, n, m, ans = 0, a[MAXN], f[MAXN];
map<ll, ll> ma[10];
bool flag = 0;
string ss = "harbin";
void dfs(ll i)
{
if (i == 7)
{
flag = 1;
return;
}
for (auto it : ss)
{
if (f[it] == 0 && ma[i][it] >= 1)
{
f[it] = 1;
dfs(i + 1);
if (flag)
{
return;
}
f[it] = 0;
}
}
}
void solve()
{
string s;
flag = 0;
for (int i = 1; i <= 6; i++)
{
cin >> s;
for (auto it : s)
{
ma[i][it] = 1;
}
}
dfs(1);
if (flag)
{
cout << "Yes" << '\n';
}
else
{
cout << "No" << '\n';
}
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> _;
while (_--)
{
solve();
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3560kb
input:
2 welcome toparticipate inthe ccpccontest inharbin inoctober harvest belong ninja reset amazing intriguing
output:
No Yes
result:
ok 2 lines
Test #2:
score: -100
Wrong Answer
time: 59ms
memory: 3628kb
input:
50000 dwwfplbjd elulqfmsp whobggs kbnhtvzcs zllux ggye vtnqpmvi cgsplau gkuwhhmrio sp q utrefny tvdcequdjj klesyx esovlmdy x nywu gklfbqfb ysnaswszfq ouo tq r auvi copeabvz nruvawao cdv vdsk hboecpit s ewscbmb jeqp gel u htk fcoigxbux ylinyzut bnhrvoetf xa ehnbce keyk efvzoyba xan tvnlm tetpijfh blq...
output:
No No Yes No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No...
result:
wrong answer 3rd lines differ - expected: 'No', found: 'Yes'