結果
| 問題 |
No.82 市松模様
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-10 19:51:02 |
| 言語 | TypeScript (5.7.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 682 bytes |
| コンパイル時間 | 8,315 ms |
| コンパイル使用メモリ | 229,832 KB |
| 実行使用メモリ | 41,452 KB |
| 最終ジャッジ日時 | 2024-12-31 16:14:09 |
| 合計ジャッジ時間 | 9,555 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 7 |
ソースコード
const writeRow = (n: number, start: string) => {
const second: string = start === 'W' ? 'B' : 'W';
let result = start;
for (let i = 0; i < n; i++) {
if (i % 2 == 0) result += second;
if (i % 2 !== 0) result += start;
}
return result
}
const Main = (input) => {
const data = input.split("\n")
const width: number = data[0], heigh: number = data[1];
const start: string = data[2];
let result = '';
const row = writeRow(width, start);
for (var i = 1; i <= heigh; i++) {
result += `${row}`
if (i < heigh) result += `\n`
}
console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));