Started on ABC 50
This commit is contained in:
17
atcoder/beginner_contests/abc050/src/bin/b.rs
Normal file
17
atcoder/beginner_contests/abc050/src/bin/b.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use proconio::input;
|
||||
|
||||
fn main() {
|
||||
input! {
|
||||
n: usize,
|
||||
ts: [i32; n],
|
||||
m: usize,
|
||||
pxs: [(i32, i32); m],
|
||||
};
|
||||
|
||||
let max_time: i32 = ts.iter().sum();
|
||||
|
||||
for (p, x) in pxs {
|
||||
let time_saved = ts[p as usize - 1] - x;
|
||||
println!("{}", max_time - time_saved);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user