結果
問題 | No.52 よくある文字列の問題 |
ユーザー | evawenis |
提出日時 | 2020-08-18 23:30:49 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 322 bytes |
コンパイル時間 | 2,287 ms |
コンパイル使用メモリ | 198,220 KB |
最終ジャッジ日時 | 2025-01-13 03:32:25 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
#include<bits/stdc++.h> using namespace std; string s; set<string>st; void solve(int L,int R,string res){ if(L>=R){ st.insert(res); return; } solve(L+1,R,res+s.at(L)); solve(L,R-1,res+s.at(R)); } int main(){ cin.tie(0),ios::sync_with_stdio(false); cin>>s; solve(0,s.size()-1,""s); cout<<st.size()<<"\n"s; }