Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
52404 Administrator 木板游戏 C++ 运行出错 0 2 MS 324 KB 1022 2022-07-19 12:08:21

Tests(0/20):


#include <bits/stdc++.h> using namespace std; int t; string s, r; int a, b; int main() { cin>>t; while(t--) { cin>>s>>r>>a>>b; string tmp = s; bool flag = false; int prev = a; // a first for(int i = 0; i < 1000000; ++i) { s = s.substr(prev) + s.substr(0, prev); reverse(s.begin(), s.end()); if(prev == a) prev = b; else prev = a; //cout<<s<<endl; if(s == r) { cout<<"yes"<<endl; goto end; } } prev = b; s = tmp; for(int i = 0; i < 1000000; ++i) { s = s.substr(prev) + s.substr(0, prev); reverse(s.begin(), s.end()); if(prev == a) prev = b; else prev = a; if(s == r) { cout<<"yes"<<endl; goto end; } } cout<<"no"<<endl; end: ; } return 0; }


测评信息: