• 2024-06-05ABC354
    Cmultiset和sort,同时维护两个数组,好题,力量最强的并且花费最小的#include<bits/stdc++.h>usingnamespacestd;constintN=3e5+20;structNode{inta,c,id;//a是力量,c是花费,id是编号booloperator<(constNode&t)const{returna<t.a;
  • 2024-05-22ABC354
    Alink模拟整个过程即可。点击查看代码#include<bits/stdc++.h>#defineintlonglongusingnamespacestd;signedmain(){ inth; cin>>h; intday=1ll,g=0ll; while(g<h){ g+=(1ll<<day); day++; } cout<<day; return
  • 2024-05-20ABC354 E - Remove Pairs 做题笔记
    ABC354E-RemovePairs做题笔记题目链接对于这种带有博弈论的dp,考虑这样设计状态:令\(f_s\in\{1,0\}\)表示“游戏局面”为\(s\)时,先手必胜还是必败。本题中,“游戏局面”可以表示为剩余卡牌的编号集合。又因为本题中\(N\)​很小,通过状压,可以直接用一个int表示游戏
  • 2024-05-19「杂题乱刷」AT_abc354_f
    大家一起来做下这个典题。链接(at)链接(luogu)我们很容易可以想到处理前后缀的最长上升子序列的长度,然后容易\(O(n\log_2n)\)预处理。做完了。点击查看代码/*Tips:你数组开小了吗?你MLE了吗?你觉得是贪心,是不是该想想dp?一个小时没调出来,是不是该考虑换题?打cf不要
  • 2024-05-19[ABC354D]
    https://www.luogu.com.cn/problem/AT_abc354_dhttps://atcoder.jp/contests/abc354/tasks/abc354_d由图片可知,很显然每个\(4\times2\)​网格(称为单位网格)都是全等的。为了方便,将\(A,B,C,D\)都增加\(10^9\),因为\(10^9\bmod4=10^9\bmod2=0\),所以图形没有变化。(很重要,这
  • 2024-05-18ABC354
    A.ExponentialPlant模拟代码实现h=int(input())now,day=0,0whilenow<=h:now+=1<<dayday+=1print(day)B.AtCoderJanken2模拟代码实现#include<bits/stdc++.h>#definerep(i,n)for(inti=0;i<(n);++i)usingname