結果
| 問題 |
No.52 よくある文字列の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-16 01:13:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 266 bytes |
| コンパイル時間 | 644 ms |
| コンパイル使用メモリ | 74,764 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 05:32:05 |
| 合計ジャッジ時間 | 1,182 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
main.cpp:15:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
15 | main()
| ^~~~
ソースコード
#include<iostream>
#include<set>
using namespace std;
string s;
set<string>S;
void g(string t,int f,int l)
{
if(l-f>1)
{
g(t+s.substr(f,1),f+1,l);
g(t+s.substr(l-1,1),f,l-1);
}
else S.insert(t);
}
main()
{
cin>>s;
g("",0,s.size());
cout<<S.size()<<endl;
}