結果

問題 No.471 直列回転機
コンテスト
ユーザー 37zigen
提出日時 2016-12-27 14:45:03
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 547 ms / 3,141 ms
コード長 739 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,117 ms
コンパイル使用メモリ 87,484 KB
実行使用メモリ 80,484 KB
平均クエリ数 19588.39
最終ジャッジ日時 2026-03-04 12:14:32
合計ジャッジ時間 24,310 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 58
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package yukicoder;

import java.util.*;

public class Q471 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int M = sc.nextInt();
		int[] x = new int[M];
		int[] y = new int[M];
		for (int i = 0; i < M; ++i) {
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
		}
		System.out.println("? 0 0");
		int dx = sc.nextInt();
		int dy = sc.nextInt();
		System.out.println("? 1 0");
		int cos = sc.nextInt() - dx;
		int sin = sc.nextInt() - dy;
		System.out.println("!");
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < M; ++i) {
			int nx = cos * x[i] - sin * y[i] + dx;
			int ny = sin * x[i] + cos * y[i] + dy;
			sb.append(nx + " " + ny + "\n");
		}
		System.out.println(sb.toString());
	}
}
0