結果
| 問題 |
No.312 置換処理
|
| コンテスト | |
| ユーザー |
nCk_cv
|
| 提出日時 | 2015-12-06 23:32:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 2,000 ms |
| コード長 | 470 bytes |
| コンパイル時間 | 851 ms |
| コンパイル使用メモリ | 72,320 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-15 11:57:08 |
| 合計ジャッジ時間 | 2,313 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 45 |
ソースコード
#include <iostream>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <map>
#include <queue>
#define ll long long
int main() {
ll N;
std::cin >> N;
ll ss = sqrt(N)+1L;
ll ans = -1L;
for(ll i = 3L; i <= ss; i++) {
if(N % i == 0L) {
ans = i;
break;
}
}
if(ans == -1L) {
ans = N;
}
if(N % 2 == 0 && N >= 6) {
ans = std::min(ans,N/2);
}
std::cout << ans << std::endl;
}
nCk_cv