結果
| 問題 |
No.548 国士無双
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-16 16:05:13 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 612 bytes |
| コンパイル時間 | 1,556 ms |
| コンパイル使用メモリ | 166,416 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-17 14:45:49 |
| 合計ジャッジ時間 | 2,417 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
char S[ 20 ];
int A[ 30 ];
int main()
{
int i;
int x;
int iCnt2;
cin >> S;
iCnt2 = 0;
for( i = 0; i < 13; i++ )
{
x = ++A[ S[ i ] - 'a' ];
if( x > 2 )
{
cout << "Impossible" << endl;
return 0;
}
if( x == 2 ) iCnt2++;
if( iCnt2 > 1 )
{
cout << "Impossible" << endl;
return 0;
}
}
if( iCnt2 == 0 )
{
for( i = 0; i < 13; i++ )
{
if( A[ i ] == 1 )
cout << (char) ( 'a' + i ) << endl;
}
}
else
{
for( i = 0; i < 13; i++ )
{
if( A[ i ] == 0 )
cout << (char) ( 'a' + i ) << endl;
}
}
return 0;
}