結果

問題 No.471 直列回転機
ユーザー nebukuro09
提出日時 2016-12-25 16:26:21
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 356 ms / 3,141 ms
コード長 737 bytes
コンパイル時間 807 ms
コンパイル使用メモリ 118,272 KB
実行使用メモリ 25,464 KB
平均クエリ数 19588.39
最終ジャッジ日時 2024-06-12 06:05:18
合計ジャッジ時間 13,416 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 58
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop;


void main() {
    auto M = readln.chomp.to!int;
    auto P = M.iota.map!(_ => readln.split.map!(to!int).array).array;

    writeln("? 0 0");
    stdout.flush;
    auto dxdy = readln.split.map!(to!int).array;

    writeln("? 1 0");
    stdout.flush;
    auto C = readln.split.map!(to!int).array;

    auto cos = C[0] - dxdy[0];
    auto sin = C[1] - dxdy[1];

    writeln("!");
    foreach (p; P) {
        auto x = p[0] * cos - p[1] * sin + dxdy[0];
        auto y = p[0] * sin + p[1] * cos + dxdy[1];
        writeln(x, " ", y);
    }
    stdout.flush;
}
0