結果

問題 No.1137 Circles
ユーザー phsplsphspls
提出日時 2020-08-01 20:47:53
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 673 bytes
コンパイル時間 1,427 ms
コンパイル使用メモリ 148,748 KB
実行使用メモリ 5,120 KB
最終ジャッジ日時 2023-09-22 15:39:16
合計ジャッジ時間 4,014 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
5,000 KB
testcase_01 AC 21 ms
5,096 KB
testcase_02 AC 3 ms
5,040 KB
testcase_03 AC 12 ms
5,036 KB
testcase_04 AC 15 ms
4,988 KB
testcase_05 AC 5 ms
5,048 KB
testcase_06 WA -
testcase_07 AC 10 ms
5,044 KB
testcase_08 AC 18 ms
5,036 KB
testcase_09 WA -
testcase_10 AC 11 ms
5,000 KB
testcase_11 AC 11 ms
5,024 KB
testcase_12 AC 22 ms
5,040 KB
testcase_13 AC 8 ms
5,044 KB
testcase_14 AC 22 ms
5,028 KB
testcase_15 AC 9 ms
4,976 KB
testcase_16 WA -
testcase_17 AC 5 ms
5,000 KB
testcase_18 WA -
testcase_19 AC 9 ms
5,016 KB
testcase_20 AC 6 ms
5,020 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).ok();
    let n: usize = n.trim().parse().unwrap();

    let mut result: Vec<isize> = vec![0; 4 * 1e5 as usize + 2];
    for _ in 0..n {
        let mut xr = String::new();
        std::io::stdin().read_line(&mut xr).ok();
        let xr: Vec<isize> = xr.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();
        let x = (xr[0] + 2 * 1e5 as isize) as usize;
        let r = xr[1] as usize;
        result[x-r] += 1;
        result[x+r+1] -= 1;
    }

    for i in 0..result.len()-1 {
        result[i+1] += result[i];
    }
    println!("{}", result.iter().max().unwrap());
}
0