Started on ABC 50
This commit is contained in:
25
atcoder/beginner_contests/abc050/Cargo.lock
generated
Normal file
25
atcoder/beginner_contests/abc050/Cargo.lock
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "abc050"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"proconio",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lazy_static"
|
||||||
|
version = "1.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proconio"
|
||||||
|
version = "0.4.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "91c333be3af2936f8e810300bc74fe4d0cc168ebc04ab02a28c5b1060fa1bd59"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static",
|
||||||
|
]
|
||||||
12
atcoder/beginner_contests/abc050/Cargo.toml
Normal file
12
atcoder/beginner_contests/abc050/Cargo.toml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[package]
|
||||||
|
name = "abc050"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# dependencies added to new project
|
||||||
|
[dependencies]
|
||||||
|
proconio = "0.4.3"
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
lto = true
|
||||||
|
panic = 'abort'
|
||||||
19
atcoder/beginner_contests/abc050/src/bin/a.rs
Normal file
19
atcoder/beginner_contests/abc050/src/bin/a.rs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
use proconio::input;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
input! {
|
||||||
|
a: u32,
|
||||||
|
op: char,
|
||||||
|
b: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut result = a as i32;
|
||||||
|
|
||||||
|
match op {
|
||||||
|
'+' => result += b as i32,
|
||||||
|
'-' => result -= b as i32,
|
||||||
|
_ => unreachable!(),
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("{}", result);
|
||||||
|
}
|
||||||
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
3
atcoder/beginner_contests/abc050/src/bin/c.rs
Normal file
3
atcoder/beginner_contests/abc050/src/bin/c.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
unimplemented!();
|
||||||
|
}
|
||||||
3
atcoder/beginner_contests/abc050/src/bin/d.rs
Normal file
3
atcoder/beginner_contests/abc050/src/bin/d.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
unimplemented!();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user