結果
| 問題 |
No.112 ややこしい鶴亀算
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-11 23:12:56 |
| 言語 | JavaScript (node v23.5.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 386 bytes |
| コンパイル時間 | 68 ms |
| コンパイル使用メモリ | 6,820 KB |
| 実行使用メモリ | 39,424 KB |
| 最終ジャッジ日時 | 2024-10-13 01:11:58 |
| 合計ジャッジ時間 | 2,653 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 WA * 12 |
ソースコード
const lines = require('fs')
.readFileSync('/dev/stdin', 'utf-8')
.trim().split('\n').values();
const N = Number(lines.next().value);
const a = lines.next().value.split(' ').map(x => Number(x));
const max = Math.max(...a);
let 鶴 = a.reduce((a, x) => a + (x === max ? 1 : 0), 0);
let 亀 = N - 鶴;
if ((N - 1) * 2 !== max) {
[鶴, 亀] = [亀, 鶴];
}
console.log(鶴, 亀);