QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#687428#9350. Fixing Bannerswlkmok369WA 59ms3628kbC++141.1kb2024-10-29 19:00:372024-10-29 19:00:39

Judging History

你现在查看的是最新测评结果

  • [2024-10-29 19:00:39]
  • 评测
  • 测评结果:WA
  • 用时:59ms
  • 内存:3628kb
  • [2024-10-29 19:00:37]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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'