Skip to content

Commit

Permalink
Add atcoder/abc319/a.rs atcoder/abc319/remain.txt atcoder/abc325/a.rs…
Browse files Browse the repository at this point in the history
… atcoder/abc325/remain.txt atcoder/abc326/a.rs atcoder/abc326/remain.txt atcoder/abc332/a.rs atcoder/abc332/remain.txt atcoder/abc333/a.rs atcoder/abc333/remain.txt atcoder/abc334/a.rs atcoder/abc334/remain.txt atcoder/abc344/a.rs atcoder/abc344/remain.txt
  • Loading branch information
koba-e964 committed Apr 26, 2024
1 parent 63698ec commit 9efb913
Show file tree
Hide file tree
Showing 15 changed files with 240 additions and 0 deletions.
1 change: 1 addition & 0 deletions atcoder/abc318/remain.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ d
e
f
g
ex
26 changes: 26 additions & 0 deletions atcoder/abc319/a.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
fn getline() -> String {
let mut ret = String::new();
std::io::stdin().read_line(&mut ret).ok().unwrap();
ret
}

fn main() {
let top = [
("tourist", 3858),
("ksun48", 3679),
("Benq", 3658),
("Um_nik", 3648),
("apiad", 3638),
("Stonefeang", 3630),
("ecnerwala", 3613),
("mnbvmar", 3555),
("newbiedmy", 3516),
("semiexp", 3481),
];
let s = getline().trim().to_string();
for (a, b) in top {
if a == s {
println!("{}", b);
}
}
}
6 changes: 6 additions & 0 deletions atcoder/abc319/remain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
b
c
d
e
f
g
10 changes: 10 additions & 0 deletions atcoder/abc325/a.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fn getline() -> String {
let mut ret = String::new();
std::io::stdin().read_line(&mut ret).ok().unwrap();
ret
}

fn main() {
let s = getline();
println!("{} san", s.split(" ").next().unwrap());
}
6 changes: 6 additions & 0 deletions atcoder/abc325/remain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
b
c
d
e
f
g
30 changes: 30 additions & 0 deletions atcoder/abc326/a.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
use std::io::Read;

fn get_word() -> String {
let stdin = std::io::stdin();
let mut stdin=stdin.lock();
let mut u8b: [u8; 1] = [0];
loop {
let mut buf: Vec<u8> = Vec::with_capacity(16);
loop {
let res = stdin.read(&mut u8b);
if res.unwrap_or(0) == 0 || u8b[0] <= b' ' {
break;
} else {
buf.push(u8b[0]);
}
}
if buf.len() >= 1 {
let ret = String::from_utf8(buf).unwrap();
return ret;
}
}
}

fn get<T: std::str::FromStr>() -> T { get_word().parse().ok().unwrap() }

fn main() {
let x: i32 = get();
let y: i32 = get();
println!("{}", if y - x <= 2 && y - x >= -3 { "Yes" } else { "No" });
}
6 changes: 6 additions & 0 deletions atcoder/abc326/remain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
b
c
d
e
f
g
46 changes: 46 additions & 0 deletions atcoder/abc332/a.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
($($r:tt)*) => {
let stdin = std::io::stdin();
let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
let mut next = move || -> String{
bytes.by_ref().map(|r|r.unwrap() as char)
.skip_while(|c|c.is_whitespace())
.take_while(|c|!c.is_whitespace())
.collect()
};
input_inner!{next, $($r)*}
};
}

macro_rules! input_inner {
($next:expr) => {};
($next:expr,) => {};
($next:expr, $var:ident : $t:tt $($r:tt)*) => {
let $var = read_value!($next, $t);
input_inner!{$next $($r)*}
};
}

macro_rules! read_value {
($next:expr, ( $($t:tt),* )) => { ($(read_value!($next, $t)),*) };
($next:expr, [ $t:tt ; $len:expr ]) => {
(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
};
($next:expr, $t:ty) => ($next().parse::<$t>().expect("Parse error"));
}

fn main() {
input! {
n: i32, s: i32, k: i32,
pq: [(i32, i32); n],
}
let mut ans = 0;
for (p, q) in pq {
ans += p * q;
}
if ans < s {
ans += k;
}
println!("{}", ans);
}
6 changes: 6 additions & 0 deletions atcoder/abc332/remain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
b
c
d
e
f
g
32 changes: 32 additions & 0 deletions atcoder/abc333/a.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
use std::io::Read;

fn get_word() -> String {
let stdin = std::io::stdin();
let mut stdin=stdin.lock();
let mut u8b: [u8; 1] = [0];
loop {
let mut buf: Vec<u8> = Vec::with_capacity(16);
loop {
let res = stdin.read(&mut u8b);
if res.unwrap_or(0) == 0 || u8b[0] <= b' ' {
break;
} else {
buf.push(u8b[0]);
}
}
if buf.len() >= 1 {
let ret = String::from_utf8(buf).unwrap();
return ret;
}
}
}

fn get<T: std::str::FromStr>() -> T { get_word().parse().ok().unwrap() }

fn main() {
let n: i32 = get();
for _ in 0..n {
print!("{}", n);
}
println!();
}
6 changes: 6 additions & 0 deletions atcoder/abc333/remain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
b
c
d
e
f
g
30 changes: 30 additions & 0 deletions atcoder/abc334/a.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
use std::io::Read;

fn get_word() -> String {
let stdin = std::io::stdin();
let mut stdin=stdin.lock();
let mut u8b: [u8; 1] = [0];
loop {
let mut buf: Vec<u8> = Vec::with_capacity(16);
loop {
let res = stdin.read(&mut u8b);
if res.unwrap_or(0) == 0 || u8b[0] <= b' ' {
break;
} else {
buf.push(u8b[0]);
}
}
if buf.len() >= 1 {
let ret = String::from_utf8(buf).unwrap();
return ret;
}
}
}

fn get<T: std::str::FromStr>() -> T { get_word().parse().ok().unwrap() }

fn main() {
let b: i32 = get();
let g: i32 = get();
println!("{}", if b > g { "Bat" } else { "Glove" });
}
6 changes: 6 additions & 0 deletions atcoder/abc334/remain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
b
c
d
e
f
g
23 changes: 23 additions & 0 deletions atcoder/abc344/a.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
fn getline() -> String {
let mut ret = String::new();
std::io::stdin().read_line(&mut ret).ok().unwrap();
ret
}

fn main() {
let s = getline().trim().chars().collect::<Vec<_>>();
let n = s.len();
let mut bar = vec![];
for i in 0..n {
if s[i] == '|' {
bar.push(i);
}
}
for i in 0..bar[0] {
print!("{}", s[i]);
}
for i in bar[1] + 1..n {
print!("{}", s[i]);
}
println!();
}
6 changes: 6 additions & 0 deletions atcoder/abc344/remain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
b
c
d
e
f
g

0 comments on commit 9efb913

Please sign in to comment.