結果

問題 No.587 七対子
コンテスト
ユーザー yearyear_
提出日時 2018-01-17 02:04:17
言語 JavaScript
(node v25.8.2)
コンパイル:
true
実行:
node _filename_ ONLINE_JUDGE
結果
WA  
実行時間 -
コード長 588 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 49 ms
コンパイル使用メモリ 6,528 KB
実行使用メモリ 53,704 KB
最終ジャッジ日時 2026-04-30 05:26:45
合計ジャッジ時間 4,654 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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