結果
問題 |
No.52 よくある文字列の問題
|
ユーザー |
![]() |
提出日時 | 2019-10-16 00:01:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 530 bytes |
コンパイル時間 | 2,101 ms |
コンパイル使用メモリ | 177,160 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-31 06:55:41 |
合計ジャッジ時間 | 2,718 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 4 |
ソースコード
#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(ind==(N+1)/2){ 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; }