ログインしてください。
提出 #47825065
ソースコード 拡げる
// -*- coding:utf-8-unix -*-
use ndarray::prelude::*;
use proconio::input;
fn main() {
input! {
(x1,y1,x2,y2): (f64, f64, f64, f64)
}
let rotation_matrix = arr2(&[[0_f64, -1_f64], [1_f64, 0_f64]]);
let dx = x2 - x1;
let dy = y2 - y1;
let d2 = rotation_matrix.dot(&arr2(&[[dx], [dy]]));
let d3 = rotation_matrix.dot(&d2);
let (x3, y3) = (x2 + d2[[0, 0]], y2 + d2[[1, 0]]);
let (x4, y4) = (x3 + d3[[0, 0]], y3 + d3[[1, 0]]);
println!("{} {} {} {}", x3, y3, x4, y4);
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Ruined Square |
| ユーザ | homura10059 |
| 言語 | Rust (rustc 1.70.0) |
| 得点 | 200 |
| コード長 | 538 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 2124 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | s1.txt, s2.txt, s3.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, s1.txt, s2.txt, s3.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01.txt | AC | 1 ms | 2008 KiB |
| 02.txt | AC | 1 ms | 2004 KiB |
| 03.txt | AC | 1 ms | 2048 KiB |
| 04.txt | AC | 0 ms | 1928 KiB |
| 05.txt | AC | 0 ms | 1936 KiB |
| 06.txt | AC | 0 ms | 2004 KiB |
| 07.txt | AC | 0 ms | 1936 KiB |
| 08.txt | AC | 1 ms | 2124 KiB |
| s1.txt | AC | 0 ms | 2000 KiB |
| s2.txt | AC | 1 ms | 2052 KiB |
| s3.txt | AC | 1 ms | 1964 KiB |