結果

問題 No.548 国士無双
ユーザー fura
提出日時 2020-04-11 03:52:55
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 2,712 ms
コンパイル使用メモリ 195,512 KB
最終ジャッジ日時 2025-01-09 17:11:37
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

bool check(string s){
	sort(s.begin(),s.end());
	s.erase(unique(s.begin(),s.end()),s.end());
	return s.length()==13;
}

int main(){
	string s; cin>>s;
	bool ok=false;
	rep(i,13) if(check(s+char('a'+i))) printf("%c\n",'a'+i), ok=true;
	if(!ok) puts("Impossible");
	return 0;
}
0