結果
問題 | No.312 置換処理 |
ユーザー |
![]() |
提出日時 | 2019-04-19 13:29:02 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 12 ms / 2,000 ms |
コード長 | 349 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 30,464 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-15 12:27:06 |
合計ジャッジ時間 | 1,370 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
ソースコード
// yukicoder: No.312 置換処理// 2019.4.19 bal4u#include <stdio.h>#include <math.h>int main(){int b, a;long long N, ans;scanf("%lld", &N);ans = N, b = (int)sqrt((double)N);if ((N & 1) == 0 && N != 4) ans = N >> 1;for (a = 3; a <= b; a++) {if (N % a == 0) break;}if (a <= b) ans = a;printf("%lld\n", ans);return 0;}