結果

問題 No.192 合成数
ユーザー tokizotokizo
提出日時 2018-01-15 21:53:54
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 686 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 78,028 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 02:19:38
合計ジャッジ時間 1,718 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <math.h>
#include <algorithm>
#include <functional>
#include <vector>
#include <typeinfo>
#include <climits>
#include <ctype.h>
#include <string>
#include <stack>
using namespace std;
#define FOR(i, a, n) for (int i = a; i < n; i++)
#define REP(i, n) for(int i = 0; i < n; i++)
struct omt{omt(){ios::sync_with_stdio(false);cin.tie(0);}}star;

int main(){
    int n;
    cin >> n;
    n -= 100;

    int cnt;
    FOR(i, n, n + 100){
        cnt = 0;
        FOR(j, 1, i + 1){
            if(i % j == 0) cnt += 1;
            if(cnt > 2) break;
        }
        if(cnt > 2){
            cout << i << endl;
            break;
        }
    }


    return 0;
}
0