Submission #37691188


Source Code Expand

use proconio::{input, fastout};

#[fastout]
fn main() {
    input!{
        n: usize, k: usize,
        c: [[isize; 2]; n],
    }
    let mut vec = Vec::new();
    for i in 0..n {
        vec.push(c[i][1]);
        vec.push(c[i][0] - c[i][1]);
    }

    let mut answer = 0;
    vec.sort();
    vec.reverse();
    for i in 0..k {
        answer += vec[i];
    }

    println!("{}", answer);
}

Submission Info

Submission Time
Task 048 - I will not drop out(★3)
User cohsh
Language Rust (1.42.0)
Score 3
Code Size 393 Byte
Status AC
Exec Time 79 ms
Memory 21120 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 3 / 3
Status
AC × 3
AC × 18
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 10_small_random_01.txt, 10_small_random_02.txt, 10_small_random_03.txt, 10_small_random_04.txt, 10_small_random_05.txt, 10_small_random_06.txt, 10_small_random_07.txt, 10_small_random_08.txt, 10_small_random_09.txt, 50_large_random_01.txt, 50_large_random_02.txt, 70_same_01.txt, 70_unique_01.txt, 80_b_large_01.txt, 80_b_small_01.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 5 ms 2112 KiB
00_sample_02.txt AC 3 ms 2052 KiB
00_sample_03.txt AC 1 ms 2092 KiB
10_small_random_01.txt AC 2 ms 1972 KiB
10_small_random_02.txt AC 1 ms 2108 KiB
10_small_random_03.txt AC 1 ms 2108 KiB
10_small_random_04.txt AC 2 ms 2064 KiB
10_small_random_05.txt AC 1 ms 1972 KiB
10_small_random_06.txt AC 2 ms 2032 KiB
10_small_random_07.txt AC 2 ms 2068 KiB
10_small_random_08.txt AC 2 ms 2048 KiB
10_small_random_09.txt AC 1 ms 1972 KiB
50_large_random_01.txt AC 76 ms 21104 KiB
50_large_random_02.txt AC 79 ms 21108 KiB
70_same_01.txt AC 70 ms 21036 KiB
70_unique_01.txt AC 79 ms 21092 KiB
80_b_large_01.txt AC 72 ms 21044 KiB
80_b_small_01.txt AC 72 ms 21120 KiB