結果
| 問題 |
No.864 四方演算
|
| ユーザー |
rieaaddlreiuu
|
| 提出日時 | 2022-11-10 10:13:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 572 bytes |
| コンパイル時間 | 1,798 ms |
| コンパイル使用メモリ | 167,512 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 13:09:37 |
| 合計ジャッジ時間 | 2,903 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 1 WA * 26 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
long max(long a,long b){
if(a<b){
return b;
}
return a;
}
long min(long a,long b){
if(a>b){
return b;
}
return a;
}
long count(long N,long x){
return max(0,min(N,x-1)-max(x-N,1)+1);
}
int main(){
long N,K;
scanf("%ld %ld",&N,&K);
long c = 0;
for(long i=1;i*i<=K;i++){
if(K%i == 0) continue;
if(K/i != i){
c += 2*count(N,K/i)*count(N,i);
} else {
c += count(N,K/i)*count(N,i);
}
}
printf("%ld",c);
}
rieaaddlreiuu