結果
| 問題 | No.885 アマリクエリ |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2020-09-14 11:00:36 |
| 言語 | cLay (20250308-1 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 119 ms / 2,000 ms |
| + 804µs | |
| コード長 | 297 bytes |
| 記録 | |
| コンパイル時間 | 1,499 ms |
| コンパイル使用メモリ | 195,624 KB |
| 実行使用メモリ | 17,664 KB |
| 最終ジャッジ日時 | 2026-08-08 00:33:45 |
| 合計ジャッジ時間 | 3,539 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
map<int,int>a;ll x,s;
void f(){
if(!a.empty()){
auto b=a.begin();
int c=-b->first;
if(c>=x){
int d=b->second;
a.erase(b);
int e=c%x;
s+=1ll*d*(e-c);
f();
a[-e]+=d;
}
}
}
{
rd(x);
REP(x){
rd(x);
++a[-x];
s+=x;
}
rd(x);
REP(x){
rd(x);
f();
wt(s);
}
}
tails