QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#759962#5077. Card Gamegugugaga#AC ✓144ms6284kbC++204.8kb2024-11-18 13:39:382024-11-18 13:39:39

Judging History

你现在查看的是最新测评结果

  • [2024-11-18 13:39:39]
  • 评测
  • 测评结果:AC
  • 用时:144ms
  • 内存:6284kb
  • [2024-11-18 13:39:38]
  • 提交

answer

/*************************************
*    author: marvinthang             *
*    created: 18.11.2024 12:07:03    *
*************************************/

#include <bits/stdc++.h>

using namespace std;

#define             fi  first
#define             se  second
#define           left  ___left___
#define          right  ___right___
#define   scan_op(...)  istream & operator >> (istream &in, __VA_ARGS__ &u)
#define  print_op(...)  ostream & operator << (ostream &out, const __VA_ARGS__ &u)
#define     file(name)  if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
#ifdef LOCAL
	#include "debug.h"
#else
	#define DB(...)
	#define db(...) ""
	#define debug(...)
#endif

namespace std {
template <class U, class V> scan_op(pair <U, V>) { return in >> u.first >> u.second; }
template <class T> scan_op(vector <T>) { for (size_t i = 0; i < u.size(); ++i) in >> u[i]; return in; }
template <class U, class V> print_op(pair <U, V>) { return out << '(' << u.first << ", " << u.second << ')'; }
template <size_t i, class T> ostream &print_tuple_utils(ostream &out, const T &tup) { if constexpr(i == tuple_size<T>::value) return out << ")"; else return print_tuple_utils<i + 1, T>(out << (i ? ", " : "(") << get<i>(tup), tup); }
template <class...U> print_op(tuple <U...>) { return print_tuple_utils<0, tuple <U...>>(out, u); }
template <class Con, class = decltype(begin(declval<Con>()))>typename enable_if <!is_same<Con, string>::value, ostream &>::type operator << (ostream &out, const Con &con) { out << '{'; for (__typeof(con.begin()) it = con.begin(); it != con.end(); ++it) out << (it == con.begin() ? "" : ", ") << *it; return out << '}'; }
template <class T> print_op(stack <T>) { vector <T> v; stack <T> st = u; while (!st.empty()) v.push_back(st.top()), st.pop(); reverse(v.begin(), v.end()); return out << v; }
template <class T> print_op(queue <T>) { queue <T> q = u; out << '{'; while (!q.empty()) { out << q.front(); q.pop(); if (!q.empty()) out << ", "; } out << '}'; return out; }
template <class T, class X, class Y> print_op(priority_queue <T, X, Y>) { priority_queue <T, X, Y> pq = u; out << '{'; while (!pq.empty()) { out << pq.top(); pq.pop(); if (!pq.empty()) out << ", "; } out << '}'; return out; }
template <class Fun> class y_combinator_result { Fun fun_; public: template <class T> explicit y_combinator_result(T &&fun): fun_(forward<T>(fun)) {} template <class...Args> decltype(auto)operator()(Args &&...args) { return fun_(ref(*this), forward<Args>(args)...); } };
template <class Fun> decltype(auto)y_combinator(Fun &&fun) { return y_combinator_result<decay_t<Fun>>(forward<Fun>(fun)); }
template <typename T, int D> struct Vec: public vector <Vec<T, D - 1>> { static_assert(D >= 1, "Vector dimension must be greater than zero!"); template <typename ...Args> Vec(int n = 0, Args ...args): vector <Vec<T, D - 1>>(n, Vec<T, D - 1>(args...)) {} };
template <typename T> struct Vec<T, 1>: public vector<T>{ Vec(int n = 0, const T &val = T()): vector<T>(n, val) {} };
#if __cplusplus < 202002L
	template <class T> int ssize(const T &a) { return a.size(); }
#endif
}

