From d93da1a8664251e0867831b8aac5b73411927e67 Mon Sep 17 00:00:00 2001 From: yuhouqingshan1 <138858950+yuhouqingshan1@users.noreply.github.com> Date: Sun, 29 Dec 2024 10:29:34 +0800 Subject: [PATCH] 20241228 Create cf323a_huqingchang.py (#9169) --- .../personal_submission/cf323a_huqingchang.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 daily_problems/2024/12/1228/personal_submission/cf323a_huqingchang.py diff --git a/daily_problems/2024/12/1228/personal_submission/cf323a_huqingchang.py b/daily_problems/2024/12/1228/personal_submission/cf323a_huqingchang.py new file mode 100644 index 0000000000..3906eb5ca1 --- /dev/null +++ b/daily_problems/2024/12/1228/personal_submission/cf323a_huqingchang.py @@ -0,0 +1,32 @@ +def main(): + n = II() + if n & 1: + print(-1) + return + cur = 0 + for _ in range(n): + cur ^= 1 + g = [[''] * n for _ in range(n)] + # tmp = cur + for i in range(n // 2): + for j in range(n // 2): + tmp = cur + if (i + j) & 1: + tmp = cur ^ 1 + color = '' + if not tmp: + color = 'w' + else: + color = 'b' + for k in range(2 * i, 2 * i + 2): + for l in range(2 * j, 2 * j + 2): + g[k][l] = color + for r in g: + print(''.join(r)) + print() + + +T = 1 +for ii in range(T): + # print(main()) + main()