結果
| 問題 |
No.3180 angles sum
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2025-06-20 13:28:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 722 bytes |
| コンパイル時間 | 518 ms |
| コンパイル使用メモリ | 60,416 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-06-20 13:28:25 |
| 合計ジャッジ時間 | 5,878 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 14 WA * 3 |
コンパイルメッセージ
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-9;
/* 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;
}
tnakao0123