結果

問題 No.587 七対子
ユーザー yearyear_
提出日時 2018-01-17 02:04:17
言語 JavaScript
(node v23.5.0)
結果
WA  
実行時間 -
コード長 588 bytes
コンパイル時間 35 ms
コンパイル使用メモリ 6,692 KB
実行使用メモリ 42,528 KB
最終ジャッジ日時 2024-10-13 00:33:26
合計ジャッジ時間 3,789 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

const readline_module = require('readline');


const readline = () => (new Promise((resolve, reject) => {
  const rl = readline_module.createInterface(process.stdin);
  rl.on('line', line => {
    resolve(line);
    rl.close();
  });
}));


const message = (async () => {
  const str = await readline();
  const map = new Map();
  for (const char of str) {
    const item = map.get(char);
    map.set(char, item === undefined ? 1 : item + 1);
  }
  for (const [a, b] of map) {
    if (b === 1) return a;
  }
  return 'Impossible';

})();

(async () => {
  console.log(await message)
})();
0