Skip to content

Add commented out code to make proconio removable #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions examples/abc120-d.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
// https://atcoder.jp/contests/abc120/tasks/abc120_d

use proconio::marker::Usize1;
use proconio::{fastout, input};
use union_find::{QuickFindUf, UnionBySize, UnionFind as _};

#[fastout]
#[proconio::fastout]
fn main() {
// use std::io::{self, Read as _};
//
// let mut input = "".to_owned();
// io::stdin().read_to_string(&mut input).unwrap();
// let mut input = input.split_whitespace();
// macro_rules! read {
// ([$t:tt; $n:expr]) => {
// (0..$n).map(|_| read!($t)).collect::<Vec<_>>()
// };
// (($($t:tt),+)) => {
// ($(read!($t)),*)
// };
// (_1based) => {
// read!(usize) - 1
// };
// (_bytes) => {
// read!(String).into_bytes()
// };
// ($ty:ty) => {
// input.next().unwrap().parse::<$ty>().unwrap()
// };
// }
//
// let (n, m) = (read!((usize, usize)));
// let abs = read!([(_1based, _1based); m]);

use proconio::input;
use proconio::marker::Usize1;

input! {
n: usize,
m: usize,
Expand Down
1 change: 1 addition & 0 deletions examples/apg4b-a.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ use strsim as _;
use superslice as _;
use take_mut as _;
use text_io as _;
use union_find as _;
use whiteread as _;

#[cfg(feature = "jemalloc-ctl")]
Expand Down
31 changes: 29 additions & 2 deletions examples/arc065-c.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
// https://atcoder.jp/contests/arc065/tasks/arc065_a

use lazy_static::lazy_static;
use proconio::input;
use proconio::marker::Bytes;
use regex::bytes::Regex;

#[proconio::fastout]
fn main() {
// use std::io::{self, Read as _};
//
// let mut input = "".to_owned();
// io::stdin().read_to_string(&mut input).unwrap();
// let mut input = input.split_whitespace();
// macro_rules! read {
// ([$t:tt; $n:expr]) => {
// (0..$n).map(|_| read!($t)).collect::<Vec<_>>()
// };
// (($($t:tt),+)) => {
// ($(read!($t)),*)
// };
// (_1based) => {
// read!(usize) - 1
// };
// (_bytes) => {
// read!(String).into_bytes()
// };
// ($ty:ty) => {
// input.next().unwrap().parse::<$ty>().unwrap()
// };
// }
//
// let s = read!(_bytes);

use proconio::input;
use proconio::marker::Bytes;

input! {
s: Bytes,
}
Expand Down
48 changes: 48 additions & 0 deletions examples/atc001-b.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
use petgraph::unionfind::UnionFind;

#[proconio::fastout]
fn main() {
// use std::io::{self, Read as _};
//
// let mut input = "".to_owned();
// io::stdin().read_to_string(&mut input).unwrap();
// let mut input = input.split_whitespace();
// macro_rules! read {
// ([$t:tt; $n:expr]) => {
// (0..$n).map(|_| read!($t)).collect::<Vec<_>>()
// };
// (($($t:tt),+)) => {
// ($(read!($t)),*)
// };
// (_1based) => {
// read!(usize) - 1
// };
// (_bytes) => {
// read!(String).into_bytes()
// };
// ($ty:ty) => {
// input.next().unwrap().parse::<$ty>().unwrap()
// };
// }
//
// let (n, q) = read!((usize, usize));
// let pabs = read!([(u8, usize, usize); q]);

use proconio::input;

input! {
n: usize,
q: usize,
pabs: [(u8, usize, usize); q],
}

let mut uf = UnionFind::new(n);
for (p, a, b) in pabs {
if p == 1 {
let same = uf.find(a) == uf.find(b);
println!("{}", if same { "Yes" } else { "No" });
} else {
uf.union(a, b);
}
}
}
29 changes: 29 additions & 0 deletions examples/atc002-b.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// https://atcoder.jp/contests/atc002/tasks/atc002_b

use num::BigUint;

#[proconio::fastout]
fn main() {
// use defmac::defmac;
//
// use std::io::{self, Read as _};
//
// let mut input = "".to_owned();
// io::stdin().read_to_string(&mut input).unwrap();
// let mut input = input.split_whitespace();
// defmac!(read => input.next().unwrap().parse().unwrap());
//
// let n: BigUint = read!();
// let m: BigUint = read!();
// let p: BigUint = read!();

use proconio::input;

input! {
n: BigUint,
m: BigUint,
p: BigUint,
}

println!("{}", n.modpow(&p, &m));
}
16 changes: 14 additions & 2 deletions examples/practice-a.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
// https://atcoder.jp/contests/practice/tasks/practice_1

use proconio::input;

#[proconio::fastout]
fn main() {
// use defmac::defmac;
//
// use std::io::{self, Read as _};
//
// let mut input = "".to_owned();
// io::stdin().read_to_string(&mut input).unwrap();
// let mut input = input.split_whitespace();
// defmac!(read => input.next().unwrap().parse().unwrap());
//
// let (a, b, c, s): (u32, u32, u32, String) = (read!(), read!(), read!(), read!());

use proconio::input;

input! {
a: u32,
b: u32,
Expand Down
11 changes: 11 additions & 0 deletions examples/tests.ron
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// 手元でDropboxのテストケース(ある場合)で確認し、Gitに含めるのはそのうちサンプルのみ。
// CI上でもサンプルだけテストする。(Dropboxから引っ張るのも面倒だし何より誰のアカウントを使うかという問題がある)

(
tests: {
"apg4b-a": (
Expand All @@ -8,6 +11,14 @@
name: "practice contest: A - Welcome to AtCoder",
matching: ExactWords,
),
"atc001-b": (
name: "ATC001: B - Union Find",
matching: ExactWords,
),
"atc002-b": (
name: "ATC002: B - n^p mod m",
matching: ExactWords,
),
"arc065-c": (
name: "ABC049 / ARC065: C - 白昼夢 / Daydream",
matching: ExactWords,
Expand Down
10 changes: 10 additions & 0 deletions examples/testsets/atc001-b/in/00_sample_01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
8 9
0 1 2
0 3 2
1 1 3
1 1 4
0 2 4
1 4 1
0 4 2
0 0 0
1 0 0
4 changes: 4 additions & 0 deletions examples/testsets/atc001-b/out/00_sample_01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Yes
No
Yes
Yes
1 change: 1 addition & 0 deletions examples/testsets/atc002-b/in/sample_01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12 15 7
1 change: 1 addition & 0 deletions examples/testsets/atc002-b/in/sample_02.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
123456789 234567894 6574837563712
1 change: 1 addition & 0 deletions examples/testsets/atc002-b/out/sample_01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3
1 change: 1 addition & 0 deletions examples/testsets/atc002-b/out/sample_02.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
120678297