07 2023 档案
摘要:1003 把所有的排个序 然后根据贪心,一定是取连续的段 尺取法取所有可能的段即可( #include <bits/stdc++.h> #define pii pair<int,int> using namespace std; vector<pii> a; int mp[1000005];
阅读全文
摘要:1005 直接dp即可 #include <bits/stdc++.h> using namespace std; int dp[5005][5005]; int N; int a[5005]; const int MOD = 1e9+7; int main(){ int T; cin >> T;
阅读全文
摘要:A 签到,注意的特判 #include <bits/stdc++.h> using namespace std; long long x,y; int main(){ string s1,s2; cin >> s1; cin >> s2; int Len1 = s1.length(); int
阅读全文
摘要:依旧是随便写点东西( D 根据sample input猜测从后往前贪心即可 #include <bits/stdc++.h> using namespace std; int N,M; int T; bool vis[5005]; int a[2005][2005]; int main(){ cin
阅读全文
摘要:1001 求个SG然后打表 发现的点满足 #include <bits/stdc++.h> using namespace std; int T,N; int main(){ cin >> T; while (T--){ int N,
阅读全文
摘要:手还是有点生( 随便写点东西.jpg 1001 实际上把链找出来之后就可以把树扔了( 然后在某个位置上出现的点它的出现位置就可以表示为,是位置 对于的每个数字,找它在的位置,能拿到两个同余方程,形如和$x = t_2 (mod m)
阅读全文
摘要:牛客第一场 好久没搞算法了,手好生( D 签到,队友写的( J 不难发现一次输输输赢的过程可以赢一块钱 问题就转化成了在**m**轮里,是否能每次都在不输完本金的情况下赢一把 显然这个概率是,表示当前轮输掉本金 显然是从取到$lo
阅读全文