結果
問題 | No.63 ポッキーゲーム |
ユーザー |
|
提出日時 | 2020-07-23 16:25:38 |
言語 | JavaScript (node v23.5.0) |
結果 |
AC
|
実行時間 | 66 ms / 5,000 ms |
コード長 | 590 bytes |
コンパイル時間 | 216 ms |
コンパイル使用メモリ | 6,940 KB |
実行使用メモリ | 39,424 KB |
最終ジャッジ日時 | 2024-06-23 17:46:48 |
合計ジャッジ時間 | 2,553 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
function main(input = ``) {let lines = input.split('\n');let [totalLength, unitLength] = lines[0].split(' ').map((val) => parseInt(val));totalLength / (unitLength * 2);if (totalLength % (unitLength * 2) === 0) {return (totalLength / (unitLength * 2) - 1) * unitLength;} else {return Math.floor(totalLength / (unitLength * 2)) * unitLength;}}const { readFileSync, existsSync } = require('fs');const stdin = '/dev/stdin';if (existsSync(stdin)) {const input = readFileSync(stdin, 'utf8');console.log(main(input));}module.exports = main;