Skip to content

Commit 2579231

Browse files
committed
'MacroTranscriber' can be (..)
1 parent e80232e commit 2579231

12 files changed

+63
-55
lines changed

examples/abc054-c.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ use std::io::{self, Read};
77
fn main() {
88
let mut input = read_to_static(io::stdin()).split_whitespace();
99
macro_rules! read {
10-
(_1based) => { read!(usize) - 1 };
11-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
12-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
13-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
14-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
10+
(_1based) => {
11+
read!(usize) - 1
12+
};
13+
([$tt:tt]) => (read!([$tt; read!(usize)]));
14+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
15+
(($($tt:tt),+)) => (($(read!($tt)),*));
16+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
1517
}
1618

1719
let n = read!(usize);

examples/abc057-b-naive.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use std::io::{self, Read};
55
fn main() {
66
let mut input = read_to_static(io::stdin()).split_whitespace();
77
macro_rules! read {
8-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
9-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
10-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
11-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
8+
([$tt:tt]) => (read!([$tt; read!(usize)]));
9+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
10+
(($($tt:tt),+)) => (($(read!($tt)),*));
11+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
1212
}
1313

1414
let (n, m) = read!((usize, usize));

examples/abc084-d.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use std::io::{self, BufWriter, Read, StdoutLock, Write as _};
88
fn main() {
99
let mut input = read_to_static(io::stdin()).split_whitespace();
1010
macro_rules! read {
11-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
12-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
13-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
14-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
11+
([$tt:tt]) => (read!([$tt; read!(usize)]));
12+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
13+
(($($tt:tt),+)) => (($(read!($tt)),*));
14+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
1515
}
1616

1717
let lrs = read!([(usize, usize)]);
@@ -24,7 +24,7 @@ fn main() {
2424
.collect::<Vec<u32>>();
2525

2626
buf_print(|stdout| {
27-
macro_rules! println { ($($tt:tt)*) => { writeln!(stdout, $($tt)*).unwrap() }; }
27+
macro_rules! println(($($tt:tt)*) => (writeln!(stdout, $($tt)*).unwrap()));
2828

2929
for (l, r) in lrs {
3030
println!("{}", nums[r] - nums[l - 1]);

examples/abc118-b-naive.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ use std::ops::{BitAnd, BitOr};
66
fn main() {
77
let mut input = read_to_static(io::stdin()).split_whitespace();
88
macro_rules! read {
9-
(_1based) => { read!(usize) - 1 };
10-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
11-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
12-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
13-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
9+
(_1based) => {
10+
read!(usize) - 1
11+
};
12+
([$tt:tt]) => (read!([$tt; read!(usize)]));
13+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
14+
(($($tt:tt),+)) => (($(read!($tt)),*));
15+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
1416
}
1517

1618
let (n, _) = read!((usize, usize));

examples/abc120-d.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ use std::io::{self, BufWriter, Read, StdoutLock, Write as _};
77
fn main() {
88
let mut input = read_to_static(io::stdin()).split_whitespace();
99
macro_rules! read {
10-
(_1based) => { read!(usize) - 1 };
11-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
12-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
13-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
14-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
10+
(_1based) => {
11+
read!(usize) - 1
12+
};
13+
([$tt:tt]) => (read!([$tt; read!(usize)]));
14+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
15+
(($($tt:tt),+)) => (($(read!($tt)),*));
16+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
1517
}
1618

1719
let n = read!(usize);
@@ -31,7 +33,7 @@ fn main() {
3133
assert_eq!(ans_rev.pop(), Some(0));
3234

3335
buf_print(|stdout| {
34-
macro_rules! println { ($($tt:tt)*) => { writeln!(stdout, $($tt)*).unwrap() }; }
36+
macro_rules! println(($($tt:tt)*) => (writeln!(stdout, $($tt)*).unwrap()));
3537

3638
for x in ans_rev.into_iter().rev() {
3739
println!("{}", x);

examples/abc121-b-naive.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use std::io::{self, Read};
66
fn main() {
77
let mut input = read_to_static(io::stdin()).split_whitespace();
88
macro_rules! read {
9-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
10-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
11-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
12-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
9+
([$tt:tt]) => (read!([$tt; read!(usize)]));
10+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
11+
(($($tt:tt),+)) => (($(read!($tt)),*));
12+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
1313
}
1414

1515
let (n, m, c) = read!((usize, usize, i32));

examples/abc150-d.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use std::io::{self, Read};
77
fn main() {
88
let mut input = read_to_static(io::stdin()).split_whitespace();
99
macro_rules! read {
10-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
11-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
12-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
13-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
10+
([$tt:tt]) => (read!([$tt; read!(usize)]));
11+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
12+
(($($tt:tt),+)) => (($(read!($tt)),*));
13+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
1414
}
1515

1616
let (n, m) = read!((usize, usize));

examples/abc151-d.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ fn main() {
2121
)
2222
.unwrap()
2323
};
24-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
25-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
26-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
27-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
24+
([$tt:tt]) => (read!([$tt; read!(usize)]));
25+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
26+
(($($tt:tt),+)) => (($(read!($tt)),*));
27+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
2828
}
2929

3030
let (h, w) = read!((usize, usize));

examples/apg4b-ex25.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use std::io::{self, Read};
99
fn main() {
1010
let mut input = read_to_static(io::stdin()).split_whitespace();
1111
macro_rules! read {
12-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
13-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
14-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
15-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
12+
([$tt:tt]) => (read!([$tt; read!(usize)]));
13+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
14+
(($($tt:tt),+)) => (($(read!($tt)),*));
15+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
1616
}
1717

1818
let a = read!([usize]);

examples/arc065-c.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ use std::io::{self, Read};
88
fn main() {
99
let mut input = read_to_static(io::stdin()).split_whitespace();
1010
macro_rules! read {
11-
(_bytes) => { read!(String).into_bytes() };
12-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
13-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
14-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
15-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
11+
(_bytes) => {
12+
read!(String).into_bytes()
13+
};
14+
([$tt:tt]) => (read!([$tt; read!(usize)]));
15+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
16+
(($($tt:tt),+)) => (($(read!($tt)),*));
17+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
1618
}
1719

1820
let s = read!(_bytes);

examples/arc084-c.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use std::io::{self, Read};
77
fn main() {
88
let mut input = read_to_static(io::stdin()).split_whitespace();
99
macro_rules! read {
10-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
11-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
12-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
13-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
10+
([$tt:tt]) => (read!([$tt; read!(usize)]));
11+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
12+
(($($tt:tt),+)) => (($(read!($tt)),*));
13+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
1414
}
1515

1616
let n = read!(usize);

examples/atc001-b.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ use std::io::{self, BufWriter, Read, StdoutLock, Write as _};
77
fn main() {
88
let mut input = read_to_static(io::stdin()).split_whitespace();
99
macro_rules! read {
10-
([$tt:tt]) => { read!([$tt; read!(usize)]) };
11-
([$tt:tt; $n:expr]) => { (0..$n).map(|_| read!($tt)).collect::<Vec<_>>() };
12-
(($($tt:tt),+)) => { ($(read!($tt)),*) };
13-
($ty:ty) => { input.next().unwrap().parse::<$ty>().unwrap() };
10+
([$tt:tt]) => (read!([$tt; read!(usize)]));
11+
([$tt:tt; $n:expr]) => ((0..$n).map(|_| read!($tt)).collect::<Vec<_>>());
12+
(($($tt:tt),+)) => (($(read!($tt)),*));
13+
($ty:ty) => (input.next().unwrap().parse::<$ty>().unwrap());
1414
}
1515

1616
let n = read!(usize);
1717
let pabs = read!([(u8, usize, usize)]);
1818

1919
let mut uf = UnionFind::new(n);
2020
buf_print(|stdout| {
21-
macro_rules! println { ($($tt:tt)*) => { writeln!(stdout, $($tt)*).unwrap() }; }
21+
macro_rules! println(($($tt:tt)*) => (writeln!(stdout, $($tt)*).unwrap()));
2222

2323
for (p, a, b) in pabs {
2424
if p == 1 {

0 commit comments

Comments
 (0)