2017ACM/ICPC广西邀请赛 CS Course】的更多相关文章

题意:删除指定数字,求剩下数字的与或非值 解法:保存一下前缀和后缀 #include <iostream> #include <stdio.h> #include <vector> #include <string.h> #include <map> using namespace std; ],y1[],z1[]; ],y2[],z2[]; ]; map<int,int>Mp; int n,m; map<int,int>…
2017-08-31 16:19:30 writer:pprp 这道题快要卡死我了,队友已经告诉我思路了,但是做题速度很缓慢,很费力,想必是因为之前 的训练都是面向题解编程的缘故吧,以后不能这样了,另外这几天要学习一下动态规划, 先普及两个小知识点,这个点很简单很简单但是却卡了我很久很久, 现在作为模板记录下来: 1.将二进制数转化为十进制数 //转化为十进制 //test:ok ll twoTen(int a[]) { ll ans = ; ; i < N ; i++) { ans += (…
CS Course Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description Little A has come to college and majored in Computer and Science. Today he has learne…
HDU 6188 Duizi and Shunzi 链接:http://acm.hdu.edu.cn/showproblem.php?pid=6188 思路: 签到题,以前写的. 实现代码: #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<stack> #include<map&g…
上一场CF打到心态爆炸,这几天也没啥想干的 A Math Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description You are given a positive integer n, please count how many…
Problem Description Nike likes playing cards and makes a problem of it. Now give you n integers, ai(1≤i≤n) We define two identical numbers (eg: 2,2) a Duizi, and three consecutive positive integers (eg: 2,3,4) a Shunzi. Now you want to use these inte…
Problem Description Monkey A lives on a tree, he always plays on this tree. One day, monkey A learned about one of the bit-operations, xor. He was keen of this interesting operation and wanted to practise it at once. Monkey A gave a value to each nod…
Problem Description Bob's school has a big playground, boys and girls always play games here after school. To protect boys and girls from getting hurt when playing happily on the playground, rich boy Bob decided to cover the playground using his carp…
题意 给一颗\(n\)个节点的带点权的树,以\(1\)为根节点,\(q\)次询问,每次询问给出2个数\(u\),\(x\),求\(u\)的子树中的点上的值与\(x\)异或的值最大为多少 分析 先dfs一遍,得到dfs序,就可以将这个问题转化为求区间\([l,r]\)中的值与\(x\)异或值最大的经典问题, 就按dfs序建可持久化01字典树,查询的时候查区间\([in[u],out[u]]\)就行了,\(in[u]\)和\(out[u]\)存的分别是\(u\)的子树上的节点在dfs序上的起始位置和…
2017-08-31 16:48:00 writer:pprp 这个题比较容易,我用的是快速幂 写了一次就过了 题目如下: A Math Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description You are given a po…
A.A Math Problem #include <bits/stdc++.h> using namespace std; typedef long long ll; inline ll read(){ ,f=;char ch=getchar(); ;ch=getchar();} +ch-';ch=getchar();} return x*f; } /***********************************************************/ ; ll a[max…
题意:就是一个集合分开,有两种区分 对子:两个相同数字,顺子:连续三个不同数字,问最多分多少个 解法:贪心,如果当前数字不构成顺子就取对子 /2,如果可以取顺子,那么先取顺子再取对子 #include <iostream> #include <stdio.h> #include <vector> #include <string.h> #include <map> using namespace std; struct Node{ int x,y…
解法:发现..最多15个,那么..暴力一下啦 #include <iostream> #include <stdio.h> #include <vector> #include <string.h> #include <map> using namespace std; struct Node{ int x,y; }node[]; map<int,int>Mp; long long n; map<int,int>::ite…
Query on A Tree Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Others) Problem Description Monkey A lives on a tree, he always plays on this tree. One day, monkey A learned about one of the bit-operations, xor. He was…
Color it Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description Do you like painting? Little D doesn't like painting, especially messy color paint…
Duizi and Shunzi Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description Nike likes playing cards and makes a problem of it. Now give you n integers, a…
Covering Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description Bob's school has a big playground, boys and girls always play games here after school.…
Covering Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 187    Accepted Submission(s): 107 Problem Description Bob's school has a big playground, boys and girls always play games here after sch…
CS Course Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description Little A has come to college and majored in Computer and Science. Today he has learne…
题目链接  Problems HDOJ上的题目顺序可能和现场比赛的题目顺序不一样, 我这里的是按照HDOJ的题目顺序来写的. Problem 1001 签到 #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i(a); i <= (b); ++i) typedef long long LL; LL n, f[31]; int ans; int main(){ f[1] = 1LL; fo…
Rabbits Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1193    Accepted Submission(s): 628 Problem Description Here N (N ≥ 3) rabbits are playing by the river. They are playing on a number li…
整理代码... Little Boxes Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2304    Accepted Submission(s): 818 Problem Description Little boxes on the hillside.Little boxes made of ticky-tacky.Littl…
题目链接:http://icpc.njust.edu.cn/Contest/194/Problem/B B - TWO NODES 时间限制: 10000 MS 内存限制: 65535 KB 问题描述 Suppose that G is an undirected graph, and the value of  stab is defined as follows: Among the expression, G-i,-j  is the remainder after removing no…
上周末,我参加了icpc南昌区域赛邀请赛,这也是我的第一次外出参赛. 星期五晚上,在6个小时的火车和1个小时的公交后,我们终于抵达了江西师范大学,这次的比赛场地.江西师范大学周围的设施很齐全,各种烧烤,大型商场,地铁应有尽有,去酒店办好入住手续,放下东西后,我们便去吃饭,听说南昌的小龙虾很不错,我们就选择了一家烧烤店吃起了烧烤.还是很高兴的,就是因为吃太多了晚上睡不着有点休息不好. 第二天早上,大家都起到很晚,我9点钟醒时还没有人醒,等到10:30我们一起去签到,收获了自己的第一件参赛衣服,同时…
题目链接:http://acm.bnu.edu.cn/bnuoj/problem.php?search=2014+ACM-ICPC+Beijing+Invitational+Programming+Contest 总共十道题, 又结束了一场逗比的比赛, 感觉后半场都在梦游,结果被虐了!!!!大家都虐我一万里啊. 正如wushen说的,“那些被虐过的比赛,唯有赛后AK掉来泄愤.” 本弱太菜,还达不到AK的境界,只能搞出这场的8道题. A A Matrix 一个很神奇的题目,全场就坑在这题了,其实应…
CS Course Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 593    Accepted Submission(s): 288 Problem Description Little A has come to college and majored in Computer and Science.Today he has lea…
A: A Math Problem 题意:给出一个n,找出有多少个k满足kk  <= n 思路: kk的增长很快,当k == 16 的时候就已经超过1e18 了,对于每一次询问,暴力一下就可以 #include <bits/stdc++.h> using namespace std; typedef long long ll; ll n; inline ll qpow(ll x, ll n) { ll ans = ; ll base = x; while (n) { ) ans = an…
[题意]给定N个点,每个点有一个停留所需的时间Ci,和停留能够获得的满意度Si,有M条边,每条边代表着两个点走动所需的时间ti,现在问在规定的T时间内从指定的一点S到E能够获得的最大的满意度是多少?要求停留的点的满意度要依次上升,并且每个点可以选择路过和停留. 好题,收获很大-- 收获一:分层图的应用 收获二:越来越觉得Bellman-Ford or SPFA就是一种图上的DP,不仅仅是求最短路,更可以求某类最优问题. 收获三:像这种点有路过和停留两种状态的题目可以试着Floyd预处理,方便地处…
A Math Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 817    Accepted Submission(s): 344 Problem Description You are given a positive integer n, please count how many positive integers…
就是求区间和与区间最小值的积的最大值 但是a[i]可能是负的 这就很坑 赛后看了好多dalao的博客 终于a了 这个问题我感觉可以分为两个步骤 第一步是对于每个元素 以它为最小值的最大区间是什么 第二步是找出来在这个区间里面 最大的连续和多少 那么我们怎么找到第一步这个最大区间呢 可以先找这个元素左边第一个比他小的值的下标 和右边第一个比他小的值的下标 这两个下标确定了 最大区间就确定了 怎么找这个下标呢 暴力的话时间复杂度太高 是n^2 需要使用单调栈: 单调栈 顾名思义就是元素都是单调递增或…