結果
| 問題 |
No.136 Yet Another GCD Problem
|
| コンテスト | |
| ユーザー |
kyo1
|
| 提出日時 | 2020-11-26 16:42:14 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 347 bytes |
| コンパイル時間 | 2,813 ms |
| コンパイル使用メモリ | 191,000 KB |
| 最終ジャッジ日時 | 2025-01-16 05:50:17 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 12 WA * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, K;
cin >> N >> K;
int res = 1;
for (int i = 1; i < N + 1; i++) {
if (N % i == 0) {
int x = N / i;
int y = x / K;
if (x + 1 > K) res = max(res, i * y);
}
}
cout << res << '\n';
return 0;
}
kyo1