結果

問題 No.864 四方演算
ユーザー niuezniuez
提出日時 2019-08-16 21:38:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 476 bytes
コンパイル時間 1,451 ms
コンパイル使用メモリ 166,788 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-23 21:58:10
合計ジャッジ時間 2,765 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

int main() {
  i64 N, K;
  cin >> N >> K;
  i64 ans = 0;
  for(i64 i = 1;i * i <= K;i++) {
    if(K % i == 0) {
      i64 j = K / i;
      i64 ni = min(i - 1, N - 1);
      i64 nj = min(j - 1, N - 1);
      ans += ni * nj;
      if(K / i != i) ans += ni * nj;
    }
  }

  cout << ans << endl;
}
0