Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
44 lines (40 loc) · 982 Bytes

File metadata and controls

44 lines (40 loc) · 982 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
*
*/
/**
* @author DELL
* Project Name: Java_learn
* Class Name: libaidajiu
* date: 2019年9月1日{time}
*/
public class libaidajiu {
/**
* @param args
*/
public static char[] a= new char[20];
public static int ans = 0;
public static void dfs(int cur, int dian, int hua, int jiu) {
if(dian > 5)
return;
if(hua > 10)
return;
if(cur == 15) {
if(dian == 5 && hua == 10 && a[14] == 'b' && jiu == 0) {
for(int i = 0; i <= 14; i++)
System.out.print(a[i]);
System.out.println();
ans++;
}
return;
}
a[cur] = 'a';
dfs(cur+1, dian+1, hua, jiu*2);
a[cur] = 'b';
dfs(cur+1, dian, hua+1, jiu-1);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
dfs(0, 0, 0, 2);
System.out.println(ans);
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.