I have read the task few times but stil don't get what I have to do. Here is my idea:
I extracted every circle substring and compared them, and just output the result.
But its obviously wrong. The sample test gives the correct result, but it fails on every test-case. thx in advance
# include <iostream>
using namespace std;
string Ring, patt;
int main(){
int con, poz;
string sol = "A";
cin >> Ring;
for( int i=0; i < Ring.length(); i++ ){
patt = Ring.substr( i, Ring.length() - i );
patt = patt + Ring.substr( 0, i );
if( patt > sol ){
sol = patt;
con = 1;
poz = i+1;
}
if( patt == sol )con++;
}
cout << con << " " << poz << endl;
return 0;
}I extracted every circle substring and compared them, and just output the result.
But its obviously wrong. The sample test gives the correct result, but it fails on every test-case. thx in advance