摘要: https://codeforces.com/problemset/problem/1332/B void solve(){ int n; cin >> n; vector<vector<int>> ans(1234); for (int i = 0; i < n; ++i){ int t; cin 阅读全文
posted @ 2024-03-14 21:03 _Yxc 阅读(38) 评论(0) 推荐(0)
摘要: https://codeforces.com/problemset/problem/1355/D We have a constructive problem where we need to construce an array with a required sum value using n 阅读全文
posted @ 2024-03-13 21:35 _Yxc 阅读(41) 评论(0) 推荐(0)
摘要: https://codeforces.com/contest/977/problem/D void solve(){ int n; cin >> n; vector<pair<int, long long>> a(n); for (auto&[x, y] : a){ cin >> y; x = 0; 阅读全文
posted @ 2024-03-12 22:16 _Yxc 阅读(44) 评论(0) 推荐(0)
摘要: 这是一个dp题,可以用4维数据来表示所有的状态。 但是有一个需要注意的点,一般来说,对于每个坐标,有拿跟不拿两种情况,如果没有拿任务宝物的状态表示为0,那么拿取了价值为0的宝物时,要以另一种情况来跟没拿区分。 处理的方法就是将所有宝物的价格+1。 long long dp[55][55][15][1 阅读全文
posted @ 2024-03-09 22:21 _Yxc 阅读(54) 评论(0) 推荐(0)
摘要: It's a simple problem on codeforces. we traverse the through the string n, if we encouter a '1', we add a new string to ans and set stop to false.Othe 阅读全文
posted @ 2024-03-09 21:25 _Yxc 阅读(39) 评论(0) 推荐(0)
摘要: https://codeforces.com/problemset/problem/762/A This is a easy problem based on number theory. We just simply iterate i from 1 to the value of sqrt(n) 阅读全文
posted @ 2024-03-08 21:55 _Yxc 阅读(43) 评论(0) 推荐(0)
摘要: https://codeforces.com/problemset/problem/277/A It presents a problem that we need to make all element connected, it can be solved by using dsu. I did 阅读全文
posted @ 2024-03-07 21:10 _Yxc 阅读(43) 评论(0) 推荐(0)
摘要: https://codeforces.com/problemset/problem/1490/E This is a chanllenging problem on codeforces with a diffcuilty score of 1400. It can be solved by usi 阅读全文
posted @ 2024-03-06 21:16 _Yxc 阅读(34) 评论(0) 推荐(0)
摘要: This a constructive problem on codeforces with a diffcuilty score of 1400. https://codeforces.com/problemset/problem/1463/B It's evident that we can a 阅读全文
posted @ 2024-03-05 21:27 _Yxc 阅读(53) 评论(0) 推荐(0)
摘要: https://codeforces.com/problemset/problem/550/B Brute force problem void solve(){ int n, l, r, x; cin >> n >> l >> r >> x; vector<int> a(n); for(auto& 阅读全文
posted @ 2024-03-05 21:25 _Yxc 阅读(41) 评论(0) 推荐(0)