結果
| 問題 | No.2517 Right Triangles on Circle |
| コンテスト | |
| ユーザー |
MasKoaTS
|
| 提出日時 | 2023-08-26 17:01:26 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 155 ms / 2,000 ms |
| コード長 | 534 bytes |
| 記録 | |
| コンパイル時間 | 1,233 ms |
| コンパイル使用メモリ | 214,308 KB |
| 実行使用メモリ | 15,536 KB |
| 最終ジャッジ日時 | 2026-07-02 07:26:50 |
| 合計ジャッジ時間 | 5,422 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
int n, m; cin >> n >> m;
unordered_set<int> a = {};
for(int i = 0; i < n; ++i){
int x; cin >> x;
a.insert(x);
}
if(m & 1){
cout << 0 << endl;
return 0;
}
ll ans = 0;
for(auto itr = a.begin(); itr != a.end(); ++itr){
int x = (*itr) + m / 2;
if(a.find(x) == a.end()){
continue;
}
ans += n - 2;
}
cout << ans << endl;
return 0;
}
MasKoaTS