上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 20 下一页
摘要: 网址 想说一下昨晚的cf吧 A t组样例,n * m 要求黑格(周围至少有一个白格)比白格(周围至少有一个黑格)多一个 最笨的就是想跟着题意走,把所有的格一分为二(巴拉巴拉) 似乎也不太好实现 实际上让第一个格为白色 其他的为黑色 本题OK 了 B t组样例,n数据个数,接下来两行分别是ab数组 其 阅读全文
posted @ 2020-04-09 11:21 Hazelxcf 阅读(155) 评论(0) 推荐(0)
摘要: 链接 T组样例 n个数和k(最少移动的次数) 非递减序列 求最少移动k步 F(N)最大的值 思路: 非递减序列说明是递增的,也就是最开始的F(N)是最大的,现在移动了还要保证最大,也就是移动最少的步数,k步,求和自然要想到前缀和 be记录原始序列的和 sum[]记录前缀和 now 记录现在的 ans 阅读全文
posted @ 2020-04-07 20:49 Hazelxcf 阅读(154) 评论(0) 推荐(0)
摘要: https://vjudge.net/problem/POJ-3723 n个女的,m个男的,选择一个战士需要花费10000,如果有亲密关系,需要花费10000-d; 花费最小 用了cin加了优化超时了,后来改了scanf之后答案错误 后来把e等从0开始(下标) 过了 #include <iostre 阅读全文
posted @ 2020-04-06 17:39 Hazelxcf 阅读(168) 评论(0) 推荐(0)
摘要: https://vjudge.net/problem/POJ-3255 #include <iostream> #include <cstring> #include <queue> #include <vector> using namespace std; typedef pair<int, i 阅读全文
posted @ 2020-04-06 15:51 Hazelxcf 阅读(121) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; #define int long long const int mod = 100001; string str; int s,sj,g; int ans; signed main(){ ios::sync_ 阅读全文
posted @ 2020-04-03 20:39 Hazelxcf 阅读(181) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1638 #include <bits/stdc++.h> using namespace std; #define int long long const int maxn = 1e6 + 10; int n,m; int a[m 阅读全文
posted @ 2020-04-02 10:47 Hazelxcf 阅读(209) 评论(0) 推荐(0)
摘要: 第一次接触这个概念还是去年暑假,当时做一个题,说到了尺取法,当时只是觉得尺取尺取嘛,很简单的,然后也就没有然后了,到了今天才发现,自己有多么菜。好了,不说废话了,(虽然我也不是觉得前面是废话)开始今天的主题吧! https://www.nowcoder.com/discuss/180336?type 阅读全文
posted @ 2020-04-02 10:34 Hazelxcf 阅读(147) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/4853/C #include <bits/stdc++.h> using namespace std; #define int long long const int maxn = 1e3 + 5; const int mod 阅读全文
posted @ 2020-03-28 09:57 Hazelxcf 阅读(160) 评论(0) 推荐(0)
摘要: 我们按位考虑,那么每一位的贡献就是在二进制下这一位在n个数中出现的次数的平方乘上二进制的系数。 #include <bits/stdc++.h> using namespace std; #define int long long const int maxn = 1e5 + 5; int n, a 阅读全文
posted @ 2020-03-28 09:10 Hazelxcf 阅读(144) 评论(0) 推荐(0)
摘要: https://www.acwing.com/problem/content/description/98/ 假设有A,B,C,D四个,在A上有n个。要移动到D上 在4塔的情况下 先移动i个到B上,在移动剩下的n - i个到D上(此时是在3塔的情况下) #include <bits/stdc++.h 阅读全文
posted @ 2020-03-27 18:25 Hazelxcf 阅读(166) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 20 下一页