結果
問題 | No.1058 素敵な数 |
ユーザー | bonKotsu |
提出日時 | 2021-06-15 00:12:20 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 448 bytes |
コンパイル時間 | 1,646 ms |
コンパイル使用メモリ | 164,192 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-08-26 14:17:53 |
合計ジャッジ時間 | 2,444 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair<int, int> bool isPrime(int x) { for (int i = 2; i*i <= x; i++) { if (x%i==0) return false; } return true; } int main() { int n; cin >> n; int cnt = 1; int ans = 1; int i = 100001; while (cnt < n) { if (isPrime(i)) { cnt++; ans = i; } i++; } cout << ans << endl; }