QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#759625 | #9350. Fixing Banners | _Rosetta_ | WA | 57ms | 3596kb | C++14 | 2.5kb | 2024-11-18 10:36:28 | 2024-11-18 10:36:29 |
Judging History
answer
#include<bits/stdc++.h>
#define fo(s) freopen(s".in","r",stdin),freopen(s".out","w",stdout)
#define rep(i,l,r) for(ll i(l),i##end(r);i<=i##end;++i)
#define per(i,r,l) for(ll i(r),i##end(l);i>=i##end;--i)
#define dbg(x) cerr<<#x<<" "<<x<<'\n';
#define ll long long
#define gc getchar
#define pc putchar
using namespace std;
namespace WrongIO
{
#define Ts template<typename Ty,typename... Ar>
#define Tp template<typename Ty>
Tp Ty wmax(Ty a,Ty b){return a>=b? a:b;}
Tp Ty wmin(Ty a,Ty b){return a<=b? a:b;}
Tp void read(Ty &x){x=0;Ty opt=1;char c=gc();while(!isdigit(c)&&c!='-')c=gc();if(c=='-')opt=-1,c=gc();while(isdigit(c))x=(x<<3)+(x<<1),x+=c-'0',c=gc();x*=opt;return;}
Tp void write(Ty x){short OI_USE[150],OI_top=0;if(x<=0) if(x==0)pc('0');else pc('-'),x*=-1;while(x)OI_USE[++OI_top]=x%10,x/=10;while(OI_top--)pc(OI_USE[OI_top+1]+'0');return;}
void writec(char c[]){int len=strlen(c);for(int i=0;i<len;i++)pc(c[i]);}
void writes(string s){int len=s.length();for(int i=0;i<len;i++)pc(s[i]);}
void readc(char &c,int l,int r){c=gc(); while(c!=EOF&&(c<l||c>r)) c=gc();}
void readc(char &c,char val){c=gc();while(c!=EOF&&c!=val) c=gc();}
void readc(char val){char c;c=gc();while(c!=EOF&&c!=val) c=gc();}
void readls(string &s){char c=gc();while(c!='\n') s.push_back(c),c=gc();}
Ts void read(Ty &x,Ar &...y) {read(x),read(y...);}
Tp void writeln(Ty x) {write(x),pc('\n');}
Tp void writesp(Ty x) {write(x),pc(' ');}
#undef Ts
#undef Tp
} using namespace WrongIO;
ll T;
string a[7];
ll is[20][20];
ll vis[20],ans,vk[20];
bool gt(ll u)
{
vk[u]=1;
rep(v,1,12)
if(is[u][v]&&vk[v]==0)
{
if(gt[v]||vis[v]==0&&v>6) return vis[v]=1,1;
}
return 0;
}
void add(ll u,ll v)
{
is[u][v]=is[v][u]=1;
}
int main()
{
read(T);
while(T--)
{
memset(is,0,sizeof(is));
memset(vis,0,sizeof(vis)); ans=0;
rep(i,1,6) cin>>a[i];
rep(i,1,6)
{
if(a[i].find('h')!=string::npos) add(i,7);
if(a[i].find('a')!=string::npos) add(i,8);
if(a[i].find('r')!=string::npos) add(i,9);
if(a[i].find('b')!=string::npos) add(i,10);
if(a[i].find('i')!=string::npos) add(i,11);
if(a[i].find('n')!=string::npos) add(i,12);
}
rep(i,1,6)
{
if(memset(vk,0,sizeof(vk)),gt(i)) ans++,vis[i]=1;
}
if(ans==6) writes("Yes\n"); else writes("No\n");
}
return 0;
}
//g++ .Yuria.cpp -o rst -std=c++17
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3596kb
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: 57ms
memory: 3532kb
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 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 Yes No No No No No No No No Yes No No No No ...
result:
wrong answer 86th lines differ - expected: 'No', found: 'Yes'