結果

問題 No.312 置換処理
ユーザー tokizotokizo
提出日時 2019-03-09 16:48:21
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 548 bytes
コンパイル時間 1,468 ms
コンパイル使用メモリ 167,480 KB
実行使用メモリ 814,492 KB
最終ジャッジ日時 2023-09-05 19:50:28
合計ジャッジ時間 7,357 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 2 ms
4,380 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 1 ms
4,376 KB
testcase_23 WA -
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 WA -
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 MLE -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    long long n;
    cin >> n;

    vector<bool> F(n, true);
    F[0] = F[1] = false;
    for(long long i = 2; i <= (long long)sqrt(n); i++){
        if(F[i]){
            for(long long j = i * 2; j <= n; j += i){
                F[j] = false;
            }
        }
    }

    for(long long i = 3; i <= n; i++){
        if(F[i] and n % i == 0){
            cout << i << endl;
            return 0;
        }
    }


    return 0;
}
0