結果
| 問題 | No.52 よくある文字列の問題 |
| コンテスト | |
| ユーザー |
kou6839
|
| 提出日時 | 2015-02-06 16:34:52 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 70 ms / 5,000 ms |
| + 948µs | |
| コード長 | 587 bytes |
| 記録 | |
| コンパイル時間 | 1,481 ms |
| コンパイル使用メモリ | 86,692 KB |
| 実行使用メモリ | 46,316 KB |
| 最終ジャッジ日時 | 2026-09-02 05:06:57 |
| 合計ジャッジ時間 | 3,437 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
import java.math.*;
import java.util.*;
public class Main {
static Set<String> ans;
static void dfs(String to,String moto){
if(moto.equals("")){
ans.add(to);
return;
}
String temp = to + moto.charAt(0);
dfs(temp, moto.substring(1,moto.length()));
temp=to+moto.charAt(moto.length()-1);
dfs(temp, moto.substring(0,moto.length()-1));
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
ans=new HashSet<>();
String string = sc.next();
dfs("", string);
System.out.println(ans.size());
}
}
kou6839