
思维题
Egqawkq
北航CS研一在读
展开
-
wannafly4 挑战杯 B.小AA的数列(区间异或和)
#include<bits/stdc++.h>using namespace std;typedef long long LL;const LL mod=1e9+7;int a[100005];int xorsum[100005];int dp[2][2];//i为下标奇偶,j为在此位前缀和有多少个奇数1int odd[100005];int n,L,R;LL ...原创 2017-11-29 21:53:13 · 430 阅读 · 0 评论 -
codeforces915E - Physical Education Lessons
/*看了刻盘老师关于我校acm现状的博客,感觉自己好菜啊,即使是除夕也感觉自己还时应该好好刷题吧,每天都要被菜醒。。。*/还是看题吧题意:数组中1-n是0,现在q次查询,每次给你l,r,k,k=1表示l-r区间内的0修改成1,k=2表示把1修改成0.每次输出1-n内的0的个数。思路:用map写,range(map名)【n】=1表示1-n都是0,所以range中会有多个元素,因为全为0的区间可能是断...原创 2018-02-15 21:51:50 · 543 阅读 · 0 评论 -
2015ccpc G - Ancient Go(围棋dfs爆搜)
点击打开链接题意:给定一个9*9的棋盘,问黑子能否在下一步将白子围住。由于数据不大,可以直接将'.'换成'x',用DFS搜索。AC code#include#include#include#includeusing namespace std;typedef long long ll;char chess[11]原创 2017-11-27 22:49:43 · 521 阅读 · 0 评论 -
codeforces 888 E. Maximum Subsequence(好题)
E. Maximum Subsequencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a consisting o原创 2017-11-15 15:00:28 · 780 阅读 · 0 评论 -
CodeForces - 859C Pie Rules DP(逆推)(思维好题)
http://blog.youkuaiyun.com/lxy767087094/article/details/78046760转载 2017-11-14 22:30:03 · 422 阅读 · 0 评论 -
codeforces 891-A. Pride Codeforces Round #446 (Div. 2) C. Pride
C. Pridetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have an array a with length n, you can perfo原创 2017-11-18 02:02:56 · 418 阅读 · 0 评论 -
Codeforces 888F. Connecting Vertices (Educational Codeforces Round 32 F. Connecting Vertices)
F. Connecting VerticesThere are n points marked on the plane. The points are situated in such a way that they form a regular polygon (marked points are its vertices, and they are numbered in原创 2017-11-12 20:53:34 · 898 阅读 · 0 评论 -
HDU 4814 Golden Radio Base(2013 ACM/ICPC 长春赛区现场赛)
Golden Radio BaseTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1219 Accepted Submission(s): 494Problem DescriptionGolden r原创 2017-10-15 10:11:24 · 360 阅读 · 0 评论 -
codeforces 701 D. As Fast As Possible
题目:点击打开链接参见下面的博客:点击打开链接AC code#includeusing namespace std;int main(){ int n, k; double l, v1, v2; cin >> n >> l >> v1 >> v2 >> k; int num = n / k; if (n%k != 0)/原创 2017-11-08 19:38:15 · 325 阅读 · 0 评论 -
codeforces 865B. Ordering Pizza
C. Ordering Pizzatime limit per test 2 secondsmemory limit per test 256 megabytesinput standard inputoutput standard outputIt's another Start[c]up finals, and t原创 2017-10-02 11:53:24 · 710 阅读 · 0 评论 -
Codeforces Round #436 (Div. 2)C. Bus codeforces 864C. Bus
C. Bustime limit per test 2 secondsmemory limit per test 256 megabytesinput standard inputoutput standard outputA bus moves along the coordinate line Ox from th原创 2017-09-26 20:41:42 · 529 阅读 · 0 评论