結果

問題 No.1932 動く点 P / Moving Point P
ユーザー RhoRho
提出日時 2020-03-23 12:59:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,071 bytes
コンパイル時間 907 ms
コンパイル使用メモリ 76,476 KB
実行使用メモリ 9,928 KB
最終ジャッジ日時 2023-09-20 01:34:40
合計ジャッジ時間 20,115 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2,419 ms
9,876 KB
testcase_02 AC 478 ms
9,928 KB
testcase_03 AC 1,149 ms
4,380 KB
testcase_04 AC 3,352 ms
5,448 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target ("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<iostream>
#include<cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define MRE assert(0);
constexpr int inf = 1e9;
constexpr double pi = 3.1415926535897932;
constexpr int mod = 998244353;
double M[100006][3][3];
signed main() {
	cin.tie(0); ios::sync_with_stdio(false);
	int n; cin >> n;
	rep(i, n) {
		double p, q, theta; cin >> p >> q >> theta;
		theta = theta*pi / 180.0;
		M[i][0][0] = cos(theta);
		M[i][0][1] = -sin(theta);
		M[i][0][2] = q*sin(theta) - p*cos(theta) + p;
		M[i][1][0] = sin(theta);
		M[i][1][1] = cos(theta);
		M[i][1][2] = -p*sin(theta) - q*cos(theta) + q;
	}
	int q; cin >> q;
	rep(j, q) {
		int s, t; double x, y; cin >> s >> t >> x >> y;
		double nx, ny;
		for (int i = s - 1; i < t; i++) {
			nx = M[i][0][0] * x + M[i][0][1] * y + M[i][0][2];
			ny = M[i][1][0] * x + M[i][1][1] * y + M[i][1][2];
			x = nx; y = ny;
		}
		printf("%.13lf %.13lf\n", x,y);
	}
}
0