上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 39 下一页
摘要: # A - tcdr ```cpp #include using namespace std; int32_t main() { string s; cin >> s; for( auto i : s){ if( i != 'a' and i != 'e' and i != 'i' and i != 阅读全文
posted @ 2023-08-23 16:03 PHarr 阅读(41) 评论(0) 推荐(0)
摘要: # 概念 **连通** 在有向图中存在$u$到$v$的路径,则称$u$可达$v$。如果$u,v$互相可达,则$u,v$连通。 **强连通** 有向图$G$强连通指$G$中任意两个结点连通。 **强联通分量** 有向图的极大强连通子图。 # DFS 生成树 在有向图上进行 DFS 会形成森林。DFS会 阅读全文
posted @ 2023-08-22 19:30 PHarr 阅读(94) 评论(0) 推荐(0)
摘要: # A-Alien Sunset 这到题,用一个数组表示当前时间有多少个星球是夜晚,这样就转换成了区间修改单点查询。因为只查询一次,所以用差分即可。 ```cpp #include using namespace std; #define int long long const int m = 18 阅读全文
posted @ 2023-08-10 14:33 PHarr 阅读(110) 评论(0) 推荐(0)
摘要: # A. Array Coloring ```cpp #include using namespace std; void solve() { int n; cin >> n; int sum = 0; for( int i = 1 , x ; i > x , sum += x; if( sum % 阅读全文
posted @ 2023-08-09 10:27 PHarr 阅读(53) 评论(0) 推荐(0)
摘要: # A - To Be Saikyo ```cpp #include using namespace std; int main(){ ios::sync_with_stdio(0),cin.tie(0); int n; cin >> n; vector a(n); for( auto & i : 阅读全文
posted @ 2023-08-07 10:20 PHarr 阅读(26) 评论(0) 推荐(0)
摘要: # 600A. Extract Numbers 划分一下然后特判即可。 ```cpp #include using namespace std; int32_t main() { string s , t = ""; cin >> s; vector a , b; s += ";"; for( au 阅读全文
posted @ 2023-08-04 20:20 PHarr 阅读(23) 评论(0) 推荐(0)
摘要: # A. Berland Poker 先尽可能的吧小丑给一个人,在把剩下的小丑尽可能的平分,最后计算差值即可。 ```cpp #include using namespace std; void solve() { int n, m, k, t; cin >> n >> m >> k, t = n 阅读全文
posted @ 2023-08-02 17:38 PHarr 阅读(31) 评论(0) 推荐(0)
摘要: https://codeforces.com/contest/1487 # A. Arena 统计与最小值不同的数字数量。 ```cpp #include using namespace std; #define int long long const int M = (1 > n; vector 阅读全文
posted @ 2023-08-02 17:38 PHarr 阅读(16) 评论(0) 推荐(0)
摘要: # A - 把你砍成两半! 在本地找规律就会发现,当$a_1$确定时,$a_i$一定是$a_1$的倍数。所以答案就是 $$ \sum C_{\frac{n}{a_1}-1}^{k-1} $$ ```cpp #include using namespace std; #define int long 阅读全文
posted @ 2023-08-02 17:38 PHarr 阅读(61) 评论(0) 推荐(1)
摘要: # A. Calandar ```cpp #include using namespace std; #define int long long #define mp make_pair typedef pair pii; typedef pair psi; int res = LLONG_MIN; 阅读全文
posted @ 2023-08-02 12:47 PHarr 阅读(35) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 39 下一页