結果
| 問題 |
No.52 よくある文字列の問題
|
| コンテスト | |
| ユーザー |
Naco
|
| 提出日時 | 2019-10-15 23:58:51 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 533 bytes |
| コンパイル時間 | 1,972 ms |
| コンパイル使用メモリ | 176,692 KB |
| 実行使用メモリ | 11,264 KB |
| 最終ジャッジ日時 | 2024-12-31 06:46:26 |
| 合計ジャッジ時間 | 2,899 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 6 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int ans=0;
string s;
map<string,int> ma;
void solve(string now,int ind){
int N=s.size();
if(now.size()==N-1){
ma[now]++;
return;
}
string i=now+s[N-1-ind];
string j=s[N-1-ind]+now;
string k=now+s[ind];
string l=s[ind]+now;
//cout << i << " " << j << " " << k << " " << l << endl;
solve(i,ind+1);
solve(j,ind+1);
solve(k,ind+1);
solve(l,ind+1);
}
int main(){
cin >> s;
solve("",0);
cout << ma.size() << endl;
}
Naco