結果

問題 No.587 七対子
ユーザー te-sh
提出日時 2017-11-03 22:28:47
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 96,332 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 22:17:30
合計ジャッジ時間 1,724 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto s = readln.chomp;
  auto t = new int[](26);
  foreach (c; s) t[c-'a']++;

  auto i1 = t.count(1);
  auto i2 = t.count(2);

  if (i1 == 1 && i2 == 6) {
    writeln(cast(char)(t.countUntil(1)+'a'));
  } else {
    writeln("Impossible");
  }
}
0