Submission #15679723


Source Code Expand

Copy
use proconio::input;

fn main() {
    input! {
        n: usize,
        xy: [(i64, i64); n],
    };
    let mut max_d = 0;
    for &(x_i, y_i) in xy.iter() {
        for &(x_j, y_j) in xy.iter() {
            let d_x = x_j - x_i;
            let d_y = y_j - y_i;
            let d = d_x * d_x + d_y * d_y;
            max_d = std::cmp::max(max_d, d);
        }
    }
    let ans = (max_d as f64).sqrt();
    println!("{}", ans);
}

Submission Info

Submission Time
Task A - 2点間距離の最大値 ( The longest distance )
User bouzuya
Language Rust (1.42.0)
Score 100
Code Size 432 Byte
Status AC
Exec Time 6 ms
Memory 2192 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 26
Set Name Test Cases
All 00_max.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rnd_00.txt, 01_rnd_01.txt, 01_rnd_02.txt, 01_rnd_03.txt, 01_rnd_04.txt, 01_rnd_05.txt, 01_rnd_06.txt, 01_rnd_07.txt, 01_rnd_08.txt, 01_rnd_09.txt, 01_rnd_10.txt, 01_rnd_11.txt, 01_rnd_12.txt, 01_rnd_13.txt, 01_rnd_14.txt, 01_rnd_15.txt, 01_rnd_16.txt, 01_rnd_17.txt, 01_rnd_18.txt, 01_rnd_19.txt
Case Name Status Exec Time Memory
00_max.txt AC 6 ms 2132 KB
00_sample_01.txt AC 2 ms 2128 KB
00_sample_02.txt AC 2 ms 2048 KB
00_sample_03.txt AC 1 ms 2084 KB
00_sample_04.txt AC 1 ms 1980 KB
00_sample_05.txt AC 1 ms 2096 KB
01_rnd_00.txt AC 2 ms 1992 KB
01_rnd_01.txt AC 2 ms 2080 KB
01_rnd_02.txt AC 2 ms 2124 KB
01_rnd_03.txt AC 3 ms 1980 KB
01_rnd_04.txt AC 2 ms 1996 KB
01_rnd_05.txt AC 3 ms 2080 KB
01_rnd_06.txt AC 2 ms 2084 KB
01_rnd_07.txt AC 1 ms 2192 KB
01_rnd_08.txt AC 1 ms 1960 KB
01_rnd_09.txt AC 1 ms 2052 KB
01_rnd_10.txt AC 1 ms 1980 KB
01_rnd_11.txt AC 2 ms 2040 KB
01_rnd_12.txt AC 3 ms 2124 KB
01_rnd_13.txt AC 2 ms 2132 KB
01_rnd_14.txt AC 2 ms 2056 KB
01_rnd_15.txt AC 2 ms 2040 KB
01_rnd_16.txt AC 2 ms 2144 KB
01_rnd_17.txt AC 1 ms 2076 KB
01_rnd_18.txt AC 1 ms 2080 KB
01_rnd_19.txt AC 1 ms 1988 KB