結果
| 問題 |
No.531 エヌスクミ島の平和協定
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-25 06:58:32 |
| 言語 | JavaScript (node v23.5.0) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 2,000 ms |
| コード長 | 309 bytes |
| コンパイル時間 | 104 ms |
| コンパイル使用メモリ | 6,816 KB |
| 実行使用メモリ | 40,948 KB |
| 最終ジャッジ日時 | 2024-10-01 16:46:15 |
| 合計ジャッジ時間 | 3,372 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 37 |
ソースコード
function Main(input) {
const src = input.replace("\n", "").split(" ");
const n = parseInt(src[0]);
const m = parseInt(src[1]);
let ans = -1;
if (n <= m) ans = 1;
else if (n % 2 == 0 && n / 2 <= m) ans = 2;
console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));