Skip to content

Commit

Permalink
abc345 a, b, c
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Mar 16, 2024
1 parent 6bd9e42 commit 320183a
Show file tree
Hide file tree
Showing 10 changed files with 268 additions and 0 deletions.
168 changes: 168 additions & 0 deletions cargo-atcoder-1.70.0/contests/abc345/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions cargo-atcoder-1.70.0/contests/abc345/Cargo.toml
@@ -0,0 +1,15 @@
[package]
name = "abc345"
version = "0.1.0"
edition = "2021"

# dependencies added to new project
[dependencies]
ac-library-rs = "=0.1.1"
num = "=0.4.0"
proconio = { version = "=0.4.3", features = ["derive"] }
superslice = "=1.0.0"

[profile.release]
lto = true
panic = 'abort'
1 change: 1 addition & 0 deletions cargo-atcoder-1.70.0/contests/abc345/rust-toolchain
@@ -0,0 +1 @@
1.70.0
12 changes: 12 additions & 0 deletions cargo-atcoder-1.70.0/contests/abc345/src/bin/a.rs
@@ -0,0 +1,12 @@
use proconio::{input, marker::Chars};

fn main() {
input! {
s: Chars,
};
let ans = s.len() >= 3
&& s.starts_with(&['<'])
&& s.ends_with(&['>'])
&& s.iter().skip(1).take(s.len() - 2).all(|&c| c == '=');
println!("{}", if ans { "Yes" } else { "No" });
}
10 changes: 10 additions & 0 deletions cargo-atcoder-1.70.0/contests/abc345/src/bin/b.rs
@@ -0,0 +1,10 @@
use num::Integer;
use proconio::input;

fn main() {
input! {
x: i64,
};
let ans = x.div_ceil(&10);
println!("{}", ans);
}
22 changes: 22 additions & 0 deletions cargo-atcoder-1.70.0/contests/abc345/src/bin/c.rs
@@ -0,0 +1,22 @@
use std::collections::HashMap;

use proconio::{input, marker::Chars};

fn main() {
input! {
s: Chars,
};
let mut same = false;
let mut sum = 0_usize;
let mut map = HashMap::new();
for (i, s_i) in s.iter().copied().rev().enumerate() {
if map.contains_key(&s_i) {
same = true;
}
let count = i - map.get(&s_i).unwrap_or(&0);
sum += count;
*map.entry(s_i).or_insert(0) += 1_usize;
}
let ans = sum + if same { 1 } else { 0 };
println!("{}", ans);
}
10 changes: 10 additions & 0 deletions cargo-atcoder-1.70.0/contests/abc345/src/bin/d.rs
@@ -0,0 +1,10 @@
use proconio::{input, marker::Usize1};

fn main() {
input! {
n: usize,
a: [Usize1; n],
};
let ans = n - a.len();
println!("{}", ans);
}
10 changes: 10 additions & 0 deletions cargo-atcoder-1.70.0/contests/abc345/src/bin/e.rs
@@ -0,0 +1,10 @@
use proconio::{input, marker::Usize1};

fn main() {
input! {
n: usize,
a: [Usize1; n],
};
let ans = n - a.len();
println!("{}", ans);
}
10 changes: 10 additions & 0 deletions cargo-atcoder-1.70.0/contests/abc345/src/bin/f.rs
@@ -0,0 +1,10 @@
use proconio::{input, marker::Usize1};

fn main() {
input! {
n: usize,
a: [Usize1; n],
};
let ans = n - a.len();
println!("{}", ans);
}
10 changes: 10 additions & 0 deletions cargo-atcoder-1.70.0/contests/abc345/src/bin/g.rs
@@ -0,0 +1,10 @@
use proconio::{input, marker::Usize1};

fn main() {
input! {
n: usize,
a: [Usize1; n],
};
let ans = n - a.len();
println!("{}", ans);
}

0 comments on commit 320183a

Please sign in to comment.