結果

問題 No.36 素数が嫌い!
コンテスト
ユーザー nemunemu
提出日時 2023-05-01 10:54:04
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 375 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 699 ms
コンパイル使用メモリ 87,552 KB
実行使用メモリ 9,728 KB
最終ジャッジ日時 2026-05-14 13:08:00
合計ジャッジ時間 7,580 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 4
other AC * 11 TLE * 1 -- * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;

ll f(ll x) {
    if (x % 2 == 0) return x / 2;
    for (int i = 3; i * i <= x; i += 2) if (x % i == 0) return x / i;
    return 1;
}

int main() {
    ll N;
    cin >> N;

    if (f(f(N)) > 1) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}
0