結果
| 問題 | No.136 Yet Another GCD Problem |
| コンテスト | |
| ユーザー |
bal4u
|
| 提出日時 | 2019-04-13 16:29:53 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
AC
|
| 実行時間 | 0 ms / 5,000 ms |
| + 897µs | |
| コード長 | 366 bytes |
| 記録 | |
| コンパイル時間 | 63 ms |
| コンパイル使用メモリ | 39,420 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-22 06:12:56 |
| 合計ジャッジ時間 | 1,974 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 39 |
ソースコード
// yukicoder: No.136 Yet Another GCD Problem
// 2019.4.13 bal4u
#include <stdio.h>
#include <math.h>
int main()
{
int a, b, N, K, ans;
scanf("%d%d", &N, &K);
if ((N & 1) == 0) ans = N >> 1;
else {
b = (int)sqrt(N);
for (a = 3; a <= b; a += 2) {
if (N % a == 0) break;
}
if (a > b) ans = 1;
else ans = N / a;
}
printf("%d\n", ans);
return 0;
}
bal4u