結果
問題 |
No.864 四方演算
|
ユーザー |
![]() |
提出日時 | 2019-08-16 23:41:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 501 bytes |
コンパイル時間 | 722 ms |
コンパイル使用メモリ | 81,552 KB |
実行使用メモリ | 13,760 KB |
最終ジャッジ日時 | 2024-09-22 23:29:05 |
合計ジャッジ時間 | 3,142 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | WA * 1 TLE * 1 -- * 25 |
ソースコード
#include<iostream> #include<string> #include<queue> #include<algorithm> #include<map> #include<set> #include<vector> #include<math.h> using namespace std; #define INF 1000000007 #define LINF 1000000000000000007 typedef long long i64; typedef pair<i64,i64> P; i64 n, k; int main(){ cin >> n >> k; //(a+c)(b+d) i64 ans = 0; for(int i = 2; i*i <= k; i++){ if(k % i) continue; if(k/i > n*2) continue; ans += (i-1) * min(k/i-1, n*2 - k/i +1) * 2; } cout << ans << endl; return 0; }