結果

問題 No.2517 Right Triangles on Circle
ユーザー 乾麺乾麺
提出日時 2024-04-04 22:24:30
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,018 bytes
コンパイル時間 5,308 ms
コンパイル使用メモリ 310,144 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-04 22:24:49
合計ジャッジ時間 17,793 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
6,676 KB
testcase_02 WA -
testcase_03 AC 2 ms
6,676 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 WA -
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 1,076 ms
6,676 KB
testcase_16 AC 1,068 ms
6,676 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 754 ms
6,676 KB
testcase_24 AC 330 ms
6,676 KB
testcase_25 AC 2 ms
6,676 KB
testcase_26 AC 905 ms
6,676 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 AC 130 ms
6,676 KB
testcase_29 AC 318 ms
6,676 KB
testcase_30 AC 184 ms
6,676 KB
testcase_31 AC 774 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;i++)
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
using si =vector<char>;
using ssi =vector<si>;
//using mint = modint998244353;
const long long INF = 1e18;
//bit全探索 rep(i,0,1<<(n-1)){rep(j,0,n-1)if(I&(1<<j))}
//int a = s[0] - ‘0’;文字列から数字
//int a=atoi(s.c_str());
//“ABCDEFGHIJKLMNOPQRSTUVWXYZ"
//ll l-=-1,r=2e9;
//while (r - l > 1) {
//    ll m = (l + r) / 2;
//    (m * (m + 1) / 2 <= n + 1 ? l : r) = m;
//  }
//printf("%.9f\n", ans);
int main() { int n,m;
cin>>n>>m;
if(m%2==1){cout<<0;}
else{
m/=2;
vi vec(n);
rep(i,0,n)cin>>vec[i];
sort(vec.begin(),vec.end());
int ans=0;
rep(i,0,n-1){
	int ng=i,ok=n-1;
	while(abs(ok-ng)>1){
		int l=(ok+ng)/2;
		if(vec[l]>vec[i]+m)ok=l;
		else ng=l;
	}
	if(vec[ng]==vec[i]+m)ans++;
}

cout<<ans*(n-2);
	
}
}
0