結果

問題 No.587 七対子
ユーザー yearyear_yearyear_
提出日時 2018-01-17 02:04:17
言語 JavaScript
(node v21.7.1)
結果
WA  
実行時間 -
コード長 588 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 5,504 KB
実行使用メモリ 39,808 KB
最終ジャッジ日時 2024-04-21 02:04:39
合計ジャッジ時間 3,702 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 68 ms
39,424 KB
testcase_02 AC 67 ms
39,296 KB
testcase_03 AC 67 ms
39,424 KB
testcase_04 AC 67 ms
39,424 KB
testcase_05 AC 69 ms
39,680 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 67 ms
39,424 KB
testcase_10 AC 67 ms
39,424 KB
testcase_11 WA -
testcase_12 AC 67 ms
39,808 KB
testcase_13 AC 66 ms
39,680 KB
testcase_14 AC 68 ms
39,424 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 71 ms
39,808 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 67 ms
39,424 KB
testcase_33 AC 66 ms
39,552 KB
testcase_34 AC 67 ms
39,552 KB
権限があれば一括ダウンロードができます

ソースコード

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