結果
問題 |
No.548 国士無双
|
ユーザー |
|
提出日時 | 2019-07-13 07:09:31 |
言語 | JavaScript (node v23.5.0) |
結果 |
AC
|
実行時間 | 69 ms / 2,000 ms |
コード長 | 539 bytes |
コンパイル時間 | 66 ms |
コンパイル使用メモリ | 6,688 KB |
実行使用メモリ | 39,552 KB |
最終ジャッジ日時 | 2024-10-13 01:12:20 |
合計ジャッジ時間 | 2,585 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
const lines = require('fs') .readFileSync('/dev/stdin', 'utf-8') .trim().split('\n').values(); const S = lines.next().value; const deck = Array(13).fill(0); for (c of S) deck[c.charCodeAt(0) - 97]++; if ((deck.reduce((a, x) => a + Number(x === 2), 0)) === 1) { deck.forEach((x, i) => { if (x === 0) { console.log(String.fromCharCode(i + 97)); } }); return; } if (deck.every(x => x === 1)) { deck.forEach((x, i) => { console.log(String.fromCharCode(i + 97)); }); return; } console.log('Impossible');