QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#595647#9350. Fixing BannersAlucardTL 0ms3656kbC++141.8kb2024-09-28 14:10:482024-09-28 14:10:48

Judging History

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

  • [2024-09-28 14:10:48]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:3656kb
  • [2024-09-28 14:10:48]
  • 提交

answer

#include <bits/stdc++.h>
#include <iostream>

using namespace std;
 
typedef long long ll;

typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
#define i128 _int128

#define fi first
#define se second 
#define pb push_back

#define jintian return
#define shuawuti 0
#define endl '\n'

const ll INF=1e18;
const ll N=1e5+7;

string str;
int a[9][9],f;


void solve(){
    f=0;
    for(int i=1;i<=6;++i){
        for(int j=1;j<=6;++j){
            a[i][j]=0;
        }
    }
    for(int i=1;i<=6;++i){
        cin>>str;
        for(int j=0;j<sizeof(str);++j){
            if(str[j]=='h')a[i][1]++;
            if(str[j]=='a')a[i][2]++;
            if(str[j]=='r')a[i][3]++;
            if(str[j]=='b')a[i][4]++;
            if(str[j]=='i')a[i][5]++;
            if(str[j]=='n')a[i][6]++;
        }
    }
    for(int i=1;i<=6;++i){
        for(int j=1;j<=6;++j){
            if(j==i)continue;
            for(int k=1;k<=6;++k){
                if(k==i || k==j)continue;
                for(int l=1;l<=6;++l){
                    if(l==i || l==j || l==k)continue;
                    for(int m=1;m<=6;++m){
                        if(m==i || m==j || m==k || m==l)continue;
                        for(int n=1;n<=6;++n){
                            if(n==i || n==j || n==k || n==l || n==m)continue;
                            if(a[i][1]&&a[j][2]&&a[k][3]&&a[l][4]&&a[m][5]&&a[n][6])f=1;
                        }
                    }
                }
            }
        }
    }
    if(f)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
    
}

int main(){
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    
    int _=1;
    cin>>_;
    
    while(_--)solve();

    jintian shuawuti;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3656kb

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
Time Limit Exceeded

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
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
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
Yes
No
No
No
No
No
No
No
No
No
No
No
No
N...

result: