Skip to content

Commit

Permalink
Add atcoder/abc377/a.rs atcoder/abc377/b.rs atcoder/abc377/remain.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
koba-e964 committed Oct 29, 2024
1 parent 67a1fa2 commit 1ee960f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
11 changes: 11 additions & 0 deletions atcoder/abc377/a.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fn getline() -> String {
let mut ret = String::new();
std::io::stdin().read_line(&mut ret).ok().unwrap();
ret
}

fn main() {
let mut s = getline().trim().bytes().collect::<Vec<_>>();
s.sort();
println!("{}", if s == b"ABC" { "Yes" } else { "No" });
}
34 changes: 34 additions & 0 deletions atcoder/abc377/b.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
fn getline() -> String {
let mut ret = String::new();
std::io::stdin().read_line(&mut ret).ok().unwrap();
ret
}

fn main() {
let mut b = vec![vec![]; 8];
for i in 0..8 {
let s = getline().chars().collect::<Vec<_>>();
b[i] = s;
}
let mut ans = 0;
for i in 0..8 {
for j in 0..8 {
if b[i][j] == '#' {
for a in 0..8 {
if b[a][j] != '#' {
b[a][j] = 'x';
}
}
for a in 0..8 {
if b[i][a] != '#' {
b[i][a] = 'x';
}
}
}
}
}
for i in 0..8 {
ans += b[i].iter().filter(|&&c| c == '.').count();
}
println!("{}", ans);
}
5 changes: 5 additions & 0 deletions atcoder/abc377/remain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
c
d
e
f
g

0 comments on commit 1ee960f

Please sign in to comment.