結果
問題 | No.1291 小手調べ |
ユーザー |
![]() |
提出日時 | 2020-11-20 21:27:21 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,022 bytes |
コンパイル時間 | 12,653 ms |
コンパイル使用メモリ | 387,364 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-23 12:38:19 |
合計ジャッジ時間 | 13,109 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 WA * 3 |
ソースコード
use std::io::{BufRead, BufWriter, Write, StdinLock, StdoutLock};fn input(stdin: &mut StdinLock) -> String {let mut input = String::new();stdin.read_line(&mut input).ok();input}macro_rules! read {($stdin:expr, [$t:tt; $n:expr]) => {(0..$n).map(|_| read!($stdin, $t)).collect::<Vec<_>>()};($stdin:expr, [$t:tt]) => {input($stdin).split_whitespace().map(|x| parse!(x, $t)).collect::<Vec<_>>()};($stdin:expr, ($($t:tt),*)) => {{let input = input($stdin);let mut iter = input.split_whitespace();( $( parse!(iter.next().unwrap(), $t) ),* )}};($stdin:expr, $t:tt) => {parse!(input($stdin).trim(), $t)};}macro_rules! parse {($s:expr, chars) => {$s.chars().collect::<Vec<_>>()};($s:expr, usize1) => {parse!($s, usize) - 1};($s:expr, $t:ty) => {$s.parse::<$t>().unwrap()}}trait ProconWrite {fn writeln<T: std::fmt::Display>(&mut self, x: T);fn writeln_iter<I: Iterator>(&mut self, iter: I)whereI::Item: std::fmt::Display{self.writeln(iter.map(|x| x.to_string()).collect::<Vec<_>>().join(" "));}}impl ProconWrite for BufWriter<StdoutLock<'_>> {fn writeln<T: std::fmt::Display>(&mut self, x: T) {writeln!(self, "{}", x).ok();}}fn solve(stdin: &mut StdinLock, writer: &mut BufWriter<StdoutLock>) {let d = read!(stdin, usize);writer.writeln(std::iter::once('9').chain(std::iter::once('0').cycle().take(d - 1)).collect::<String>());}fn main() {let stdin = std::io::stdin();let mut stdin = stdin.lock();let stdout = std::io::stdout();let mut writer = BufWriter::new(stdout.lock());let t = read!(&mut stdin, usize);for _ in 0..t {solve(&mut stdin, &mut writer);}}