摘要: 2 阅读全文
posted @ 2026-06-27 15:53 水暖鸭先知乎 阅读(4) 评论(0) 推荐(0)
摘要: #include #define endl '\n' using namespace std; typedef long long ll; bool solve(){ string str; cin>>str; ll len=str.size(); for(ll i=0;i>t; while(t-- 阅读全文
posted @ 2026-06-27 15:52 水暖鸭先知乎 阅读(2) 评论(0) 推荐(0)
摘要: //本题为反悔贪心,总结一下堆的知识,着重在于考察利用某些性质管理不同堆解决问题 //反悔贪心在于每次都比较一下是硬着头皮上还是选择反悔一次代价最小的 //如果是后者回报高,那就付出代价,把仅有的减免机会让给c组 //注意使用buy数组同步p和c组内已买过的物品,每一轮都要删掉已买的,保证一致性 # 阅读全文
posted @ 2026-06-26 20:49 水暖鸭先知乎 阅读(2) 评论(0) 推荐(0)
摘要: #include #define endl '\n' using namespace std; typedef long long ll; int main(){ ll n,m,q,u,v,t; cin>>n>>m>>q>>u>>v>>t; deque q1,q2,q3; for(ll i=0;i> 阅读全文
posted @ 2026-06-26 20:49 水暖鸭先知乎 阅读(4) 评论(0) 推荐(0)
摘要: #include #define endl '\n' using namespace std; typedef long long ll; int main(){ ll n; cin>>n; priority_queue r; priority_queue,greater> l; ll tmp; c 阅读全文
posted @ 2026-06-26 20:49 水暖鸭先知乎 阅读(2) 评论(0) 推荐(0)
摘要: #include #define endl '\n' using namespace std; typedef long long ll; int main(){ ios::sync_with_stdio(false);cin.tie(0); ll n; cin>>n; priority_queue 阅读全文
posted @ 2026-06-26 20:49 水暖鸭先知乎 阅读(12) 评论(0) 推荐(0)
摘要: #include #define endl '\n' using namespace std; typedef long long ll; int main(){ ll n; cin>>n; priority_queue,greater>pq; while(n--){ ll op; cin>>op; 阅读全文
posted @ 2026-06-26 20:49 水暖鸭先知乎 阅读(10) 评论(0) 推荐(0)
摘要: #include #define endl '\n' using namespace std; typedef long long ll; typedef pair pll; int main(){ ll n,k; cin>>n>>k; priority_queue,greater> pq; for 阅读全文
posted @ 2026-06-26 20:49 水暖鸭先知乎 阅读(6) 评论(0) 推荐(0)
摘要: #include #define endl '\n' using namespace std; typedef long long ll; struct node { ll w; ll a, b, c; ll cntx = 1; }; struct cmp { bool operator()(con 阅读全文
posted @ 2026-06-26 20:48 水暖鸭先知乎 阅读(6) 评论(0) 推荐(0)
摘要: #include #define endl '\n' using namespace std; typedef long long ll; typedef pair pll; unordered_map mp; void fid(char pos){ char l=mp[pos].first,r=m 阅读全文
posted @ 2026-06-26 20:46 水暖鸭先知乎 阅读(6) 评论(0) 推荐(0)