結果

問題 No.1137 Circles
ユーザー phsplsphspls
提出日時 2020-08-01 21:11:38
言語 Rust
(1.77.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 671 bytes
コンパイル時間 2,543 ms
コンパイル使用メモリ 147,032 KB
実行使用メモリ 5,092 KB
最終ジャッジ日時 2023-09-22 16:18:27
合計ジャッジ時間 4,188 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,092 KB
testcase_01 AC 22 ms
5,024 KB
testcase_02 AC 3 ms
5,068 KB
testcase_03 AC 12 ms
4,988 KB
testcase_04 AC 17 ms
4,976 KB
testcase_05 AC 5 ms
4,952 KB
testcase_06 AC 17 ms
5,008 KB
testcase_07 AC 10 ms
4,988 KB
testcase_08 AC 19 ms
5,044 KB
testcase_09 AC 7 ms
4,972 KB
testcase_10 AC 11 ms
5,036 KB
testcase_11 AC 13 ms
5,024 KB
testcase_12 AC 24 ms
5,052 KB
testcase_13 AC 8 ms
4,972 KB
testcase_14 AC 23 ms
4,888 KB
testcase_15 AC 10 ms
5,056 KB
testcase_16 AC 12 ms
5,044 KB
testcase_17 AC 4 ms
4,972 KB
testcase_18 AC 20 ms
5,060 KB
testcase_19 AC 9 ms
5,080 KB
testcase_20 AC 7 ms
4,956 KB
testcase_21 AC 4 ms
4,972 KB
権限があれば一括ダウンロードができます

ソースコード

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;
    }

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