結果
| 問題 | No.2078 魔抜けなパープル |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-12 21:38:47 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 422 bytes |
| 記録 | |
| コンパイル時間 | 503 ms |
| コンパイル使用メモリ | 80,400 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-06-28 21:59:51 |
| 合計ジャッジ時間 | 1,395 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 |
ソースコード
#include <iostream>
using namespace std;
typedef long long ll;
const ll INF = 1000000000000000000;
int main()
{
int t;
cin >> t;
while (t--)
{
ll x, a;
cin >> x >> a;
ll ans = INF;
for (int i = 1; i <= a; i++)
{
ans = min(ans, a % i * (a / i + 1) * (a / i + 1) + (i - a % i) * (a / i) * (a / i) + x * i);
}
cout << ans << endl;
}
}