結果

問題 No.864 四方演算
ユーザー hakatashihakatashi
提出日時 2019-08-16 22:30:54
言語 Crystal
(1.11.2)
結果
WA  
実行時間 -
コード長 238 bytes
コンパイル時間 18,016 ms
コンパイル使用メモリ 263,380 KB
実行使用メモリ 4,848 KB
最終ジャッジ日時 2023-09-13 10:08:05
合計ジャッジ時間 19,430 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n = read_line.to_i64
k = read_line.to_i64
ret = 0_u64
2.upto(Math.sqrt(k).to_u64) do |i|
  if k % i == 0
    ret += [[i - 1, n].min - [1, i - n].max + 1, 0].max * [[k / i - 1, n].min - [1, k / i - n].max + 1, 0].max * 2
  end
end
puts ret
0