正文
增加 2 行删除 4 行
28 行未改动2930313233343536373856 行未改动959697989910010110210320 行未改动12412512612712812913013113241 行未改动28 行未改动如果当前没有可用的锅,合并最大的两个锅。做完了。细节有点多,看代码吧。以及,虽然没卡,小心爆 `long long`,大数乘法运算记得开 `__int128`。# Code```cpp#include <bits/stdc++.h>56 行未改动ans++;// cerr << "MG\n";continue;}if((__int128)gv * mcnt <= c) {c -= gv * mcnt;// cerr << mcnt << "YES\n";if(cnt - mcnt > 0) {mp[vl] += cnt - mcnt;20 行未改动}// cerr << (*p).first << " has " << (*p).second << "\n";int cl = (*p).first - l + 1;int cs = (*p).second;__int128 ac = cl * cs;// cout << l << " find " << (*p).first << " have " << cs << "\n";if(ac <= c) {c -= ac;mp[l - 1] += cs;41 行未改动28 行未改动293031323334353656 行未改动9394959697989910010120 行未改动12212312412512612712812913041 行未改动28 行未改动如果当前没有可用的锅,合并最大的两个锅。做完了。细节有点多,看代码吧。# Code```cpp#include <bits/stdc++.h>56 行未改动ans++;// cerr << "MG\n";continue;}if(gv * mcnt <= c) {c -= gv * mcnt;// cerr << mcnt << "YES\n";if(cnt - mcnt > 0) {mp[vl] += cnt - mcnt;20 行未改动}// cerr << (*p).first << " has " << (*p).second << "\n";int cl = (*p).first - l + 1;int cs = (*p).second;int ac = cl * cs;// cout << l << " find " << (*p).first << " have " << cs << "\n";if(ac <= c) {c -= ac;mp[l - 1] += cs;41 行未改动