Skip to content

Commit 39208de

Browse files
committed
Add examples for practice-A
1 parent b1d122f commit 39208de

File tree

5 files changed

+77
-0
lines changed

5 files changed

+77
-0
lines changed

examples/practice-a-naive.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// https://atcoder.jp/contests/practice/tasks/practice_1
2+
3+
use std::io::{self, Read as _};
4+
5+
fn main() {
6+
let mut input = "".to_owned();
7+
io::stdin().read_to_string(&mut input).unwrap();
8+
let mut input = input.split_whitespace();
9+
macro_rules! read(() => (input.next().unwrap().parse().unwrap()));
10+
11+
let (a, b, c, s): (u32, u32, u32, String) = (read!(), read!(), read!(), read!());
12+
13+
println!("{} {}", a + b + c, s);
14+
}

examples/practice-a-proconio.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// https://atcoder.jp/contests/practice/tasks/practice_1
2+
3+
use proconio::input;
4+
5+
fn main() {
6+
input! {
7+
a: u32,
8+
b: u32,
9+
c: u32,
10+
s: String,
11+
}
12+
13+
println!("{} {}", a + b + c, s);
14+
}

examples/practice-a-text-io.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// https://atcoder.jp/contests/practice/tasks/practice_1
2+
3+
use text_io::{read, try_read, try_scan};
4+
5+
#[allow(clippy::many_single_char_names, clippy::try_err)]
6+
fn main() {
7+
let (a, b, c, s): (u32, u32, u32, String) = (read!(), read!(), read!(), read!());
8+
9+
println!("{} {}", a + b + c, s);
10+
}

examples/practice-a-whiteread.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// https://atcoder.jp/contests/practice/tasks/practice_1
2+
3+
use whiteread::Reader;
4+
5+
fn main() {
6+
let mut rdr = Reader::from_stdin_naive();
7+
8+
let (a, b, c, s) = rdr.p::<(u32, u32, u32, String)>();
9+
10+
println!("{} {}", a + b + c, s);
11+
}

test-with-generated-opts.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,34 @@ url = "https://atcoder.jp/contests/atc002/tasks/atc002_b"
172172
matching = "Words"
173173
meta = { using = ["num"] }
174174

175+
[examples.practice-a-naive]
176+
name = "practice contest: A - Welcome to AtCoder"
177+
url = "https://atcoder.jp/contests/practice/tasks/practice_1"
178+
matching = "Exact"
179+
alt_testcases = [{ in = "1\n2 3\ntest", out = "6 test\n" }, { in = "72\n128 256\nmyonmyon", out = "456 myonmyon\n" }]
180+
meta = { using = [] } # 下3つと比較するため
181+
182+
[examples.practice-a-proconio]
183+
name = "practice contest: A - Welcome to AtCoder"
184+
url = "https://atcoder.jp/contests/practice/tasks/practice_1"
185+
matching = "Exact"
186+
alt_testcases = [{ in = "1\n2 3\ntest", out = "6 test\n" }, { in = "72\n128 256\nmyonmyon", out = "456 myonmyon\n" }]
187+
meta = { using = ["proconio"] }
188+
189+
[examples.practice-a-text-io]
190+
name = "practice contest: A - Welcome to AtCoder"
191+
url = "https://atcoder.jp/contests/practice/tasks/practice_1"
192+
matching = "Exact"
193+
alt_testcases = [{ in = "1\n2 3\ntest", out = "6 test\n" }, { in = "72\n128 256\nmyonmyon", out = "456 myonmyon\n" }]
194+
meta = { using = ["text-io"] }
195+
196+
[examples.practice-a-whiteread]
197+
name = "practice contest: A - Welcome to AtCoder"
198+
url = "https://atcoder.jp/contests/practice/tasks/practice_1"
199+
matching = "Exact"
200+
alt_testcases = [{ in = "1\n2 3\ntest", out = "6 test\n" }, { in = "72\n128 256\nmyonmyon", out = "456 myonmyon\n" }]
201+
meta = { using = ["whiteread"] }
202+
175203
[examples.sumitrust2019-c]
176204
name = "Sumitomo Mitsui Trust Bank Programming Contest 2019: C - 100 to 105"
177205
url = "https://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_c"

0 commit comments

Comments
 (0)