結果

問題 No.893 お客様を誘導せよ
ユーザー ⁣
提出日時 2024-05-31 17:42:14
言語 Rust
(1.77.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 548 bytes
コンパイル時間 12,916 ms
コンパイル使用メモリ 403,296 KB
実行使用メモリ 9,344 KB
最終ジャッジ日時 2024-05-31 17:42:29
合計ジャッジ時間 14,981 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,816 KB
testcase_02 AC 3 ms
6,944 KB
testcase_03 AC 9 ms
6,944 KB
testcase_04 AC 10 ms
6,944 KB
testcase_05 AC 9 ms
6,940 KB
testcase_06 AC 6 ms
6,940 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 17 ms
9,344 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::Read;

fn main() {
	let mut s = String::new();
	std::io::stdin().read_to_string(&mut s).ok();
	let mut l = s.lines();
	let n = l.next().unwrap().parse::<usize>().unwrap();
	let mut v: Vec<_> = l
		.map(|l| l.split(' ').skip(1).flat_map(str::parse::<u64>))
		.collect();
	let mut a = vec![];
	let mut e = 0;
	while e < n {
		e = 0;
		for i in &mut v {
			if let Some(x) = i.next() {
				a.push(x);
			} else {
				e += 1;
			}
		}
	}

	println!(
		"{}",
		a.iter()
			.map(|x| x.to_string())
			.collect::<Vec<_>>()
			.join(" ")
	);
}
0