結果

問題 No.864 四方演算
ユーザー le_panda_noirle_panda_noir
提出日時 2020-05-31 11:16:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 343 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 67,968 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-28 12:18:09
合計ジャッジ時間 1,759 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;
using ll = long long;
int main() {
  ll N, K; cin >> N >> K;
  ll ans = 0;
  for (ll i = 1; i * i <= K; ++i)
    if (K % i == 0) {
      ll ac = K / i, bd = i;
      ans += max(0LL, (min(N, ac-1) - max(ac-N, 1LL) + 1) * (min(N, bd-1) - max(bd-N, 1LL) + 1));
    }
  cout << ans*2 << endl;
  return 0;
}
0