33 lines
693 B
C++
33 lines
693 B
C++
#include <cstring>
|
|
#include <iostream>
|
|
|
|
constexpr int N = 105;
|
|
|
|
static int answers[N] = {0};
|
|
|
|
static void initAnswers() {
|
|
// O(n^3),本题可接受
|
|
bool cells[N];
|
|
for (int n = 1; n < N; n++) {
|
|
memset(cells, false, sizeof(cells));
|
|
for (int i = 0; i < n; i++) {
|
|
for (int j = i; j < n; j += i + 1) {
|
|
cells[j] = !cells[j];
|
|
}
|
|
}
|
|
for (int i = 0; i < n; i++) {
|
|
if (cells[i]) { answers[n]++; }
|
|
}
|
|
}
|
|
}
|
|
|
|
int main() {
|
|
initAnswers();
|
|
int rounds, n;
|
|
std::cin >> rounds;
|
|
for (int i = 0; i < rounds; i++) {
|
|
std::cin >> n;
|
|
std::cout << answers[n] << std::endl;
|
|
}
|
|
}
|