結果

問題 No.2797 Square Tile
ユーザー AwashAmityOakAwashAmityOak
提出日時 2024-06-28 22:25:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 78,848 KB
最終ジャッジ日時 2024-06-28 22:25:26
合計ジャッジ時間 3,455 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
51,840 KB
testcase_01 AC 31 ms
51,840 KB
testcase_02 WA -
testcase_03 AC 34 ms
52,096 KB
testcase_04 AC 87 ms
78,848 KB
testcase_05 AC 79 ms
77,496 KB
testcase_06 AC 74 ms
77,056 KB
testcase_07 WA -
testcase_08 AC 71 ms
76,416 KB
testcase_09 AC 75 ms
77,176 KB
testcase_10 AC 76 ms
77,568 KB
testcase_11 AC 77 ms
76,780 KB
testcase_12 AC 106 ms
76,928 KB
testcase_13 WA -
testcase_14 AC 81 ms
77,060 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 78 ms
76,416 KB
testcase_18 WA -
testcase_19 AC 74 ms
77,184 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 67 ms
76,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(A, B):
	N = A*A + B*B
	ans_A = []
	ans_B = []
	for i in range(N):
		ans_A.append((A*i % N, i*B % N))
	for i in range(N):
		ans_B.append((A*(i+1) % N, i*B % N))
	return ans_A, ans_B

A, B = map(int, input().split())
N = A*A + B*B

if A < B:
	ans_B, ans_A = solve(B, A)
else:
	ans_A, ans_B = solve(A, B)

for i in range(N):
	print(*ans_A[i])
for i in range(N):
	print(*ans_B[i])
0