結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 3 ms
6,676 KB
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 3 ms
6,676 KB
testcase_13 WA -
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 1,070 ms
6,676 KB
testcase_16 AC 1,054 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 720 ms
6,676 KB
testcase_24 AC 326 ms
6,676 KB
testcase_25 AC 2 ms
6,676 KB
testcase_26 AC 891 ms
6,676 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 AC 129 ms
6,676 KB
testcase_29 AC 315 ms
6,676 KB
testcase_30 AC 182 ms
6,676 KB
testcase_31 AC 759 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){
	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[ok]==vec[i]+m)ans++;
}

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