結果
| 問題 | No.2517 Right Triangles on Circle |
| コンテスト | |
| ユーザー |
MasKoaTS
|
| 提出日時 | 2023-08-26 14:34:52 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 700 bytes |
| 記録 | |
| コンパイル時間 | 1,760 ms |
| コンパイル使用メモリ | 33,024 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2024-12-30 03:44:39 |
| 合計ジャッジ時間 | 34,425 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 TLE * 11 |
ソースコード
//愚直解
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <stdio.h>
#define MAX_DATA 300000
#define ll long long
int main(void) {
int n, m;
scanf("%d", &n); scanf("%d", &m);
int a[MAX_DATA];
for(int i = 0; i < n; ++i){
scanf("%d", &a[i]);
}
if(m & 1){
puts("0");
return 0;
}
int cnt = 0;
int h = m / 2;
for(int i = 0; i < n - 1; ++i){
for(int j = i + 1; j < n; ++j){
int x = a[i] - a[j];
if(x == h || x == -h){
++cnt;
}
}
}
ll ans = (ll)cnt * (n - 2);
printf("%lld\n", ans);
return 0;
}
MasKoaTS