Submission #3814529


Source Code Expand

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
  string strs,strt;
  cin >> strs >> strt;
  int sizes = strs.size();
  char temp;
  int i,j;
  for(i = 0;i < sizes;++i){
    char temp = strs.at(sizes-1);
    for(j = sizes-2;j >= 0;--j){
      strs.at(j+1) = strs.at(j);
    }
    strs.at(0) = temp;
    if(strs == strt){
      cout << "Yes" << endl;
      return 0;
    }else{
      continue;
    }
  }
  cout << "No" << endl;
  return 0;
}

Submission Info

Submission Time
Task B - String Rotation
User morutole
Language C++14 (GCC 5.4.1)
Score 200
Code Size 572 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 14
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All 0_small_0, 0_small_1, 0_small_2, 0_small_3, 1_medium_0, 1_medium_1, 1_medium_2, 2_max_0, 2_max_1, 2_max_2, 2_max_3, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
0_small_0 AC 1 ms 256 KB
0_small_1 AC 1 ms 256 KB
0_small_2 AC 1 ms 256 KB
0_small_3 AC 1 ms 256 KB
1_medium_0 AC 1 ms 256 KB
1_medium_1 AC 1 ms 256 KB
1_medium_2 AC 1 ms 256 KB
2_max_0 AC 1 ms 256 KB
2_max_1 AC 1 ms 256 KB
2_max_2 AC 1 ms 256 KB
2_max_3 AC 1 ms 256 KB
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
sample_03 AC 1 ms 256 KB