結果

問題 No.3180 angles sum
ユーザー tnakao0123
提出日時 2025-06-20 13:54:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 723 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 60,288 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-20 13:54:50
合計ジャッジ時間 4,278 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 16 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:26:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   26 |   scanf("%d", &tn);
      |   ~~~~~^~~~~~~~~~~
main.cpp:30:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   30 |     scanf("%lf%lf%lf%lf%lf%lf", &ax, &ay, &bx, &by, &cx, &cy);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 3180.cc:  No.3180 angles sum - yukicoder
 */

#include<cstdio>
#include<cmath>
#include<algorithm>

using namespace std;

/* constant */

const double DELTA = 1e-12;

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  int tn;
  scanf("%d", &tn);

  while (tn--) {
    double ax, ay, bx, by, cx, cy;
    scanf("%lf%lf%lf%lf%lf%lf", &ax, &ay, &bx, &by, &cx, &cy);

    double tha = atan2(ay, ax);
    double thb = atan2(by, bx);
    double thc = atan2(cy, cx);
    double d = abs(tha + thb - thc);
    //printf(" a+b=%.12lf, c=%.12lf, d=%.12lf\n", tha + thb, thc, d);

    if (abs(tha + thb - thc) < DELTA) puts("Yes");
    else puts("No");
  }

  return 0;
}
0