Submission #3210054
Source Code Expand
#include<iostream> #include<set> #include <bitset> #include<queue> #include<vector> #include<map> #include<stack> #include <cstdio> #include<algorithm> #include <sstream> #include<string> #include<string.h> #include <cmath> #include <iomanip> #include <string> #include<list> #include <limits> #include <numeric> #include <type_traits> #include<bitset> #define int long long #define ll long long #define mod 1000000007 #define inf 1e17 #define rep(i,j,n) for(int i=j;i<n;i++) #define P pair<int,int> double pi = 3.141592653589793; using namespace std; //ここから始めよう signed main(){ int n;string s;cin>>n>>s; s+=s; //cout<<s<<endl; int animal[114514]={}; rep(i,0,1<<2){ rep(j,0,2){ if(i&(1<<j))animal[j]=1; } rep(j,1,n+2){ if((animal[j]==1&&s[j]=='o')||(animal[j]==0&&s[j]=='x'))animal[j+1]=animal[j-1]; else animal[j+1]=animal[j-1]*-1+1; } // rep(j,0,n+1)cout<<animal[j];cout<<endl; if(animal[n]==animal[0]&&animal[n+1]==animal[1]){ rep(j,0,n){if(animal[j]==0)cout<<'W';else cout<<'S';}cout<<endl;return 0; } }cout<<-1<<endl;return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Menagerie |
User | birdway |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1223 Byte |
Status | WA |
Exec Time | 9 ms |
Memory | 1576 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 2 ms | 1152 KB |
00_example_02.txt | AC | 2 ms | 1152 KB |
00_example_03.txt | AC | 1 ms | 1152 KB |
01.txt | WA | 5 ms | 1408 KB |
02.txt | AC | 5 ms | 1408 KB |
03.txt | AC | 2 ms | 1152 KB |
04.txt | AC | 1 ms | 1152 KB |
05.txt | WA | 7 ms | 1448 KB |
06.txt | AC | 9 ms | 1576 KB |
07.txt | WA | 2 ms | 1152 KB |
08.txt | AC | 3 ms | 1280 KB |
09.txt | AC | 2 ms | 1152 KB |
10.txt | AC | 3 ms | 1280 KB |
11.txt | AC | 9 ms | 1564 KB |
12.txt | AC | 9 ms | 1564 KB |
13.txt | WA | 7 ms | 1436 KB |