提出 #7926890


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define INF 0x3f3f3f3f3f3f3f3f
#define MOD 1000000007
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
const double pi = acos(-1.0);

int n;
int l;

pair<double,double> twoT2P(int twoT){
  double v = pi*twoT/l;
  return make_pair(cos(v),sin(v));
}
int t[3010];

int main(){
  cin>>n>>l;
  rep(i,0,n){
    scanf("%d",t+i);
  }
  double cntX=0;
  double cntY=0;
  rep(i,0,n){
    rep(j,i+1,n){
      pair<double,double> ret = twoT2P(t[i]+t[j]);
      cntX+=(n-2*(j-i))*ret.first;
      cntY+=(n-2*(j-i))*ret.second;
    }
  }
  // cnt / 3 / C(n,3) = 2*cnt/n/(n-1)/(n-2)

  printf("%.15lf %.15lf\n",6*cntX/n/(n-1)/(n-2),6*cntY/n/(n-1)/(n-2));
  return 0;
}

提出情報

提出日時
問題 D - Incenters
ユーザ cromarmot
言語 C++14 (GCC 5.4.1)
得点 1000
コード長 780 Byte
結果 AC
実行時間 345 ms
メモリ 256 KiB

コンパイルエラー

./Main.cpp: In function ‘int main()’:
./Main.cpp:24:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",t+i);
                    ^

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 1000 / 1000
結果
AC × 3
AC × 27
セット名 テストケース
Sample s1.txt, s2.txt, s3.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, s1.txt, s2.txt, s3.txt
ケース名 結果 実行時間 メモリ
01.txt AC 322 ms 256 KiB
02.txt AC 319 ms 256 KiB
03.txt AC 312 ms 256 KiB
04.txt AC 314 ms 256 KiB
05.txt AC 306 ms 256 KiB
06.txt AC 302 ms 256 KiB
07.txt AC 309 ms 256 KiB
08.txt AC 318 ms 256 KiB
09.txt AC 321 ms 256 KiB
10.txt AC 320 ms 256 KiB
11.txt AC 318 ms 256 KiB
12.txt AC 318 ms 256 KiB
13.txt AC 298 ms 256 KiB
14.txt AC 296 ms 256 KiB
15.txt AC 251 ms 256 KiB
16.txt AC 240 ms 256 KiB
17.txt AC 247 ms 256 KiB
18.txt AC 245 ms 256 KiB
19.txt AC 160 ms 256 KiB
20.txt AC 159 ms 256 KiB
21.txt AC 342 ms 256 KiB
22.txt AC 345 ms 256 KiB
23.txt AC 1 ms 256 KiB
24.txt AC 1 ms 256 KiB
s1.txt AC 1 ms 256 KiB
s2.txt AC 1 ms 256 KiB
s3.txt AC 1 ms 256 KiB