//#[derive_readable] struct Problem { s: String, } impl Problem { fn read() -> Problem { input! { s: String, } Problem { s } } fn solve(&self) -> Answer { let ans = "Hello World".to_string(); Answer { ans } } } #[derive(Clone, Debug, PartialEq, Eq)] struct Answer { ans: String, } impl Answer { fn print(&self) { println!("{}", self.ans); } } fn main() { Problem::read().solve().print(); } #[cfg(test)] mod tests { #[allow(unused_imports)] use super::*; #[test] fn test_problem() { assert_eq!(1 + 1, 2); } } // ====== import ====== #[allow(unused_imports)] use itertools::Itertools; #[allow(unused_imports)] use proconio::{ derive_readable, fastout, input, marker::{Bytes, Usize1}, }; // ====== output func ====== #[allow(unused_imports)] use print_vec::*; pub mod print_vec { use itertools::Itertools; use proconio::fastout; #[fastout] pub fn print_vec(arr: &[T]) { for a in arr { println!("{:?}", a); } } #[fastout] pub fn print_vec_1line(arr: &[T]) { let msg = arr.iter().map(|x| format!("{:?}", x)).join(" "); println!("{}", msg); } #[fastout] pub fn print_vec2(arr: &Vec>) { for row in arr { let msg = row.iter().map(|x| format!("{:?}", x)).join(" "); println!("{}", msg); } } pub fn print_bytes(bytes: &[u8]) { let msg = String::from_utf8(bytes.to_vec()).unwrap(); println!("{}", msg); } #[fastout] pub fn print_vec_bytes(vec_bytes: &[Vec]) { for row in vec_bytes { let msg = String::from_utf8(row.to_vec()).unwrap(); println!("{}", msg); } } } #[allow(unused)] fn print_yesno(ans: bool) { let msg = if ans { "Yes" } else { "No" }; println!("{}", msg); } // ====== snippet ======