摘要: 补给 可以O(n^2)做,枚举豁免量 #include<bits/stdc++.h> #define int long long using namespace std; const int N=1010; struct Node{ int p,s; }node[N]; bool cmp(Node 阅读全文
posted @ 2025-08-10 11:56 arin876 阅读(21) 评论(0) 推荐(0)
摘要: Matiji 每个都可以选或不选(丢给小号),直接dp #include<bits/stdc++.h> using namespace std; const int N=200010; int f[N][2]; int n,s; int p[N]; int main( ) { std::ios::s 阅读全文
posted @ 2025-08-10 11:22 arin876 阅读(116) 评论(0) 推荐(0)
摘要: 星际航行 经典结论,距离之和sum(|xi-t|)到中位数最小 至于要排成等差,i要到的位置为t+i,要求sum(|xi-(t+i)|)=sum(|xi-i-t|)减掉i之后就又是中位数了 或者三分也可以 #include<bits/stdc++.h> #define int long long u 阅读全文
posted @ 2025-08-08 19:45 arin876 阅读(22) 评论(0) 推荐(0)
摘要: 第五维度 枚举ban掉的人,可以二分得到此时人们理解第五维度的时间 ans选最久的时间即可 #include<bits/stdc++.h> using namespace std; #define int long long #define ll long long const int N=1000 阅读全文
posted @ 2025-08-07 16:52 arin876 阅读(15) 评论(0) 推荐(0)
摘要: cat学乘法 #include<bits/stdc++.h> using namespace std; #define int long long int n; int a[200010]; /* 10 5 -1 -2 -3 0 1 */ signed main( ) { std::ios::syn 阅读全文
posted @ 2025-08-06 18:02 arin876 阅读(27) 评论(0) 推荐(0)
摘要: 切排列 和第二场一样,映射 #include<iostream> using namespace std; const int N=200010; int n; int a[N];int mp[N];int b[N]; int main(){ int T;cin>>T; while (T--) { 阅读全文
posted @ 2025-08-03 11:29 arin876 阅读(93) 评论(0) 推荐(0)
摘要: A. chmod 模拟 F. Try a try, AC is OK gi&gj<=gi gi&gj<=gj 可以都交最大的,任意gi&gj<=gi<=gmax M. Window Decoration 观察菱形周围从近到远的点,发现只有以四个点为中心的会相交, 加进来稳定增加2,相交就减少 先要去 阅读全文
posted @ 2025-07-30 19:02 arin876 阅读(18) 评论(0) 推荐(0)
摘要: 数上的图 #include<iostream> using namespace std; #define ll long long ll n,x,y; ll cnt(ll x){ ll res=0; while(x){ if(x&1)res++; x>>=1; } return res; } ll 阅读全文
posted @ 2025-07-23 14:15 arin876 阅读(38) 评论(0) 推荐(0)
摘要: A. Kamilka and the Sheep 不妨设x<=y,两个数gcd小于这两个数 gcd(x+d,y+d)<=x+d<=y+d是我们常常知道的 也<=y-x x+d=k1(y-x) y+d=k2(y-x) y-x=(k2-k1)(y-x) 只要k2-k1=1,就可以任意d 所以可达y-x 阅读全文
posted @ 2025-07-13 01:04 arin876 阅读(25) 评论(0) 推荐(0)
摘要: A. Treasure Hunt mod(x+y)下,如果是在前一半就是A挖的,否则就是B B. Pushing Balls 某个球可能从某一行或某一列推过来, 给每一行每一列从头哪些位置是能推到的,也就是说从头开始连续的1,置为1 #include<iostream> using namespac 阅读全文
posted @ 2025-07-11 09:11 arin876 阅读(19) 评论(0) 推荐(0)