結果
| 問題 |
No.548 国士無双
|
| コンテスト | |
| ユーザー |
nenuon
|
| 提出日時 | 2017-07-28 22:29:12 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 862 bytes |
| コンパイル時間 | 725 ms |
| コンパイル使用メモリ | 89,508 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-17 12:57:30 |
| 合計ジャッジ時間 | 1,520 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef long long ll;
int main()
{
string abc = "abcdefghijklm";
int cnt[13];
FOR(i,0,13) cnt[i] = 0;
string s;
cin >> s;
bool two = false;
FOR(i,0,13) {
cnt[s[i]-'a']++;
if(cnt[s[i]-'a'] >= 2 && !two) two = true;
else if(cnt[s[i]-'a'] >= 2 && two) {
cout << "Impossible" << endl;
return 0;
}
}
if(two) {
FOR(i,0,13) {
if(cnt[i]==0) {
cout << abc[i] << endl;
return 0;
}
}
} else {
FOR(i,0,13) {
cout << abc[i] << endl;
}
}
return 0;
}
nenuon