結果

問題 No.548 国士無双
ユーザー michonz4
提出日時 2019-12-25 21:10:48
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 28,672 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-25 11:55:15
合計ジャッジ時間 1,111 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main() {
  int arr[13]={};
  char s[14];
  scanf("%s", s);

  for (int i=0; i<13; i++) {
    arr[s[i]-'a']++;
  }

  int zerocnt=0;
  char zero;
  for (int i=0; i<13; i++) {
    if (arr[i]==0) {
      zerocnt++;
      zero=i+'a';
    }
    if (zerocnt==2) {
      printf("Impossible\n");
      return 0;
    } 
  }

  if (zerocnt) {
    printf("%c\n", zero);
  } else {
    for (int i=0; i<13; i++) {
      printf("%c\n", i+'a');
    }
  }
  
  return 0;
}
0