結果

問題 No.548 国士無双
ユーザー WA_TLEWA_TLE
提出日時 2017-07-28 22:26:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,199 bytes
コンパイル時間 1,219 ms
コンパイル使用メモリ 118,956 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-19 08:31:55
合計ジャッジ時間 2,414 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,376 KB
testcase_21 WA -
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<string>
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<chrono>
#include<functional>
#include<iterator>
//#include<random>
#include<unordered_set>
#include<map>
using namespace std;
typedef long long int llint;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
const int mod=1000000007;
const int big=1e8+10;
const long double pai=3.141592653589793238462643383279;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
int gcd(int a,int b){if(a%b==0){return b;}else return gcd(b,a%b);}//a>b
int main(void){
	string str;cin>>str;
	sort(str.begin(),str.end());
	char ans='z';
	if(str=="abcdefghijklm"){
		for(char c='a';c!='n';c++){cout<<c<<endl;}return 0;
	}
	char c;
	for(c='a';c!='n';c++){
		auto it=find(str.begin(),str.end(),c);
		if(it!=str.end()){
			if(ans!='z'){cout<<"Impossible"<<endl;return 0;}
			ans=c;
		}
	}
	cout<<c<<endl;
	return 0;
}
0