摘要: 切排列 和第二场一样,映射 #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 阅读(90) 评论(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 阅读(17) 评论(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 阅读(34) 评论(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 阅读(21) 评论(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 阅读(15) 评论(0) 推荐(0)
摘要: A. Dora's Set C. Dora and C++ #include<iostream> using namespace std; #include<vector> #include<algorithm> #define ll long long const int N=100010; ll 阅读全文
posted @ 2025-07-10 19:58 arin876 阅读(9) 评论(0) 推荐(0)
摘要: A. Bus to Pénjamo #include<iostream> using namespace std; #include<algorithm> int a[110]; int n,r; int main(){ int T;cin>>T; while(T--){ cin>>n>>r; fo 阅读全文
posted @ 2025-07-10 13:12 arin876 阅读(15) 评论(0) 推荐(0)
摘要: C. Light Switches 所有灯周期均为2k,需要找到一个mod(2k)的数res,让所有到这个时刻都是亮的 投影到[0,2k-1]的数组,有的跨过头尾,要破环成链,[0,4k-1]。找到res,因为周期2k,所以这样的res2k内只有一个,加到4k上跨过的只加一遍,就可以保证4k内只有一 阅读全文
posted @ 2025-07-09 13:09 arin876 阅读(3) 评论(0) 推荐(0)
摘要: A. Find K Distinct Points with Fixed Center 简单构造 B. Minimize Equal Sum Subarrays 开始想正序倒序 看出来错一位就每个区间都严格比上面大 C. Perform Operations to Maximize Score 相当 阅读全文
posted @ 2025-07-08 08:45 arin876 阅读(21) 评论(0) 推荐(0)
摘要: A. Profitable Interest Rate 降到最高的限度,特判 B. Buying Lemonade 对于每次按,最坏的情况就是空的,之后记住这个是空的 所以优先保证不空 先每个按mi次,必然都不空 再就可能按空的,最坏就是把空的都按到,再就又可以按mi次 最后发现也就是较少的一半按钮 阅读全文
posted @ 2025-07-07 16:38 arin876 阅读(8) 评论(0) 推荐(0)