Skip to content

Commit

Permalink
abc296 a, b, c
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Apr 1, 2023
1 parent 68697fb commit 52cb734
Show file tree
Hide file tree
Showing 11 changed files with 300 additions and 0 deletions.
161 changes: 161 additions & 0 deletions abc296/Cargo.lock

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

14 changes: 14 additions & 0 deletions abc296/Cargo.toml
@@ -0,0 +1,14 @@
[package]
name = "abc296"
version = "0.1.0"
edition = "2018"

# dependencies added to new project
[dependencies]
num = "=0.2.1"
proconio = { version = "=0.3.6", features = ["derive"] }
superslice = "=1.0.0"

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

fn main() {
input! {
n: usize,
s: Chars,
};

let mut ok = true;
let mut m = 'M';
for c in s.iter().copied() {
if c != m {
ok = false;
break;
}
m = if m == 'M' { 'F' } else { 'M' };
}
if ok {
println!("Yes");
return;
}

let mut ok = true;
let mut m = 'F';
for c in s.iter().copied() {
if c != m {
ok = false;
break;
}
m = if m == 'M' { 'F' } else { 'M' };
}
if ok {
println!("Yes");
return;
}

println!("No");
}
17 changes: 17 additions & 0 deletions abc296/src/bin/b.rs
@@ -0,0 +1,17 @@
use proconio::{input, marker::Chars};

fn main() {
input! {
s: [Chars; 8],
};

for i in 0..8 {
let n = 8 - i;
for j in 0..8 {
let a = (b'a' + j as u8) as char;
if s[i][j] == '*' {
println!("{}{}", a, n);
}
}
}
}
19 changes: 19 additions & 0 deletions abc296/src/bin/c.rs
@@ -0,0 +1,19 @@
use std::collections::HashSet;

use proconio::input;

fn main() {
input! {
n: usize,
x: i64,
a: [i64; n],
};
let set = a.iter().copied().collect::<HashSet<_>>();
for a_i in a {
if set.contains(&(a_i + x)) {
println!("Yes");
return;
}
}
println!("No");
}
10 changes: 10 additions & 0 deletions abc296/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 abc296/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 abc296/src/bin/ex.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 abc296/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 abc296/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 52cb734

Please sign in to comment.