-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhahaha.cpp
More file actions
37 lines (36 loc) · 736 Bytes
/
hahaha.cpp
File metadata and controls
37 lines (36 loc) · 736 Bytes
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
//
// created by:DungTD
//
#include <bits/stdc++.h>
#define faster() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define base int (1e9+7)
#define ll long long
using namespace std;
void solve(){
int n; cin >> n;
queue <string> q;
q.push("H") ;
while (q.size()) {
string s = q.front(); q.pop();
if (s.size() == n) {
if (s[s.size()-1] == 'A') {
cout << s << endl;
}
}
else if (s[s.size()-1] == 'H') {
q.push(s+"A");
} else {
q.push(s+"A");
q.push(s+"H");
}
}
}
int main(){
faster();
int t;
cin >> t;
while (t--)
solve();
return 0;
}