結果
問題 |
No.3180 angles sum
|
ユーザー |
![]() |
提出日時 | 2025-06-20 14:29:37 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 191 ms / 2,000 ms |
コード長 | 723 bytes |
コンパイル時間 | 504 ms |
コンパイル使用メモリ | 60,384 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-06-20 14:29:43 |
合計ジャッジ時間 | 5,062 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 17 |
コンパイルメッセージ
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); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
/* -*- coding: utf-8 -*- * * 3180.cc: No.3180 angles sum - yukicoder */ #include<cstdio> #include<cmath> #include<algorithm> using namespace std; /* constant */ const double DELTA = 1e-14; /* 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; }