Submission #1368438
Source Code Expand
#include<stdio.h> #include<assert.h> #include<vector> #include<string.h> #include<algorithm> #include<memory.h> #include<cmath> #include<string> #include<iostream> #include<set> #include<unordered_set> #include<map> #include<queue> #include<functional> #include<list> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<double, double> pdd; typedef tuple<int,int,int> t3; const int MX = 500005; const int MM = 1000000007; int D[MX]; char buf[MX]; int main() { int N; scanf("%d%s", &N, buf+1); for(int t = 0; t < 4; t++){ D[1] = t/2, D[2] = t%2; for(int i = 3; i <= N; i++){ D[i] = D[i-2]^D[i-1]^(buf[i-1] == 'o'); } if( D[N-1]^D[N]^D[1]^(buf[N] == 'o') || D[N]^D[1]^D[2]^(buf[1] == 'o') ) continue; for(int i = 1; i <= N; i++) printf("%c", D[i]? 'S':'W'); printf("\n"); return 0; } printf("-1\n"); }
Submission Info
Submission Time | |
---|---|
Task | D - Menagerie |
User | zigui |
Language | C++14 (GCC 5.4.1) |
Score | 500 |
Code Size | 931 Byte |
Status | AC |
Exec Time | 3 ms |
Memory | 768 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:34:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d%s", &N, buf+1); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 500 / 500 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt |
All | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 1 ms | 256 KB |
00_example_02.txt | AC | 1 ms | 256 KB |
00_example_03.txt | AC | 1 ms | 256 KB |
01.txt | AC | 2 ms | 640 KB |
02.txt | AC | 2 ms | 512 KB |
03.txt | AC | 1 ms | 256 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | AC | 3 ms | 768 KB |
06.txt | AC | 3 ms | 768 KB |
07.txt | AC | 1 ms | 384 KB |
08.txt | AC | 2 ms | 384 KB |
09.txt | AC | 1 ms | 256 KB |
10.txt | AC | 1 ms | 384 KB |
11.txt | AC | 3 ms | 768 KB |
12.txt | AC | 3 ms | 768 KB |
13.txt | AC | 3 ms | 768 KB |