Submission #1819201
Source Code Expand
import sys from collections import defaultdict, Counter from itertools import product, groupby, count, permutations, combinations from math import pi, sqrt, ceil, floor from collections import deque from bisect import bisect, bisect_left, bisect_right from string import ascii_lowercase from functools import lru_cache, reduce from operator import xor INF = float("inf") sys.setrecursionlimit(10**7) # 4近傍(右, 下, 左, 上) dy = [0, -1, 0, 1] dx = [1, 0, -1, 0] def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W def main(): H, W, d = map(int, input().split()) field = [[0] * W for _ in range(H)] # 市松模様 if d % 2 != 0: for y in range(H): for x in range(W): field[y][x] = (y + x) % 2 elif d % 4 == 2: for y in range(H): for x in range(W): field[y][x] = (y % 2 * 2) + (y // 2 + x // 2) % 2 else: for y in range(H): for x in range(W): ny = y + x + 1000 nx = y - x + 1000 field[y][x] = ny // d % 2 * 2 + nx // d % 2 if (y + x) % 2 == 1: field[y][x] ^= 3 c = "RGBY" for line in field: print("".join(c[x] for x in line)) if __name__ == '__main__': main()
Submission Info
Submission Time | |
---|---|
Task | D - Four Coloring |
User | MitI_7 |
Language | Python (3.4.3) |
Score | 700 |
Code Size | 1379 Byte |
Status | AC |
Exec Time | 184 ms |
Memory | 6124 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 700 / 700 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt |
All | 0_00.txt, 0_01.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 1_21.txt, 1_22.txt, 1_23.txt, 1_24.txt, 1_25.txt, 1_26.txt, 1_27.txt, 1_28.txt, 1_29.txt, 1_30.txt, 1_31.txt, 1_32.txt, 1_33.txt, 1_34.txt, 1_35.txt, 1_36.txt, 1_37.txt, 1_38.txt, 1_39.txt, 1_40.txt, 1_41.txt, 1_42.txt, 1_43.txt, 1_44.txt, 1_45.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 30 ms | 4072 KB |
0_01.txt | AC | 27 ms | 3944 KB |
1_00.txt | AC | 27 ms | 3948 KB |
1_01.txt | AC | 27 ms | 3948 KB |
1_02.txt | AC | 27 ms | 3944 KB |
1_03.txt | AC | 27 ms | 3944 KB |
1_04.txt | AC | 27 ms | 3944 KB |
1_05.txt | AC | 27 ms | 3948 KB |
1_06.txt | AC | 28 ms | 3944 KB |
1_07.txt | AC | 28 ms | 3952 KB |
1_08.txt | AC | 28 ms | 3948 KB |
1_09.txt | AC | 28 ms | 3948 KB |
1_10.txt | AC | 78 ms | 6124 KB |
1_11.txt | AC | 124 ms | 6124 KB |
1_12.txt | AC | 77 ms | 6120 KB |
1_13.txt | AC | 123 ms | 6120 KB |
1_14.txt | AC | 64 ms | 5480 KB |
1_15.txt | AC | 115 ms | 5868 KB |
1_16.txt | AC | 68 ms | 5608 KB |
1_17.txt | AC | 182 ms | 5868 KB |
1_18.txt | AC | 69 ms | 5744 KB |
1_19.txt | AC | 102 ms | 5608 KB |
1_20.txt | AC | 72 ms | 5872 KB |
1_21.txt | AC | 173 ms | 5736 KB |
1_22.txt | AC | 117 ms | 5096 KB |
1_23.txt | AC | 65 ms | 5480 KB |
1_24.txt | AC | 61 ms | 5356 KB |
1_25.txt | AC | 106 ms | 5616 KB |
1_26.txt | AC | 136 ms | 5360 KB |
1_27.txt | AC | 68 ms | 5608 KB |
1_28.txt | AC | 75 ms | 5872 KB |
1_29.txt | AC | 98 ms | 5484 KB |
1_30.txt | AC | 59 ms | 5224 KB |
1_31.txt | AC | 166 ms | 5736 KB |
1_32.txt | AC | 180 ms | 5992 KB |
1_33.txt | AC | 94 ms | 5352 KB |
1_34.txt | AC | 109 ms | 5744 KB |
1_35.txt | AC | 172 ms | 5992 KB |
1_36.txt | AC | 168 ms | 5864 KB |
1_37.txt | AC | 73 ms | 5868 KB |
1_38.txt | AC | 184 ms | 5996 KB |
1_39.txt | AC | 77 ms | 5996 KB |
1_40.txt | AC | 70 ms | 5736 KB |
1_41.txt | AC | 75 ms | 5872 KB |
1_42.txt | AC | 63 ms | 5484 KB |
1_43.txt | AC | 74 ms | 5996 KB |
1_44.txt | AC | 178 ms | 5864 KB |
1_45.txt | AC | 66 ms | 5616 KB |