2014
03-06

# Just Do It

Now we define a function F(x), which means the factors of x. In particular, F(1) = 1,since 1 only has 1 factor 1, F(9) = 3, since 9 has 3 factors 1, 3, 9. Now give you an integer k, please find out the minimum number x that makes F(x) = k.

The first line contains an integer t means the number of test cases.
The follows t lines, each line contains an integer k. (0 < k <= 100).

The first line contains an integer t means the number of test cases.
The follows t lines, each line contains an integer k. (0 < k <= 100).

4
4
2
5
92

6
2
16
-1

Problem : 3189 ( Just Do It )      Judge Status : Accepted
RunId : 1898109     Language : G++     Author : lmyouya
Code Render Status : Rendered By HDOJ G++ Code Rander Version 0.01 Beta

#include<iostream>
#include<map>
#include<cmath>
using namespace std;
int main() {
int i, j, k, temp;
map<int, int> a;
a[0] = 0;
for (i = 1; i <= 1000; i++) {
k = int(sqrt(i));
if (k * k == i)
temp = 1;
else {
temp = 0;
k++;
}
for (j = 1; j < k; j++)
if (i % j == 0)
temp += 2;
if (a[temp] == 0)
a[temp] = i;
}
cin >> i;
while (i--) {
cin >> j;
if (a[j] == 0)
cout << -1 << endl;
else
cout << a[j] << endl;
}
return 0;
}

// stl stl 用了stl AC 了，算是真的AC吗？ 是为了 AC量还是质量？