結果
問題 |
No.864 四方演算
|
ユーザー |
|
提出日時 | 2019-08-28 02:51:35 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 442 bytes |
コンパイル時間 | 2,417 ms |
コンパイル使用メモリ | 191,772 KB |
最終ジャッジ日時 | 2025-01-07 15:25:29 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 WA * 24 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int64_t N, K; cin >> N >> K; int64_t ans = 0; for (int i = 1; 1LL * i * i <= K; ++i) { int j = K / i; if (1LL * i * j != K) continue; auto calc = [&](int64_t q) -> int64_t { if (q <= N) return q - 1; if (q < 2 * N + 1) return N - (q - N) + 1; return 0; }; ans += 1LL * calc(i) * calc(j); } cout << ans * 2 << endl; return 0; }