Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
52493 | AK2022071313 | 修复符文 | C++ | 解答错误 | 40 | 111 MS | 45644 KB | 3421 | 2022-07-19 12:22:33 |
#include<bits/stdc++.h> #pragma GCC optimize(3) #pragma GCC optimize("Ofast") #pragma GCC optimize("inline") #pragma GCC optimize("-fgcse") #pragma GCC optimize("-fgcse-lm") #pragma GCC optimize("-fipa-sra") #pragma GCC optimize("-ftree-pre") #pragma GCC optimize("-ftree-vrp") #pragma GCC optimize("-fpeephole2") #pragma GCC optimize("-ffast-math") #pragma GCC optimize("-fsched-spec") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("-falign-jumps") #pragma GCC optimize("-falign-loops") #pragma GCC optimize("-falign-labels") #pragma GCC optimize("-fdevirtualize") #pragma GCC optimize("-fcaller-saves") #pragma GCC optimize("-fcrossjumping") #pragma GCC optimize("-fthread-jumps") #pragma GCC optimize("-funroll-loops") #pragma GCC optimize("-fwhole-program") #pragma GCC optimize("-freorder-blocks") #pragma GCC optimize("-fschedule-insns") #pragma GCC optimize("inline-functions") #pragma GCC optimize("-ftree-tail-merge") #pragma GCC optimize("-fschedule-insns2") #pragma GCC optimize("-fstrict-aliasing") #pragma GCC optimize("-fstrict-overflow") #pragma GCC optimize("-falign-functions") #pragma GCC optimize("-fcse-skip-blocks") #pragma GCC optimize("-fcse-follow-jumps") #pragma GCC optimize("-fsched-interblock") #pragma GCC optimize("-fpartial-inlining") #pragma GCC optimize("no-stack-protector") #pragma GCC optimize("-freorder-functions") #pragma GCC optimize("-findirect-inlining") #pragma GCC optimize("-frerun-cse-after-loop") #pragma GCC optimize("inline-small-functions") #pragma GCC optimize("-finline-small-functions") #pragma GCC optimize("-ftree-switch-conversion") #pragma GCC optimize("-foptimize-sibling-calls") #pragma GCC optimize("-fexpensive-optimizations") #pragma GCC optimize("-funsafe-loop-optimizations") #pragma GCC optimize("inline-functions-called-once") #pragma GCC optimize("-fdelete-null-pointer-checks") using namespace std; string str1[101],str2[101],str3[101],str4[101]; int cnt1,cnt2,cnt3,cnt4; int main(){ int t; scanf("%d",&t); while(t--){ int a,b,cnt1=0,cnt2=0,cnt3=0,cnt4=0; bool f1=1,f2=1; string s1,s2,s3,s4; cin>>s1>>s2>>a>>b,s3=s4=s1; for(int i=1;(f1||f2)&&i<=100;i++){ if(f1){ if(i&1){ s3=s3.substr(a)+s3.substr(0,a),reverse(s3.begin(),s3.end()); } else{ s3=s3.substr(b)+s3.substr(0,b),reverse(s3.begin(),s3.end()); } if(s3==s2){ puts("yes"); goto fuck; } bool f=0; if(i&1){ for(int j=1;j<=cnt1;j++){ if(str1[j]==s3){ f=1; break; } } str1[++cnt1]=s3; } else{ for(int j=1;j<=cnt2;j++){ if(str2[j]==s3){ f=1; break; } } str2[++cnt2]=s3; } if(f){ f1=0; } } if(f2){ if(i&1){ s4=s4.substr(b)+s4.substr(0,b),reverse(s4.begin(),s4.end()); } else{ s4=s4.substr(a)+s4.substr(0,a),reverse(s4.begin(),s4.end()); } if(s4==s2){ puts("yes"); goto fuck; } bool f=0; if(i&1){ for(int j=1;j<=cnt3;j++){ if(str3[j]==s4){ f=1; break; } } str3[++cnt3]=s4; } else{ for(int j=1;j<=cnt4;j++){ if(str4[j]==s4){ f=1; break; } } str4[++cnt4]=s4; } if(f){ f2=0; } } } puts("no"); fuck:; } return 0; }