結果

問題 No.3035 2018
ユーザー mamekinmamekin
提出日時 2018-04-09 21:32:07
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 414 ms / 2,000 ms
コード長 904 bytes
コンパイル時間 864 ms
コンパイル使用メモリ 102,676 KB
実行使用メモリ 26,648 KB
最終ジャッジ日時 2023-09-09 03:36:27
合計ジャッジ時間 5,642 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 328 ms
26,380 KB
testcase_01 AC 325 ms
26,632 KB
testcase_02 AC 297 ms
26,520 KB
testcase_03 AC 361 ms
26,516 KB
testcase_04 AC 381 ms
26,336 KB
testcase_05 AC 361 ms
26,580 KB
testcase_06 AC 342 ms
26,516 KB
testcase_07 AC 347 ms
26,388 KB
testcase_08 AC 406 ms
26,648 KB
testcase_09 AC 414 ms
26,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

const int MAX = 6000000;

void solve(vector<int>& cnt)
{
    cnt.assign(MAX+1, 0);
    for(int i=1; i<=MAX; ++i){
        for(int j=i; j<=MAX; j+=i){
            ++ cnt[j];
        }
    }
}

int main()
{
    int n;
    cin >> n;

    vector<int> cnt;
    solve(cnt);

    for(int a=1; ; ++a){
        if(cnt[a] == 4){
            -- n;
            if(n == 0){
                cout << a << endl;
                return 0;
            }
        }
    }
}
0