void process(void) {
	int n, m;
	cin >> n >> m;
	Vec<char, 2> a(n, m);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> a[i][j];
		}
	}
	int k = n + m + 1 >> 1;
	Vec<char, 2> b(k, k, '#'), c(k, k, '#');
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			if ((i + j) & 1) {
				b[i + j >> 1][i - j + m >> 1] = a[i][j];
			} else {
				c[i + j >> 1][i - j + m >> 1] = a[i][j];
			}
		}
	}

	auto solve = [&](const Vec<char, 2>& b) {
		Vec<int, 4> f(k + 1, k + 1, k + 1, k + 1, -1);
		auto dp = y_combinator([&](auto dp, int x, int y, int u, int v) -> int {
			if (x >= u || y >= v) return 0;
			if (f[x][y][u][v] != -1) return f[x][y][u][v];
			int sz = (u - x) * (v - y);
			vector<int> value(sz + 1);
			for (int i = x; i < u; i++) {
				for (int j = y; j < v; j++) {
					if (b[i][j] == '#') continue;
					if (b[i][j] == 'B') {
						int a = dp(x, y, u, j);
						int b = dp(x, j + 1, u, v);
						if ((a ^ b) <= sz) value[a ^ b] = 1;
					} else if (b[i][j] == 'R') {
						int a = dp(x, y, i, v);
						int b = dp(i + 1, y, u, v);
						if ((a ^ b) <= sz) value[a ^ b] = 1;
					} else {
						int a = dp(x, y, i, j);
						int b = dp(x, j + 1, i, v);
						int c = dp(i + 1, y, u, j);
						int d = dp(i + 1, j + 1, u, v);
						if ((a ^ b ^ c ^ d) <= sz) value[a ^ b ^ c ^ d] = 1;
					}
				}
			}	
			int mex = 0;
			while (value[mex] > 0) ++mex;
			return f[x][y][u][v] = mex;
		});

		return dp(0, 0, k, k);
	};
	cout << ((solve(b) ^ solve(c)) ? "W" : "L");
	
}

