結果
| 問題 | No.1851 Regular Tiling |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-27 00:06:08 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,028 bytes |
| 記録 | |
| コンパイル時間 | 13,202 ms |
| コンパイル使用メモリ | 390,008 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-22 16:07:04 |
| 合計ジャッジ時間 | 17,265 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 14 |
ソースコード
fn main() {
let mut t = String::new();
std::io::stdin().read_line(&mut t).ok();
let t: usize = t.trim().parse().unwrap();
for _ in 0..t {
let mut hw = String::new();
std::io::stdin().read_line(&mut hw).ok();
let hw: Vec<usize> = hw.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();
let h = hw[0];
let w = hw[1];
let result = (0..=h).map(|i| {
let ret = if i % 3 == 0 { (0..=w).map(|j| if j % 3 == 0 { "0" } else { "1" }).collect::<Vec<_>>().join("") }
else { (0..=w).map(|j| if j % 3 == 0 { "1" } else { "2" }).collect::<Vec<_>>().join("") };
ret.chars().collect::<Vec<_>>()
})
.collect::<Vec<_>>();
let hstart = if h % 3 == 2 { 1 } else { 0 };
let wstart = if w % 3 == 2 { 1 } else { 0 };
for i in 0..h {
for j in 0..w {
print!("{}", result[i+hstart][j+wstart]);
}
println!();
}
}
}