結果

問題 No.471 直列回転機
ユーザー kuuso1kuuso1
提出日時 2016-12-21 00:43:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 324 ms / 3,141 ms
コード長 1,664 bytes
コンパイル時間 3,880 ms
コンパイル使用メモリ 103,240 KB
実行使用メモリ 46,700 KB
平均クエリ数 19588.39
最終ジャッジ日時 2023-09-02 03:40:19
合計ジャッジ時間 18,054 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
37,280 KB
testcase_01 AC 85 ms
37,456 KB
testcase_02 AC 86 ms
38,892 KB
testcase_03 AC 85 ms
34,828 KB
testcase_04 AC 85 ms
39,160 KB
testcase_05 AC 89 ms
37,072 KB
testcase_06 AC 89 ms
39,508 KB
testcase_07 AC 89 ms
37,520 KB
testcase_08 AC 113 ms
37,180 KB
testcase_09 AC 120 ms
37,364 KB
testcase_10 AC 104 ms
35,372 KB
testcase_11 AC 186 ms
44,348 KB
testcase_12 AC 273 ms
42,424 KB
testcase_13 AC 271 ms
44,020 KB
testcase_14 AC 291 ms
46,548 KB
testcase_15 AC 324 ms
46,672 KB
testcase_16 AC 87 ms
35,336 KB
testcase_17 AC 84 ms
37,428 KB
testcase_18 AC 86 ms
39,516 KB
testcase_19 AC 85 ms
36,840 KB
testcase_20 AC 291 ms
45,080 KB
testcase_21 AC 150 ms
39,128 KB
testcase_22 AC 279 ms
44,208 KB
testcase_23 AC 255 ms
45,876 KB
testcase_24 AC 197 ms
44,480 KB
testcase_25 AC 134 ms
39,384 KB
testcase_26 AC 282 ms
44,564 KB
testcase_27 AC 194 ms
42,812 KB
testcase_28 AC 204 ms
45,136 KB
testcase_29 AC 228 ms
45,440 KB
testcase_30 AC 158 ms
41,912 KB
testcase_31 AC 295 ms
46,700 KB
testcase_32 AC 261 ms
42,248 KB
testcase_33 AC 214 ms
45,540 KB
testcase_34 AC 288 ms
44,112 KB
testcase_35 AC 146 ms
38,892 KB
testcase_36 AC 179 ms
42,676 KB
testcase_37 AC 114 ms
39,224 KB
testcase_38 AC 138 ms
38,852 KB
testcase_39 AC 181 ms
41,564 KB
testcase_40 AC 241 ms
43,364 KB
testcase_41 AC 293 ms
44,932 KB
testcase_42 AC 226 ms
45,252 KB
testcase_43 AC 272 ms
43,892 KB
testcase_44 AC 118 ms
37,016 KB
testcase_45 AC 216 ms
45,048 KB
testcase_46 AC 243 ms
45,828 KB
testcase_47 AC 272 ms
46,412 KB
testcase_48 AC 252 ms
46,204 KB
testcase_49 AC 240 ms
46,028 KB
testcase_50 AC 290 ms
44,664 KB
testcase_51 AC 179 ms
40,340 KB
testcase_52 AC 90 ms
39,400 KB
testcase_53 AC 90 ms
39,140 KB
testcase_54 AC 90 ms
36,936 KB
testcase_55 AC 151 ms
36,988 KB
testcase_56 AC 149 ms
39,568 KB
testcase_57 AC 128 ms
37,488 KB
testcase_58 AC 105 ms
37,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;


class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int M = ri();
		Complex[] C = new Complex[M];
		
		int[] d;
		
		for(int i=0;i<M;i++){
			d = ria();
			C[i] = new Complex(d[0],d[1]);
		}
		
		var x = new Complex(1,0);
		Console.WriteLine("? 1 0");
		Console.Out.Flush();
		d = ria();
		var alpha = new Complex(d[0],d[1]);
		
		var y = new Complex(0,1);
		Console.WriteLine("? 0 1");
		Console.Out.Flush();
		d = ria();
		var beta = new Complex(d[0],d[1]);
		
		
		var phi = (alpha - beta) / (x - y);
		var psi = alpha - phi * x;
		
		var sb = new StringBuilder();
		sb.AppendLine("!");
		for(int i=0;i<M;i++){
			var z = phi * C[i] + psi;
			int re = (int) z.Real;
			int im = (int) z.Imaginary;
			sb.AppendLine(String.Format("{0} {1}",re,im));
		}
		
		Console.Write(sb.ToString());
		Console.Out.Flush();
	}

	public Sol(){
		
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}
0