Submission #47824919


Source Code Expand

// -*- coding:utf-8-unix -*-

use ndarray::prelude::*;
use proconio::input;

fn main() {
    input! {
        (x1,y1,x2,y2): (f64, f64, f64, f64)
    }
    let r = 90_f64.to_radians();
    let rotation_matrix = arr2(&[[f64::cos(r), -f64::sin(r)], [f64::sin(r), f64::cos(r)]]);
    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);
}

Submission Info

Submission Time
Task B - Ruined Square
User homura10059
Language Rust (rustc 1.70.0)
Score 0
Code Size 596 Byte
Status WA
Exec Time 1 ms
Memory 2152 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 1
WA × 2
AC × 5
WA × 6
Set Name Test Cases
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
Case Name Status Exec Time Memory
01.txt WA 1 ms 1996 KiB
02.txt WA 1 ms 2004 KiB
03.txt AC 1 ms 1996 KiB
04.txt AC 1 ms 2004 KiB
05.txt WA 1 ms 1996 KiB
06.txt AC 1 ms 2016 KiB
07.txt AC 1 ms 2092 KiB
08.txt WA 1 ms 2052 KiB
s1.txt WA 1 ms 2004 KiB
s2.txt WA 1 ms 2152 KiB
s3.txt AC 1 ms 1940 KiB