int main(void) {
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	file("test");
	// int t; cin >> t; while (t--)
	process();
	return (0^0);
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3576kb

input:

1 3
BBB


output:

W

result:

ok single line: 'W'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

2 3
BBG
RGR


output:

W

result:

ok single line: 'W'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

2 2
GG
GG


output:

L

result:

ok single line: 'L'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

1 10
RRRRRRRRRR

output:

L

result:

ok single line: 'L'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

1 11
BBBBBBBBBBB

output:

W

result:

ok single line: 'W'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3540kb

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: 3516kb

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: 1ms
memory: 3728kb

input:

2 20
BBGGBGBGGBBGGBGGBGGG
GGBBBGBGBBBGBGGGGGGG

output:

L

result:

ok single line: 'L'

Test #9:

score: 0
Accepted
time: 1ms
memory: 3680kb

input:

2 20
GBGBGBBBGGGGGBGGBBBB
GGGBBBGBGBGBGGBGBGGB

output:

W

result:

ok single line: 'W'

Test #10:

score: 0
Accepted
time: 1ms
memory: 3668kb

input:

2 21
GBBBBBBGGBGGBBBGBGGBG
GBBBGBBBGBBBGGBGBBGBB

output:

L

result:

ok single line: 'L'

Test #11:

score: 0
Accepted
time: 1ms
memory: 3800kb

input:

2 21
GGGBBBGBBGBGGBBGGGBGG
BGBBGBBBBBBGBBBBGGGBB

output:

W

result:

ok single line: 'W'

Test #12:

score: 0
Accepted
time: 1ms
memory: 3780kb

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: 1ms
memory: 3748kb

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: 1ms
memory: 4024kb

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: 1ms
memory: 3788kb

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: 1ms
memory: 3680kb

input:

2 20
BRRBBBBRBBBBBBBRBBBB
RBRRRBRBBBBRRRBBBRRR

output:

L

result:

ok single line: 'L'

Test #17:

score: 0
Accepted
time: 1ms
memory: 3756kb

input:

2 20
BRBBBBBRRRBBRBRBRRBB
BBBBRBRRRBBRRRRRBBBB

output:

W

result:

ok single line: 'W'

Test #18:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

2 21
BBRRRRRBRBRRBRBBRBRBR
RBBRBBRRRRRBRBBBRRBBB

output:

L

result:

ok single line: 'L'

Test #19:

score: 0
Accepted
time: 1ms
memory: 3976kb

input:

2 21
RBBBRBBBBBBBRRRRRRRBB
BRRRRRBRBBRBBBBRBRBRR

output:

W

result:

ok single line: 'W'

Test #20:

score: 0
Accepted
time: 1ms
memory: 3752kb

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: 1ms
memory: 3724kb

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: 1ms
memory: 3768kb

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: 1ms
memory: 3732kb

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: 1ms
memory: 3892kb

input:

3 24
GGRGGGRGRGGRRGGGRRGRRGGR
RGRRGGGGRGRGGGGGRRRRGGGG
GRRGGRRRGGGGRRGRGGGGRRGG

output:

L

result:

ok single line: 'L'

Test #25:

score: 0
Accepted
time: 0ms
memory: 3888kb

input:

3 24
GGGRGRGGRGRGRGGRGGGRRRRR
RRRRGGRGRGGGRRGRGRRRGRRR
GGRGGRGRRRRGGGGGGRGRGRRR

output:

W

result:

ok single line: 'W'

Test #26:

score: 0
Accepted
time: 2ms
memory: 3892kb

input:

3 25
RRRRRGRRGGRRRRRRGRGGRRRGG
GGGGRGRGGRRRRRGRGRGRGRRRR
RGGRRRRRGGGGGRRRGGGGGGGRG

output:

L

result:

ok single line: 'L'

Test #27:

score: 0
Accepted
time: 1ms
memory: 3972kb

input:

3 25
RRGRGRRGRGRGGRGGRRGGRRRGG
RGRRGRRGRGGGGGRGGRRRGGGGG
RRGGRRGRGGGGGRGRGRRRRGRRG

output:

W

result:

ok single line: 'W'

Test #28:

score: 0
Accepted
time: 1ms
memory: 4112kb

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: 1ms
memory: 3844kb

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: 2ms
memory: 3888kb

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: 2ms
memory: 3964kb

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: 0ms
memory: 3896kb

input:

3 24
RRRBBRBBBBBBBBBBBBBBRBRR
BRBRRBBRBRBRRBBRRBRBBBBB
RRBRBBBRBBBRBRBBBBBBBBRB

output:

L

result:

ok single line: 'L'

Test #33:

score: 0
Accepted
time: 3ms
memory: 3960kb

input:

3 24
BRBRRBBRBRRBRRRBBBRBRRBB
BRBBRBBBBBRBRRRBRRRRRBBR
BRBRBBRRRBRBRRBBBBRRBRRB

output:

W

result:

ok single line: 'W'

Test #34:

score: 0
Accepted
time: 2ms
memory: 3892kb

input:

3 25
BBRRBBBBBBBRBBBRBRBRBRBBB
RRRBBBBRRRRBRRRRRBBBBRBRB
RRRRRBRRBRRBRBRRRBBRRBRRR

output:

L

result:

ok single line: 'L'

Test #35:

score: 0
Accepted
time: 2ms
memory: 3896kb

input:

3 25
BBRBBBBBRBBBBBRRRRRRBBRRB
RRRBBRRRBBRBBBRRRBBBBBRBR
BBRBRRRBRBBRRRRRRRRBBRRRB

output:

W

result:

ok single line: 'W'

Test #36:

score: 0
Accepted
time: 2ms
memory: 3968kb

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: 0ms
memory: 3892kb

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: 2ms
memory: 3836kb

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: 2ms
memory: 3948kb

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: 79ms
memory: 5288kb

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: 67ms
memory: 5536kb

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: 74ms
memory: 5196kb

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: 58ms
memory: 5308kb

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: 94ms
memory: 5740kb

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: 115ms
memory: 5784kb

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: 89ms
memory: 5784kb

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: 101ms
memory: 5764kb

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: 132ms
memory: 5940kb

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: 123ms
memory: 6172kb

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: 126ms
memory: 6036kb

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: 126ms
memory: 6284kb

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: 140ms
memory: 6040kb

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: 136ms
memory: 6060kb

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: 131ms
memory: 6060kb

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: 144ms
memory: 5944kb

input:

25 25
BGBRGRGBBRRBRGRGRBBRGBGBG
BGBGRBGGBBBGGRGRRRBBRBRGR
GGGGBRGRBGBGBGGRRRGBBBBRG
GGRBGRBGRBRBBGGGGRBGRGGBR
RGBBGGBBRGGBRBBGGBGRRGRRB
RBBGBGRRGBBBGRRGRBBBGRBGG
RRRRGGGGRBGRRGBGGRBRBBRRB
BRGRRBBBBBBGRGBRGGRRBBGRG
BBRRGGGGBBGBBGBBBGBRBBRGG
GBGGGGGBRGGBRGRBGRBRRGRRB
RBGRRGBRRGBGGBGRGRGBRBGBR
RGGGRBBG...

output:

W

result:

ok single line: 'W'