結果
| 問題 | No.312 置換処理 |
| コンテスト | |
| ユーザー |
m1025o1184t
|
| 提出日時 | 2019-12-24 03:04:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 727 bytes |
| 記録 | |
| コンパイル時間 | 1,456 ms |
| コンパイル使用メモリ | 168,340 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-19 08:02:13 |
| 合計ジャッジ時間 | 4,983 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 27 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;
class Prime
{
ll i, iLimit;
public:
bool isPrime(ll a);
};
bool Prime::isPrime(ll a)
{
if (a == 1) return false;
iLimit = (ll)sqrt(a);
for (i = 2; i <= iLimit; i++) {
if (a % i == 0) break;
}
if (i == iLimit + 1) {
return true;
}
else {
return false;
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
bool elf;
set<ll> st;
Prime objPrime;
for (int i = 1; i <= sqrt(n); ++i) {
elf = objPrime.isPrime(i);
if (n % i == 0 && elf && i % 2 != 0) {
dunk(i);
return 0;
}
}
return 0;
}
m1025o1184t