problem_template.rs (37 lines of code) (raw):
#![allow(non_snake_case)]
use std::io::Read;
use proconio::{input, fastout};
use proconio::source::auto::AutoSource;
#[fastout]
fn main() {
// main関数は変更しない
let mut s = String::new();
std::io::stdin().read_to_string(&mut s).unwrap();
println!("{}", solve(&s));
}
fn solve(src: &str) -> String {
let source = AutoSource::from(src);
input! {
from source,
N: usize,
A: [u64; N]
}
let mut answer = 0;
format!("{}", answer)
}
// ここから上を提出してください
// 以下テストコード
#[cfg(test)]
mod test {
use crate::solve;
macro_rules! test {
($($input:expr => $output:expr),* $(,)*) => {
#[test]
fn solve_test() {
$(
assert_eq!(solve($input), $output);
)*
}
};
}
test! {
r#"1 1"# => "2",
}
}