結果
| 問題 |
No.1004 サイコロの実装 (2)
|
| コンテスト | |
| ユーザー |
tsuchinaga
|
| 提出日時 | 2020-10-04 23:07:22 |
| 言語 | TypeScript (5.7.2) |
| 結果 |
AC
|
| 実行時間 | 67 ms / 2,000 ms |
| コード長 | 550 bytes |
| コンパイル時間 | 8,220 ms |
| コンパイル使用メモリ | 229,132 KB |
| 実行使用メモリ | 39,552 KB |
| 最終ジャッジ日時 | 2024-12-31 16:22:14 |
| 合計ジャッジ時間 | 12,087 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 38 |
ソースコード
function issue1004(input: string) {
let inputs = input.trim().split(" ").map((a: string): number => Number(a))
let x0 = inputs[2]
let n = inputs[3]
// 奇数と偶数が繰り返されるため、最初が奇数なら一人目が、最初が偶数なら二人目が勝つ
let w = Math.floor(n / 2)
if (x0 % 2 == 1) console.log([w, 0].join(" "))
else console.log([0, w].join(" "))
}
let path: string = "/dev/stdin"
if (process.platform == "win32") path = "./stdin.txt"
issue1004(require('fs').readFileSync(path, 'utf8'))
tsuchinaga