結果
問題 | No.781 円周上の格子点の数え上げ |
ユーザー | 👑 tatt61880 |
提出日時 | 2021-03-30 02:37:13 |
言語 | Kuin (KuinC++ v.2021.9.17) |
結果 |
AC
|
実行時間 | 197 ms / 2,000 ms |
コード長 | 549 bytes |
コンパイル時間 | 2,068 ms |
コンパイル使用メモリ | 152,412 KB |
実行使用メモリ | 160,368 KB |
最終ジャッジ日時 | 2023-10-14 18:10:40 |
合計ジャッジ時間 | 4,674 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,352 KB |
testcase_01 | AC | 2 ms
4,348 KB |
testcase_02 | AC | 2 ms
4,348 KB |
testcase_03 | AC | 2 ms
4,352 KB |
testcase_04 | AC | 2 ms
4,348 KB |
testcase_05 | AC | 2 ms
4,352 KB |
testcase_06 | AC | 2 ms
4,388 KB |
testcase_07 | AC | 2 ms
4,572 KB |
testcase_08 | AC | 162 ms
82,112 KB |
testcase_09 | AC | 151 ms
82,452 KB |
testcase_10 | AC | 2 ms
4,360 KB |
testcase_11 | AC | 3 ms
4,532 KB |
testcase_12 | AC | 176 ms
124,892 KB |
testcase_13 | AC | 197 ms
160,368 KB |
testcase_14 | AC | 7 ms
9,420 KB |
testcase_15 | AC | 3 ms
4,352 KB |
testcase_16 | AC | 2 ms
4,356 KB |
testcase_17 | AC | 110 ms
96,780 KB |
testcase_18 | AC | 85 ms
50,184 KB |
testcase_19 | AC | 86 ms
51,444 KB |
testcase_20 | AC | 87 ms
51,228 KB |
ソースコード
func main() var x: int :: cui@inputInt() var y: int :: cui@inputInt() var max: int :: y var a: []int :: #[max + 1]int var square: []int :: #[(y $ float ^ 0.51) $ int + 1]int var map: dict<int, bool> :: #dict<int, bool> for i(0, ^square - 1) do square[i] :: i ^ 2 do map.add(square[i], true) end for for i(0, ^square - 1) for j(1, ^square - 1) var sum: int :: square[i] + square[j] if(sum <= max) do a[sum] :+ 1 end if end for end for var ans: int :: a.sub(x, y - x + 1).max() * 4 do cui@print("\{ans}\n") end func