Problem:
Divisor
Problem
12以下の自然数
N
が与えられるので、約数の個数がちょうど
N
個であるような最小の自然数を求めよ。
Input
1つの自然数
N
が 1 行で与えられる。
Constraints
1 ≤
N
≤ 12
Output
約数の個数がちょうど
N
個であるような最小の自然数を1行に出力せよ。
Sample Input 1
1
Sample Output 1
1
Sample Input 2
2
Sample Output 2
2
Sample Input 3
3
Sample Output 3
4

Submitted solutions:

code_snippet: #include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int ans=0;
	int count[10000]={};
	for(int i=1;i<=10000;i++){
		for(int j=1;j<=10000;j++){
			if(i % j == 0) count[i]++;
		}
		if(count[i] == n){
			ans = i;
			break;
		}
	}
	cout<<ans<<endl;
	
	return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3128
final_rank: 4

code_snippet: #include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m,i=0;
	cin >> n;
	while(1){
		m=0;
		i++;
		for(int j=1;j<100000;j++){
			if(i%j==0){
				m++;
			}
		}
		if(m==n){
			cout << i << endl;
			break;
		}
	}
}
accuracy: 1
time_ms: 250
memory_kb: 3080
final_rank: 6

code_snippet: #include <bits/stdc++.h>
using namespace std;

int main(){

  int N;
  cin >> N;

  int count = 0;
    for(int n = 1; n < 10000; n++){
  for(int i = 1; i < 10000; i++){
    if(n%i == 0)count++;

  }
  if(N == count){
    cout << n << endl; return 0;
  }
  count = 0;
}

  return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3104
final_rank: 3

code_snippet: #include <bits/stdc++.h>
using namespace std;

int a[1<<13],n;
int main() {
  cin >> n;
  for(int i=1; i<=(1<<n); i++) {
    for(int j=1; j<=(1<<n); j++) a[j]+=!(j%i);
  }
  for(int i=1; i<=(1<<n); i++) {
    if(a[i]==n) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}
accuracy: 1
time_ms: 40
memory_kb: 3124
final_rank: 5

code_snippet: #include<bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;

int D(int x)
{
  int ret = 0;
  for(int i = 1; i <= x; i++) {
    if(x % i == 0) ret++;
  }
  return(ret);
}

int main()
{
  int data[14];
  fill_n(data, 14, INF);
  for(int i = 1; i < 10000; i++) {
    data[min(13, D(i))] = min(data[min(13, D(i))], i);
  }
  int N;
  cin >> N;
  cout << data[N] << endl;
}
accuracy: 1
time_ms: 370
memory_kb: 1160
final_rank: 2

code_snippet: #include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <list>
#include <tuple>
#include <bitset>
#include <ciso646>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;

inline bool cheak(ll x, ll y, ll xMax, ll yMax){ return x >= 0 && y >= 0 && xMax > x && yMax > y; }
inline ll toInt(string s) { ll v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
template<class T> inline T sqr(T x) { return x*x; }

#define For(i,a,b)	for(ll (i) = (a);i < (b);(i)++)
#define rep(i,n)	For(i,0,n)
#define rFor(i,a,b)	for(ll (i) = (a-1);i >= (b);(i)--)
#define rrep(i,n)	rFor(i,n,0)
#define clr(a)		memset((a), 0 ,sizeof(a))
#define mclr(a)		memset((a), -1 ,sizeof(a))
#define all(a)		(a).begin(),(a).end()

const ll mod = 1e9 + 7;
const ll INF = 1e9 + 9;

int count(ll n){
	int ret = 0;
	for (int j = 1; j <= n; j++){
		if (n % j == 0){
			ret++;
		}
	}
	return ret;
}

int main(){

	ll n;
	cin >> n;
	for (int i = 1;; i++){
		if (count(i) == n){
			cout << i << endl;
			return 0;
		}
	}

	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 1160
final_rank: 1