結果
| 問題 |
No.2078 魔抜けなパープル
|
| コンテスト | |
| ユーザー |
_yurimoir
|
| 提出日時 | 2022-10-06 22:30:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 596 bytes |
| コンパイル時間 | 1,463 ms |
| コンパイル使用メモリ | 174,440 KB |
| 実行使用メモリ | 6,420 KB |
| 最終ジャッジ日時 | 2024-06-11 09:11:57 |
| 合計ジャッジ時間 | 3,147 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | WA * 4 RE * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int q;
cin>>q;
while(q--){
int x,a;
cin>>x>>a;
vector<pair<double,ll>> tank(a);
for(int i=0;i<a;i++){
tank[i]={(double)(i+1)+(double)x/(i+1),(ll)i+1};
}
sort(tank.rbegin(),tank.rend());
int pos=a-1;
ll mp=0;
while(a){
while(a<tank[pos].second&&pos>=0)pos--;
a-=tank[pos].second;
mp+=(tank[pos].second)*(tank[pos].second)+x;
pos--;
}
cout<<mp<<endl;
}
}
_yurimoir