結果
| 問題 |
No.548 国士無双
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-04-27 18:10:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 806 bytes |
| コンパイル時間 | 477 ms |
| コンパイル使用メモリ | 64,256 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 20:33:27 |
| 合計ジャッジ時間 | 1,217 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 WA * 1 |
ソースコード
#include<iostream>
using namespace std;
int main(){
int A[13] = {};
char c;
bool isDouble = false;
for(; cin >> c;){
if(c < 'a' || 'm' < c){
cout << "Impossible" << endl;
return 0;
}
int index = (int)(c-'a');
A[index]++;
if(!isDouble && A[index] == 2){
isDouble = true;
}else if(isDouble && A[index] == 2){
cout << "Impossible" << endl;
return 0;
}
}
if(isDouble){
int i;
for(i = 0; i < 13; i++){
if(A[i] == 0){
cout << (char)('a' + i) << endl;
return 0;
}
}
}else{
for(int i = 0; i < 13; i++){
cout << (char)('a' + i) << endl;
}
}
return 0;
}