} inline void change(int x, int L, int R, int c) { int l = t[x].l, r = t[x].r; if (L <= l && R >= r) { t[x].dat += c; t[x].lazy += c; return; } push_down(x); int mid = l + r >> 1...
C - Product题目描述:给你nn个桶,第ii个桶里面有LiLi个气球,每个气球上有一个数字,再给你一个正整数xx,问你在每一个桶里面选一个气球使得其上的数字乘起来与xx相等的方案数。数据范围:N≥2Li≥2N∏i=1Li≤1051≤x≤1018N≥2Li≥2∏i=1NLi≤1051≤x≤1018...
ABC233G - Strongest Takahashi 简要题意:给定一张N×N(1≤N≤50)网格,里面若干个格子有障碍。每次可以选择一个D×D的区域然后消耗D点体力将其中的障碍消去。问将所有障碍消去的最小体力消耗。 这种高维度的 dp 一直是我的弱点。。。考虑一个A×B的矩形区域(子问题),我们显然需要C=max(A,B)的体力来覆盖...
abc208 C - Fair Candy Distribution 座標圧縮 abc263 C - Monotonically Increasing itertools abc232 C - Graph Isomorphism itertools abc215 C - One More aab aba baa itertools abc250 D - 250-like Number 素数 abc215 D - Coprime 2 素因数分解 abc233 C - Product DFS abc236 D - Dance DFS ab...
$cf$ 自闭了,打 $abc$ 散散心 A - 9x9 ...这个有什么好讲的吗,题目看懂就会做了 AI检测代码解析 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> using namespace std; typedef long long ll; ...
Search or jump to... Search code, repositories, users, issues, pull requests... Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your...
题目地址:https://atcoder.jp/contests/abc370/tasks ABC373题解(文字版) ►A代码 参考代码 #include<bits/stdc++.h>usingnamespacestd; intmain{intans =0;for(inti =1;i <=12;++i){charstr[233];scanf("%s",str);if(strlen(str) == i) ++ans;}printf("%d\n",ans);return0;} ...
题目地址:https://atcoder.jp/contests/abc362/tasks 题目讲解(识别下方二维码可查看视频题解): ► 代码 #include<bits/stdc++.h> #definefi first#definese second#defineDB double#defineU unsigned#defineP std::pair#defineLL long long#defineLD long double#definepb emplace_back#definepf emplace_front...
ABC233Ex #include<bits/stdc++.h>usingnamespacestd;structPoint{intx,y;Point(int_x=0,int_y=0):x(_x),y(_y){}};booloperator<(constPoint&lhs,constPoint&rhs){returnlhs.x!=rhs.x?lhs.x<rhs.x:lhs.y<rhs.y;}constintN=1e5+10,INF=0x3f3f3f3f;intn;Point P[N];vector<int>lsh[2]...
神奇的代码 G - Merchant Takahashi (abc353 G)题目大意nn个城市,给定 cc,定义了从城市 i→ji→j的花费为 c|i−j|c|i−j|。有mm个活动依次举行,第 ii个活动 在第titi个城市举行,参加则获得 pipi收益。初始在第 11个城市,问如何选择参加活动,使得收益最大化。解题思路...