結果
問題 | No.1500 Super Knight |
ユーザー | wolgnik |
提出日時 | 2021-05-07 21:51:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 1,512 bytes |
コンパイル時間 | 329 ms |
コンパイル使用メモリ | 82,412 KB |
実行使用メモリ | 61,312 KB |
最終ジャッジ日時 | 2024-09-15 09:43:46 |
合計ジャッジ時間 | 2,719 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 42 ms
58,112 KB |
testcase_01 | AC | 38 ms
51,840 KB |
testcase_02 | AC | 39 ms
52,352 KB |
testcase_03 | AC | 39 ms
52,224 KB |
testcase_04 | AC | 41 ms
52,096 KB |
testcase_05 | AC | 39 ms
52,224 KB |
testcase_06 | AC | 40 ms
52,352 KB |
testcase_07 | AC | 42 ms
52,096 KB |
testcase_08 | AC | 40 ms
52,096 KB |
testcase_09 | AC | 40 ms
52,352 KB |
testcase_10 | AC | 40 ms
52,096 KB |
testcase_11 | AC | 39 ms
52,352 KB |
testcase_12 | AC | 39 ms
52,096 KB |
testcase_13 | AC | 40 ms
52,224 KB |
testcase_14 | AC | 40 ms
52,336 KB |
testcase_15 | AC | 39 ms
51,840 KB |
testcase_16 | AC | 40 ms
51,840 KB |
testcase_17 | AC | 39 ms
51,840 KB |
testcase_18 | AC | 39 ms
52,096 KB |
testcase_19 | AC | 40 ms
52,480 KB |
testcase_20 | AC | 51 ms
61,312 KB |
testcase_21 | AC | 40 ms
52,352 KB |
testcase_22 | AC | 40 ms
52,096 KB |
testcase_23 | AC | 38 ms
52,352 KB |
testcase_24 | AC | 40 ms
52,224 KB |
testcase_25 | AC | 41 ms
52,224 KB |
testcase_26 | AC | 45 ms
58,496 KB |
testcase_27 | AC | 41 ms
51,968 KB |
testcase_28 | AC | 46 ms
58,752 KB |
testcase_29 | AC | 39 ms
52,224 KB |
testcase_30 | AC | 39 ms
52,096 KB |
testcase_31 | AC | 39 ms
51,840 KB |
testcase_32 | AC | 39 ms
52,480 KB |
testcase_33 | AC | 39 ms
52,352 KB |
testcase_34 | AC | 40 ms
52,480 KB |
ソースコード
import sys input = sys.stdin.readline N = int(input()) mod = 10 ** 9 + 7 if N <= 5: size = 49 table = [["."] * size for _ in range(size)] a, b = size // 2, size // 2 table[a][b] = "#" #for t in table: print("".join(t)) for _ in range(N): newtable = [["."] * size for _ in range(size)] for i in range(size): for j in range(size): if table[i][j] == "#": if i + 3 < size: newtable[i + 3][j] = "#" if i + 3 < size and j + 2 < size: newtable[i + 3][j + 2] = "#" if i + 2 < size and j + 3 < size: newtable[i + 2][j + 3] = "#" if j + 3 < size: newtable[i][j + 3] = "#" if 0 <= i - 3 < size and j + 2 < size: newtable[i - 3][j + 2] = "#" if 0 <= i - 2 < size and j + 3 < size: newtable[i - 2][j + 3] = "#" if 0 <=i - 3 < size: newtable[i - 3][j] = "#" if 0 <=i - 3 < size and 0 <= j - 2 < size: newtable[i - 3][j - 2] = "#" if 0 <=i - 2 < size and 0 <=j - 3 < size: newtable[i - 2][j - 3] = "#" if 0 <=j - 3 < size: newtable[i][j - 3] = "#" if i + 3 < size and 0 <=j - 2 < size: newtable[i + 3][j - 2] = "#" if i + 2 < size and 0 <=j - 3 < size: newtable[i + 2][j - 3] = "#" #print("") #for t in newtable: print("".join(t)) table = newtable res = 0 for t in table: res += t.count("#") print(res) else: res = 0 hi = 2 * N + 1 lo = 3 * N res += (lo + hi) * N res += (3 * N + 1) * (2 * N + 1) + (3 * N) * (2 * N) res %= mod print(res)