結果
| 問題 | 
                            No.760 Where am I moved to?
                             | 
                    
| コンテスト | |
| ユーザー | 
                             iicafiaxus
                         | 
                    
| 提出日時 | 2018-12-08 01:16:09 | 
| 言語 | D  (dmd 2.109.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,950 bytes | 
| コンパイル時間 | 2,772 ms | 
| コンパイル使用メモリ | 169,728 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-13 02:05:34 | 
| 合計ジャッジ時間 | 11,563 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 9 WA * 2 | 
ソースコード
import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
void main(){
	real xa = read.to!real;
	real ya = read.to!real;
	real tha = read.to!real;
	real x11 = read.to!real;
	real y11 = read.to!real;
	real x12 = read.to!real + 0.00001;
	real y12 = read.to!real + 0.00001; // ぴったり重なるのを防止
	real x21 = read.to!real;
	real y21 = read.to!real;
	real x22 = read.to!real;
	real y22 = read.to!real;
	
	// AがA'にうつるように平行移動すると、Bは…
	debug writeln("p = (", x21 - x11, ", ", y21 - y11, ")");
	real b1x = x12 + (x21 - x11);
	real b1y = y12 + (y21 - y11);
	debug writeln("B1(", b1x, ", ", b1y, ")");
	
	// これがB'にうつるように回転する回転角
	real ux = b1x - x21;
	real uy = b1y - y21;
	debug writeln("u = (", ux, ", ", uy, ")");
	real vx = x22 - x21;
	real vy = y22 - y21;
	debug writeln("v = (", vx, ", ", vy, ")");
	real c = (ux * vx + uy * vy) / sqrt(ux * ux + uy * uy) / sqrt(vx * vx + vy * vy);
	real s = (ux * vy - vx * uy) / sqrt(ux * ux + uy * uy) / sqrt(vx * vx + vy * vy);
	real th = (s >= 0? acos(c): 2.0 * PI - acos(c)) / 2.0 / PI * 360.0;
	debug writeln("th = ", th, " = (", c, ", ", s, ")");
	
	// これらの逆変換を船に施す
	real oux = xa - x21;
	real ouy = ya - y21;
	debug writeln("u = (", oux, ", ", ouy, ")");
	real ovx = c * oux + s * ouy;
	real ovy = -s * oux + c * ouy;
	debug writeln("v = (", ovx, ", ", ovy, ")");
	real o1x = x21 + ovx;
	real o1y = y21 + ovy;
	debug writeln("O1(", o1x, ", ", o1y, ")");
	real o2x = o1x - (x21 - x11);
	real o2y = o1y - (y21 - y11);
	debug writeln("O2(", o2x, ", ", o2y, ")");
	
	real th2 = tha - th;
	th2 += 360.0 + 360.0;
	while(th2 >= 360.0) th2 -= 360.0;
	
	writeln(o2x, " ", o2y, " ", th2);
	
}
            
            
            
        
            
iicafiaxus