結果

問題 No.1797 永遠のグリッド
ユーザー 👑 tatt61880tatt61880
提出日時 2023-03-14 11:27:43
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 763 bytes
コンパイル時間 4,745 ms
コンパイル使用メモリ 146,832 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 11:34:14
合計ジャッジ時間 6,725 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 3 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 10 ms
4,348 KB
testcase_18 AC 29 ms
4,348 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 32 ms
4,348 KB
testcase_21 AC 13 ms
4,348 KB
testcase_22 AC 5 ms
4,348 KB
testcase_23 AC 45 ms
4,348 KB
testcase_24 AC 8 ms
4,348 KB
testcase_25 AC 21 ms
4,348 KB
testcase_26 AC 65 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 12 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var h: int :: cui@inputInt()
	var w: int :: cui@inputInt()
	var k: int :: cui@inputInt()
	var ans: int :: 0
	for i(0, k ^ (h * w) - 1)
		var a: [][]int :: #[h, w]int
		for y(0, h - 1)
			for x(0, w - 1)
				do a[y][x] :: (i / k ^ (y * w + x)) % k
			end for
		end for
		
		; K色すべてを使っているかの調査
		for j(0, k - 1)
			for y(0, h - 1)
				for x(0, w - 1)
					if(a[y][x] = j)
						skip j
					end if
				end for
			end for
			skip i
		end for
		
		for dy(0, h - 1)
			for dx(0, w - 1)
				for y(0, h - 1)
					for x(0, w - 1)
						if(a[(y + dy) % h][(x + dx) % w] <> a[y][x])
							skip dx
						end if
					end for
				end for
				do ans :+ 1
			end for
		end for
	end for
	do ans :/ h * w
	do cui@print("\{ans}\n")
end func
0