QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#533544 | #5077. Card Game | Tiga_Pilot_2 | AC ✓ | 779ms | 21896kb | C++20 | 5.0kb | 2024-08-26 03:08:12 | 2024-08-26 03:08:14 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge {c b, e;};
sim > rge<c> range(c i, c j) {return rge<c>{i,j};}
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug{
~debug() {cerr << endl;}
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair <b, c> d) {
ris <<"(" <<d.fi <<", " <<d.se <<")";
}
sim dor(rge<c> d) {
*this << "[";
for(auto it=d.b;it!=d.e;++it) {
*this <<", " + 2*(it==d.b) <<*it;
}
ris << "]";
}
};
#define imie(...) "[" <<#__VA_ARGS__ ": " << (__VA_ARGS__) <<"]"
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, a, b) for(int i = a; i > (b); --i)
#define ar array
#define sz(x) (int) (x).size()
#define pii pair<int,int>
#define fi first
#define se second
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef pair<double,int> pdi;
typedef vector<int> vi;
#define all(x) (x).begin(), (x).end()
template<typename T>
void min_self(T& A, T B) {
A = min(A,B);
}
template<typename T>
void max_self(T& A, T B) {
A = max(A,B);
}
using pipi = pair<pii,pii>;
#include <bits/extc++.h> /** keep-include */
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash { // To use most bits rather than just the lowest ones:
const uint64_t C = ll(4e18 * acos(0)) | 71; // large odd number
ll operator()(pipi xp) const {
auto [imj, ipj] = xp;
auto [imj1,imj2] = imj;
auto [ipj1, ipj2] = ipj;
imj1 += 24;
imj2 += 24;
ll x = imj1*50*50*50 + imj2*50*50 + ipj1*50 + ipj2;
return __builtin_bswap64((x^RANDOM)*C);
}
};
__gnu_pbds::gp_hash_table<pipi, int, chash> sg({},{},{},{}, {1 << 16});
const int mxn=25;
int n,m;
string s[mxn];
void solve() {
cin >>n >>m;
rep(i,0,n) {
cin >>s[i];
}
// map<pipi,int> sg;
for(int len1=1;len1<=n+m-1;len1+=2) {
rep(imj1,-m+1,n) {
int imj2 = imj1+len1-1;
if(imj2>=n) break;
for(int len2=1;len2<=n+m-1;len2+=2) {
for(int ipj1 = (imj1+n*m*2)%2;ipj1<n+m-1;ipj1+=2) {
int ipj2 = ipj1+len2-1;
if(ipj2>=n+m-1) break;
pipi st = {{imj1,imj2},{ipj1,ipj2}};
set<int> mx;
for(int imji=imj1;imji<=imj2;imji+=2) {
for(int ipji=ipj1; ipji<=ipj2;ipji+=2) {
int i = (imji+ipji)/2;
int j = (ipji-imji)/2;
if(i>=0&&i<n&&j>=0&&j<m) {
int temp = 0;
if(s[i][j]=='R') {
temp ^= sg[{{imj1,imj2},{ipj1,ipji-2}}];
temp ^= sg[{{imj1,imj2},{ipji+2,ipj2}}];
} else if(s[i][j]=='B') {
temp ^= sg[{{imj1,imji-2},{ipj1,ipj2}}];
temp ^= sg[{{imji+2,imj2},{ipj1,ipj2}}];
} else {
pii kiri = {imj1,imji-2}, knn = {imji+2,imj2}, ats={ipj1,ipji-2}, bwh = {ipji+2,ipj2};
temp ^= sg[{kiri,ats}];
temp ^= sg[{kiri,bwh}];
temp ^= sg[{knn,ats}];
temp ^= sg[{knn,bwh}];
}
mx.insert(temp);
}
}
}
int mxi = 0;
for(auto a : mx) {
if(a==mxi) {
mxi++;
} else {
break;
}
}
sg[st] = mxi;
// debug() <<imie(st) imie(mxi);
}
}
}
}
int kr1 = (-m+1),kr2=kr1+1;
int kn1 = n-1,kn2=kn1-1;
if(((kn1-kr1)%2)) {
swap(kn1,kn2);
}
int bwh1 = 0, bwh2=1;
int ats1 = n+m-2, ats2=ats1-1;
if(ats1%2) {
swap(ats1,ats2);
}
if((kr1-bwh1)%2) {
swap(bwh1,bwh2);
swap(ats1,ats2);
}
int ans = sg[{{kr1,kn1},{bwh1,ats1}}]^sg[{{kr2,kn2},{bwh2,ats2}}];
// debug() <<imie(kr1) imie(kn1) imie(bwh1) imie(ats1);
// debug() <<imie(kr2) imie(kn2) imie(bwh2) imie(ats2);
if(ans) {
cout <<"W\n";
} else {
cout <<"L\n";
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
solve();
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 4764kb
input:
1 3 BBB
output:
W
result:
ok single line: 'W'
Test #2:
score: 0
Accepted
time: 0ms
memory: 4480kb
input:
2 3 BBG RGR
output:
W
result:
ok single line: 'W'
Test #3:
score: 0
Accepted
time: 0ms
memory: 4680kb
input:
2 2 GG GG
output:
L
result:
ok single line: 'L'
Test #4:
score: 0
Accepted
time: 1ms
memory: 4692kb
input:
1 10 RRRRRRRRRR
output:
L
result:
ok single line: 'L'
Test #5:
score: 0
Accepted
time: 1ms
memory: 4680kb
input:
1 11 BBBBBBBBBBB
output:
W
result:
ok single line: 'W'
Test #6:
score: 0
Accepted
time: 0ms
memory: 4632kb
input:
10 1 G G G G G G G G G G
output:
L
result:
ok single line: 'L'
Test #7:
score: 0
Accepted
time: 0ms
memory: 4760kb
input:
11 1 R R R R R R R R R R R
output:
W
result:
ok single line: 'W'
Test #8:
score: 0
Accepted
time: 2ms
memory: 4576kb
input:
2 20 BBGGBGBGGBBGGBGGBGGG GGBBBGBGBBBGBGGGGGGG
output:
L
result:
ok single line: 'L'
Test #9:
score: 0
Accepted
time: 2ms
memory: 4580kb
input:
2 20 GBGBGBBBGGGGGBGGBBBB GGGBBBGBGBGBGGBGBGGB
output:
W
result:
ok single line: 'W'
Test #10:
score: 0
Accepted
time: 3ms
memory: 4616kb
input:
2 21 GBBBBBBGGBGGBBBGBGGBG GBBBGBBBGBBBGGBGBBGBB
output:
L
result:
ok single line: 'L'
Test #11:
score: 0
Accepted
time: 3ms
memory: 4572kb
input:
2 21 GGGBBBGBBGBGGBBGGGBGG BGBBGBBBBBBGBBBBGGGBB
output:
W
result:
ok single line: 'W'
Test #12:
score: 0
Accepted
time: 2ms
memory: 4636kb
input:
20 2 BG GG BG GB BB GB BG GG BB BB BB BB BG BB BG GG BB BG GB BG
output:
L
result:
ok single line: 'L'
Test #13:
score: 0
Accepted
time: 2ms
memory: 4504kb
input:
20 2 BB GB GG GG GB BG GG GB BB BB GG GB BB BG BB BB BG BG BG BG
output:
W
result:
ok single line: 'W'
Test #14:
score: 0
Accepted
time: 0ms
memory: 4580kb
input:
21 2 GB BG BB BG GB BG BG BG GG GG GB BG GG GB GB BG GB BG BG GG GB
output:
L
result:
ok single line: 'L'
Test #15:
score: 0
Accepted
time: 0ms
memory: 4588kb
input:
21 2 BG BB GG GB BG BB GB GG BG GG BB GG BG BB GB GB GB BG BB BG GG
output:
W
result:
ok single line: 'W'
Test #16:
score: 0
Accepted
time: 2ms
memory: 4620kb
input:
2 20 BRRBBBBRBBBBBBBRBBBB RBRRRBRBBBBRRRBBBRRR
output:
L
result:
ok single line: 'L'
Test #17:
score: 0
Accepted
time: 2ms
memory: 4580kb
input:
2 20 BRBBBBBRRRBBRBRBRRBB BBBBRBRRRBBRRRRRBBBB
output:
W
result:
ok single line: 'W'
Test #18:
score: 0
Accepted
time: 0ms
memory: 4636kb
input:
2 21 BBRRRRRBRBRRBRBBRBRBR RBBRBBRRRRRBRBBBRRBBB
output:
L
result:
ok single line: 'L'
Test #19:
score: 0
Accepted
time: 0ms
memory: 4636kb
input:
2 21 RBBBRBBBBBBBRRRRRRRBB BRRRRRBRBBRBBBBRBRBRR
output:
W
result:
ok single line: 'W'
Test #20:
score: 0
Accepted
time: 3ms
memory: 4448kb
input:
20 2 BB BR BB BB RR RR RR BB BR RR BR RR BR BB BR BB RR BB BR BR
output:
L
result:
ok single line: 'L'
Test #21:
score: 0
Accepted
time: 0ms
memory: 4544kb
input:
20 2 BB RR RR BR BB BR RR RB BR RB RB RR RB RB BB BR BR RR BR RR
output:
W
result:
ok single line: 'W'
Test #22:
score: 0
Accepted
time: 3ms
memory: 4592kb
input:
21 2 BR BB BB BB BR RR RB BR BB RB RR RR RB BB RR BR BR RR RB RR RB
output:
L
result:
ok single line: 'L'
Test #23:
score: 0
Accepted
time: 3ms
memory: 4612kb
input:
21 2 BR BR BB BB BR BB RB RB RR RR RR RB RB RB RB BR RB BB BB BB BR
output:
W
result:
ok single line: 'W'
Test #24:
score: 0
Accepted
time: 8ms
memory: 4680kb
input:
3 24 GGRGGGRGRGGRRGGGRRGRRGGR RGRRGGGGRGRGGGGGRRRRGGGG GRRGGRRRGGGGRRGRGGGGRRGG
output:
L
result:
ok single line: 'L'
Test #25:
score: 0
Accepted
time: 8ms
memory: 4616kb
input:
3 24 GGGRGRGGRGRGRGGRGGGRRRRR RRRRGGRGRGGGRRGRGRRRGRRR GGRGGRGRRRRGGGGGGRGRGRRR
output:
W
result:
ok single line: 'W'
Test #26:
score: 0
Accepted
time: 9ms
memory: 4616kb
input:
3 25 RRRRRGRRGGRRRRRRGRGGRRRGG GGGGRGRGGRRRRRGRGRGRGRRRR RGGRRRRRGGGGGRRRGGGGGGGRG
output:
L
result:
ok single line: 'L'
Test #27:
score: 0
Accepted
time: 6ms
memory: 4540kb
input:
3 25 RRGRGRRGRGRGGRGGRRGGRRRGG RGRRGRRGRGGGGGRGGRRRGGGGG RRGGRRGRGGGGGRGRGRRRRGRRG
output:
W
result:
ok single line: 'W'
Test #28:
score: 0
Accepted
time: 7ms
memory: 4496kb
input:
24 3 RGG GRG GRR GGG GGG RGR GRG RGG RRG GRR GGR GRR GGR GRR RGR RGR GRR GRG RGR RRG RRG RGR GGG RRG
output:
L
result:
ok single line: 'L'
Test #29:
score: 0
Accepted
time: 7ms
memory: 4496kb
input:
24 3 GRG GGR RGG GRR RRR GRR RRG GGR GGR RGR GRR GGR RGR GRR RRG GGR GRR RGR GRG GGG GRG RRR RRG GRG
output:
W
result:
ok single line: 'W'
Test #30:
score: 0
Accepted
time: 10ms
memory: 4464kb
input:
25 3 RGR RGG GGG GGR RGG GGR GGR RRG GGG GGR GRR GRG RRR GGG RGG RGG GRG RGG RRR GGG RGR RGR RGG GRG GGR
output:
L
result:
ok single line: 'L'
Test #31:
score: 0
Accepted
time: 6ms
memory: 4688kb
input:
25 3 RRG RGG GRR RGG RGG RRR RRR GRG GRG GGG RGG RRG RRG RRG GGR GGG GGG RGR GGG GGR GGR GRG RRG RGG GRG
output:
W
result:
ok single line: 'W'
Test #32:
score: 0
Accepted
time: 6ms
memory: 4624kb
input:
3 24 RRRBBRBBBBBBBBBBBBBBRBRR BRBRRBBRBRBRRBBRRBRBBBBB RRBRBBBRBBBRBRBBBBBBBBRB
output:
L
result:
ok single line: 'L'
Test #33:
score: 0
Accepted
time: 6ms
memory: 4624kb
input:
3 24 BRBRRBBRBRRBRRRBBBRBRRBB BRBBRBBBBBRBRRRBRRRRRBBR BRBRBBRRRBRBRRBBBBRRBRRB
output:
W
result:
ok single line: 'W'
Test #34:
score: 0
Accepted
time: 3ms
memory: 4696kb
input:
3 25 BBRRBBBBBBBRBBBRBRBRBRBBB RRRBBBBRRRRBRRRRRBBBBRBRB RRRRRBRRBRRBRBRRRBBRRBRRR
output:
L
result:
ok single line: 'L'
Test #35:
score: 0
Accepted
time: 3ms
memory: 4764kb
input:
3 25 BBRBBBBBRBBBBBRRRRRRBBRRB RRRBBRRRBBRBBBRRRBBBBBRBR BBRBRRRBRBBRRRRRRRRBBRRRB
output:
W
result:
ok single line: 'W'
Test #36:
score: 0
Accepted
time: 6ms
memory: 4692kb
input:
24 3 RBR RBB BRB BBR BRR BRR RRR BBR RBR RBB RBR RBR BBB BBB BBR RRB RRB RBR RRR RRB BRB RRR BBR RBB
output:
L
result:
ok single line: 'L'
Test #37:
score: 0
Accepted
time: 6ms
memory: 4632kb
input:
24 3 RRR RBB BBR RBB RBB BRR BBR BRR BBB BBR RRB RRR RBB RRR RRB RRR RRB RRR RBB RBR RRB BRB RBR BBB
output:
W
result:
ok single line: 'W'
Test #38:
score: 0
Accepted
time: 7ms
memory: 4584kb
input:
25 3 BBR BRB RBB RRR BBR RRR RBB BBR BRR RBR RBR BRR BBB RBR BBB BRB BBB RRB RRB RBB BRB RRB RRR BBB RRB
output:
L
result:
ok single line: 'L'
Test #39:
score: 0
Accepted
time: 8ms
memory: 4456kb
input:
25 3 BBB BRB BBB RRR RBR BBB RBR BBR BRB RBR RRR RRR RBB BBB RBR RRR RBB BBB BBR RBB BRR RBB RBB RBR BBB
output:
W
result:
ok single line: 'W'
Test #40:
score: 0
Accepted
time: 366ms
memory: 21540kb
input:
22 22 RBRGRBGRGGGBRRRBRBBBRG RBGBRGBGRBBGRGGBRRBRRG GGRBGGRRBBGRBBGBBGRGGG GBBBGBBGGBBGGGGBGGGRRG BBBRBGRBGRGRBGRBRGBBBG RGRGGBRBBRRBBBBBBRRGRG BBBGRRGRRRBBGGBRRGRGGR GRGGGGGBBRGRRRRGBRRRRG BRGBRBGBGGRGGRRGGGGBGB GBRBGGRGRGRGGRBBGGGGRB RBRGBGBBBGBBBGBGBGGBBB RBBBBBBGBBRBRRBBRGBBGR RGBBBGBRRGGRGBBRGG...
output:
L
result:
ok single line: 'L'
Test #41:
score: 0
Accepted
time: 356ms
memory: 21564kb
input:
22 22 BBGGBGGBGRRBGBRRRGBGGB RRRRGRBGBBRGBGRRBRRGRB RBRRBBGGRBBGBGGRBRBRBB BRRRRRBGRGGRBGBGRRRGGG BGRBRRGRRRRBBRGGRGRGGB RRGBRBRBGGRGGBGGRGRBBR BRGRRRRBBBRRBGRGRRGRGB RRRRRBBBGGGRBBRBGRGGGB GGRBRRGGGGRBGGBRBGRBRR GGGRBGGRRRGBRRGGRRBGBG GBGBBBBRGBGBBRRBBBGBBG BRBGGBBBRRGRGBRBGRRRGG RBBRBBRGRRRRGRRRRB...
output:
W
result:
ok single line: 'W'
Test #42:
score: 0
Accepted
time: 353ms
memory: 21600kb
input:
22 22 GGRBGRRGGRRRBRGRBBBRRG GGGBRBRRGGRRRBRRBRGGGB GBRBGGGRRBGRRRBRRRGRBB RRRBBGRGRRGGGRGBGRGGBB RBBRRRGBBBGGRBRRGBBGBR GBGBGRRBRBBBRBGGGRGRGB BBGBGRGRGBGRGRRBBBBRBR GBGRRRGRGBGGBRGRBBGGRR GGGBBGGGBRRGRGBBRBRGBB RRBGBBGBBGGGBRGBRGBRRB GGGBRRBGRGGGGBGBBRRBRR BRRRRRRRBGGRBBBGBGGBRR BBRRGBRRGBRRBRRRGB...
output:
L
result:
ok single line: 'L'
Test #43:
score: 0
Accepted
time: 361ms
memory: 21588kb
input:
22 22 RRGGGRRBGRGRGBBGBRBBBR BBBRGBGGRGRBBBRGBRGBGG RRGBRRRGGBBBBRRGGBBRBR RBRRGRBGGGRBBRRRBRRRGR RGRBBBBRGRRRGGGBBRGRGG GBGBGGGBRBRBBGRBRGGGBB RRGGBGGBRGBRRGBBBRRRRR RGGGRRBBBGBRGGGBGBGRBG BGGRGGRRRBBBBBBBGGGBBR BGBGBGRGRGBBRRBBRRRGBG BGGBGBGRGRRBRRRBGRBGRR RGRGGBBBRRBRBRRGRGBBGG GGBBGRRGRRGBGBBGGG...
output:
W
result:
ok single line: 'W'
Test #44:
score: 0
Accepted
time: 496ms
memory: 21652kb
input:
25 22 GRGGRRGBGBBGBGGRGGRBBG GRBGRGRRRBBRRRBGGGBRBR BGBGGBGBGBGGRGBRRGBGRB RBGRGGBRBRRGBBBRBRBBBG BRGGBBBRGBBRBBBBBGRGBR RRGRRGRGBGRGGBRGBGRBGB BRBBRRRBBBGBGRBBRGGBGB GGBBGRRBRGGGBGBBBGBBBB BBBGBRRBRBBGBBRRBGRGBB RGBGGBGRRGRGRGRBRBRBRG BBRRBBBBGGBGGBBRBGRRRR RGBBBBRRGGGRBBBRBRBRGB BGGRRRRBBBRGBRBGRG...
output:
L
result:
ok single line: 'L'
Test #45:
score: 0
Accepted
time: 510ms
memory: 21596kb
input:
25 22 GRBBRBRBBGGBRGBBGGBRBB RBRBBBRBBGBBRBRGBRGRGG GRGBGRGBGGBBBGBRGBGBRB GRBBRBGBGBRGGGGGRGBGGR BRBRRRRGBRBGRGGBBBGRRB GRRBBGBGGRGBRRGBGGGRBG GRBGBGRGRBRBGBGGBRGRBR RRRBBBRBBRRBRBBGBBRGRB GGBRGRGRBBRRRGRBBGRRGB BGBGGBGRRBRRRRBGRRBRRR BRBBBRGGBGBRRBBGGGGGRB GBGRGGGGRGRBBBRBRGBGGG GRRGRGBRGGRBGGGBRR...
output:
W
result:
ok single line: 'W'
Test #46:
score: 0
Accepted
time: 522ms
memory: 21600kb
input:
25 22 BBGGBBBBRGBGGRBRGRRRRG BBRGGBGGBGGBRRGBRBRRRB BGBGBGRBBBRRGBGBBBRBBB BBBGBBGRGGBRGBBRRBBGRG GRRRBRBGBGBGRBBRRGBGGR GRRBRRRRRBRRGBGGRGBGGB GGBGGBGRRRRGGGBRGRGGBB BBGGBGRBRBGBGRGGGRRBGG BGBBGBRGRBGRBBRGRGBGBR BGBGRRGBGGGBBGBBGRRBGB RRRBBBBBGGGGGBGGBRBRRB GGGBBRRBGRBGBBBBGBRBRR GGBGRRRRRRBRRBGRGB...
output:
L
result:
ok single line: 'L'
Test #47:
score: 0
Accepted
time: 502ms
memory: 21896kb
input:
25 22 RGRRBRBBRRRRBRGGRBRBBR RBBRRRGGRBBBRGGRGBRRGR BGBGGGBGGRGBGRRRBRBRGR BGBBGGGBGGBBRRRGRRBGGB GBRGBRBRRRBBGRBRBRGBRR GRGGRGBBRGBRGRRBBRBBRG GRBRGBBRRGRBBRGRRGRBBB RBGGRBRBRRRBRRBBBRRGBR GBGGBRRBGGGGGRBRBGGGGG RBGRBBBRRGGGBBBBRRGBRG BBBBRRRGRRBGBGGBBRBGBR GRRBGGRGGRRRRBBBBRBGRG GGGGRRRBRRBRRBRGRR...
output:
W
result:
ok single line: 'W'
Test #48:
score: 0
Accepted
time: 679ms
memory: 21636kb
input:
24 25 BRRGRGRGGGRRBGRGGGGBGBGGG RGBRGGGGBGGGGRBBBBBRGGRGB GRRRBBBGRBRRBRGRGRGGGRBRR GRBRRBBRGBBBBGRBBBRGBRGRB RBRRRBGGGRRBBGBRBGRRBGBRG GRRRBGBBBRGGGGRGRGGBGGBBB BBBRRBRBRBGGRGBBGGRBGRBGG RRBGRGRBRRGGRRRBBGBGRGGBG RGBBBRBGRBGRRGRGBRRGGGGGB BBRGRBGGGGRGGBRRRGGGGBBBR GBRRGGGRRGGBGRRRBRBBBGRRG GGRGBGGG...
output:
L
result:
ok single line: 'L'
Test #49:
score: 0
Accepted
time: 710ms
memory: 21760kb
input:
24 25 BRRRBBRRBGGRBBRGBBBRBGBGG RGRBGGGRRGGBBBRRRRBGGBRRR RRBGBBGRRGRBGRGGBRRBRBBRB RRGGGGGBBGBRRBBGGRBBBGBGG GRBGGBBBGBBBRBRGGGBRBGBBG RRBBBBRGGRGRRGBRRRRBRBRBB GRRRGRGGRGBBRGRBBGBRRBGRG RRBGGRBRRRRBBGBRGRRGGGBBB GGBRRGBBBRBBGRRGRBRGGGRGR BRGBRGRGBBRRBRBRRGRGGRGRR RBGBGGGBGGBRGRRRRRGRGGRBB RGGGRRRR...
output:
W
result:
ok single line: 'W'
Test #50:
score: 0
Accepted
time: 701ms
memory: 21724kb
input:
24 25 BRBRBGGGGGGBBGGBRGRGGGBGG RRBRGRGBRRGBGRBRGBBGGRRGR RRRGGRRBRBGGRGGRRGGBRGRBR GRBGBBRGGBRRGGGRRGRGGBBBG GGBRRBRRRGRRRRBGBGGBBGGGG RRRGRBGGBGGGBRBGGBRGBRRRR RBGBBBBBBRGRBRRGBGBRGBGGR BRRGRGGRGRGBBRBRBGRGBRRRG BRGBRBGGBBGBRGBRRBGRBGRBB BRBRBGRRGGBGBBGRGBRBGRGRG GGRGGBRRBBGRRRRBRBGBBBBGR RBRRBGGR...
output:
L
result:
ok single line: 'L'
Test #51:
score: 0
Accepted
time: 664ms
memory: 21644kb
input:
24 25 BGRBGBRBBBBGBBRGGBGBRRBBB BGBGGRBRBRBGRGRRRBBGRBBRG BBRGGRRBBBRBGRGGRBBBBGGGB BGBRRGGGGBBRGGRBGBBGGBGGG RRRBGGGGBRGRGRRGRBGBBRGBG GGGBBRGBBGBGGRRRGBRRGGBRR GRGRBBBBGBBBBRBGBRRGGGBBB RRRBGGBGBBBGRGRRRGGGRBGBG BBBGGRGRBGGBBGGGBGGRRBBBG GBGRRRBGRGBRBRBGRGBBGBRGB RGGRBRRRRBGGRBGBBBBRBBGBB GGBGGBRR...
output:
W
result:
ok single line: 'W'
Test #52:
score: 0
Accepted
time: 760ms
memory: 21576kb
input:
25 25 BGBGBGBRBBBRBBRBGBBBRGBRG RGGRBRBBGBGRRGGGBRBRBGGGR RBGRGRGBRGGRBRGRRRBBGBGRR GBRBGGGBBRGBBRRBRGBRRGBGG BGBGRBGRBRRGGRRGBBGBGRRGG RGRBRRRRBGRRRBRRRGRBBRGBB GGBRRBGRGBRBRBRBGBGRBGBGG RBRBBBGGBRBRBRBRBBGRRRBRB RRGGRRRRBRBGRRBRBBGRBRBBR BGGRBGBGBBGRGGRGRBRGBGRRR RRBGGRBRGGGGBGRGGRBRRRBRG BRRBGRRB...
output:
L
result:
ok single line: 'L'
Test #53:
score: 0
Accepted
time: 778ms
memory: 21584kb
input:
25 25 BGGBBRBGGRBGRGRGGRRRBRRRG RRGBBRRGBBRGRBRGRGGBGBBRB BRBGBGGRRBBGBBRRRBRRRGBGG RRBGRRGBBBRGGGBRRBRBRGGBG RBGBBRRBBRGGGBGGRBRGBRBBR RGRRRBGRBGGGBBBGRRRBRBGRB GBRRRGGRGBRBRGGRRGBBRGGGB GRGBGGRGBBGBGGBGRBGBRRRBB RRBBRBGGBRRBGRRBGBGBGRGRG RRBGGGBBGRBRRBBRBGRRGRRGG BRBBRGGRRRBRBRBRGBBBRGGGG RGRGBGBR...
output:
W
result:
ok single line: 'W'
Test #54:
score: 0
Accepted
time: 740ms
memory: 21620kb
input:
25 25 RGGRBGRRRGRGRRBBBRRRRRRBR GRBRBBGGBRBBRGGRBGRBBBGRB RRRRGGRBRRGBGBGRBBBBGGRBR RGBBBGGGRBBRBGRRGRGRGRGGB BBRBGGGBBGBGRGBRRRGGRBRRR GGBBGRBRBBBGGGRGGGBRRBRBG BRGGRGGBGRGRBBBRBGGBGRGBR GRBGGRRBBRRGBBRRBRRBGRRBR RRBGRGBGRBGGGBBRRRBGBRRBG GGRBGBRBGRRGGGBBBBRGBRRRR BBRGRBRRBBRRBBRGGRBRBBRRB BGRRRRGB...
output:
L
result:
ok single line: 'L'
Test #55:
score: 0
Accepted
time: 779ms
memory: 21612kb
input:
25 25 BGBRGRGBBRRBRGRGRBBRGBGBG BGBGRBGGBBBGGRGRRRBBRBRGR GGGGBRGRBGBGBGGRRRGBBBBRG GGRBGRBGRBRBBGGGGRBGRGGBR RGBBGGBBRGGBRBBGGBGRRGRRB RBBGBGRRGBBBGRRGRBBBGRBGG RRRRGGGGRBGRRGBGGRBRBBRRB BRGRRBBBBBBGRGBRGGRRBBGRG BBRRGGGGBBGBBGBBBGBRBBRGG GBGGGGGBRGGBRGRBGRBRRGRRB RBGRRGBRRGBGGBGRGRGBRBGBR RGGGRBBG...
output:
W
result:
ok single line: 'W'