## 题目链接:
### [A.Aaronson](http://acm.hdu.edu.cn/showproblem.php?pid=5747)
### [B.Bellovin](http://acm.hdu.edu.cn/showproblem.php?pid=5748)
### [C.Colmerauer](http://acm.hdu.edu.cn/showproblem.php?pid=5749)
### [D.Dertouzos](http://acm.hdu.edu.cn/showproblem.php?pid=5750)
## A
### 题意:
### 思路:
### Code:
```
#include <iostream>
#include <string>
using namespace std;
long long list[35];
void init() {
list[0] = 1;
for (int i = 1; i <= 31; ++i) {
list[i] = list[i - 1] * 2;
}
}
int main() {
ios::sync_with_stdio(0);
int kase;
cin >> kase;
init();
for (int i = 0; i < kase; ++i) {
long long n, m;
cin >> n >> m;
if (m >= 30) m = 30;
if (list[m + 1] > n) {
long long ans = 0;
while (n != 0) {
if (n & 1) ans++;
n /= 2;
}
// cout << "?" << endl;
cout << ans << endl;
} else {
long long ans = 0;
while (n != 0) {
ans += n / list[m];
n = n % list[m];
m--;
}
// cout << " ?? " << endl;
cout << ans << endl;
}
}
return 0;
}
```
## B
### 题意:
### 思路:
### Code:
```
#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int kase;
cin >> kase;
while (kase--) {
int n;
cin >> n;
vector<int> nums;
vector<int> ans;
for (int i = 0; i < n; ++i) {
int tem;
cin >> tem;
nums.push_back(tem);
}
const int maxn = n;
int min[maxn];
int dp[maxn];
int len = 0;
for (int i = 0; i < n; ++i) {
int pos = lower_bound(ans.begin(), ans.end(), nums[i]) - ans.begin();
dp[i] = pos + 1;
if (pos >= ans.size()) {
ans.push_back(nums[i]);
} else
ans[pos] = nums[i];
len = max(pos + 1, len);
// dp[i] = len;
}
for (int i = 0; i < n - 1; ++i) {
cout << dp[i] << " ";
}
cout << dp[n - 1];
cout << endl;
}
return 0;
}
```
## C
### 题意:
### 思路:
### Code:
## D
### 题意:
### 思路:
### Code:
剩下的先占坑