結果

問題 No.105 arcの六角ボルト
コンテスト
ユーザー IL_msta
提出日時 2015-07-01 08:40:00
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 940 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 636 ms
コンパイル使用メモリ 106,704 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-29 12:47:01
合計ジャッジ時間 1,009 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
In file included from main.cpp:7:
In function 'constexpr long double std::atan2(long double, long double)',
    inlined from 'int main()' at main.cpp:48:17:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/cmath:162:28: warning: 'X0' may be used uninitialized [-Wmaybe-uninitialized]
  162 |   { return __builtin_atan2l(__y, __x); }
      |            ~~~~~~~~~~~~~~~~^~~~~~~~~~
main.cpp: In function 'int main()':
main.cpp:37:12: note: 'X0' was declared here
   37 |         LD X0,Y0;
      |            ^~
In function 'constexpr long double std::atan2(long double, long double)',
    inlined from 'int main()' at main.cpp:48:17:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/cmath:162:28: warning: 'Y0' may be used uninitialized [-Wmaybe-uninitialized]
  162 |   { return __builtin_atan2l(__y, __x); }
      |            ~~~~~~~~~~~~~~~~^~~~~~~~~~
main.cpp: In function 'int main()':
main.cpp:37:15: note: 'Y0' was declared here
   37 |         LD X0,Y0;
      |               ^~

ソースコード

diff #
raw source code

#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>

#include <algorithm>
#include <cmath>

#include <string>
#include <list>
#include <queue>
#include <vector>
#include <complex>
#include <set>

/////////
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) cout<<(p)<<endl;
/////////
typedef long long LL;
typedef long double LD;
/////////
using namespace::std;
/////////
LD ansLD[5000];
int main(void){
    std::cin.tie(0); 
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed;//
    cout << setprecision(7);//
    
    int T;
	cin>>T;

	LD X[6],Y[6];
	LD X0,Y0;
	LD s50 = 2.0*M_PI*50.0/360;
	for(int Loop=0;Loop<T;++Loop){
		rep(i,6){
			cin>>X[i]>>Y[i];
			if(0<=Y[i] && Y[i] <= sin(s50) &&
				cos(s50) <= X[i]){
				X0 = X[i];
				Y0 = Y[i];
			}
		}
		LD ans = atan2(Y0,X0);
		LD kk = 180/M_PI;
		ansLD[Loop] = ans*kk;
	}
	rep(i,T){
		P( ansLD[i] );
	}
    return 0;
}
0