@@ -6,8 +6,8 @@ using ll = long long;
6
6
int N;
7
7
string S;
8
8
9
- bool solve (vector<char >& ws, char c0, char c1, char c2 ) {
10
- ws[0 ] = c1 , ws[1 ] = c2, ws[N- 1 ] = c0 ;
9
+ bool solve (vector<char >& ws, char c0, char c1) {
10
+ ws[0 ] = c0 , ws[1 ] = c1 ;
11
11
for (int i = 1 ; i < N; ++i) {
12
12
int j = (i - 1 + N) % N, k = (i + 1 ) % N;
13
13
if (S[i] == ' o' ) {
@@ -36,14 +36,10 @@ bool solve(vector<char>& ws, char c0, char c1, char c2) {
36
36
37
37
vector<char > solve () {
38
38
vector<char > ws (N, ' ' );
39
- if (solve (ws, ' W' , ' S' , ' W' )) return ws;
40
- if (solve (ws, ' S' , ' S' , ' S' )) return ws;
41
- if (solve (ws, ' W' , ' W' , ' S' )) return ws;
42
- if (solve (ws, ' S' , ' W' , ' W' )) return ws;
43
- if (solve (ws, ' W' , ' S' , ' S' )) return ws;
44
- if (solve (ws, ' S' , ' S' , ' W' )) return ws;
45
- if (solve (ws, ' S' , ' W' , ' S' )) return ws;
46
- if (solve (ws, ' W' , ' W' , ' W' )) return ws;
39
+ if (solve (ws, ' S' , ' S' )) return ws;
40
+ if (solve (ws, ' S' , ' W' )) return ws;
41
+ if (solve (ws, ' W' , ' S' )) return ws;
42
+ if (solve (ws, ' W' , ' W' )) return ws;
47
43
return {};
48
44
}
49
45
0 commit comments