結果

問題 No.2517 Right Triangles on Circle
ユーザー seiyoseiyo
提出日時 2023-10-27 22:22:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 671 bytes
コンパイル時間 1,890 ms
コンパイル使用メモリ 202,308 KB
実行使用メモリ 13,776 KB
最終ジャッジ日時 2023-10-27 22:22:19
合計ジャッジ時間 6,477 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
long long M;
double PI =acos(-1);
cin >> N >> M;
int A[N];
double Px[N];
double Py[N];
for(int i=0;i<N;i++){
  cin >> A[i];
  Px[i]=cos(2*PI*A[i]/M);
  Py[i]=sin(2*PI*A[i]/M);
}
long long ans=0;
for(int i=0;i<N;i++){
  for(int j=i+1;j<N;j++){
    for(int k=j+1;k<N;k++){
    long long  a = (Px[i]-Px[j])*(Px[i]-Px[j])+(Py[i]-Py[j])*(Py[i]-Py[j]);
    long long b = (Px[j]-Px[k])*(Px[j]-Px[k])+(Py[j]-Py[k])*(Py[j]-Py[k]);
    long long  c = (Px[i]-Px[k])*(Px[i]-Px[k])+(Py[i]-Py[k])*(Py[i]-Py[k]);
      if(a + b == c || a + c == b || b + c == a){
        ans++;
      }
    }
  }

}
cout << ans <<endl;
}
0