結果
| 問題 |
No.52 よくある文字列の問題
|
| コンテスト | |
| ユーザー |
nenuon
|
| 提出日時 | 2017-06-28 10:56:12 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 659 bytes |
| コンパイル時間 | 882 ms |
| コンパイル使用メモリ | 97,992 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 05:31:08 |
| 合計ジャッジ時間 | 1,398 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#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;
map<string, bool> MAP;
void dfs (string s, string ans) {
int len = s.length();
if(len == 0) {
MAP[ans] = true;
return;
}
dfs(s.substr(1), ans + s[0]);
dfs(s.substr(0,len-1), ans + s[len-1]);
return;
}
int main(){
string s;
cin >> s;
dfs(s,"");
cout << MAP.size() << endl;
return 0;
}
nenuon