The Karting 2017ccpc网络赛 1008】的更多相关文章

The Karting championship will be held on a straight road. There are N keypoints on the road. The path between keypoint i and i+1 has a degree of difficulty Di(Di may be negative if the path is too smooth). Now the Organizers want to darw up some rout…
Two Rabbits Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 505    Accepted Submission(s): 260 Problem Description Long long ago, there lived two rabbits Tom and Jerry in the forest. On a sunny…
Problem Description Given a binary string S[1,...,N] (i.e. a sequence of 0's and 1's), and Q queries on the string.There are two types of queries:1. Flipping the bits (i.e., changing all 1 to 0 and 0 to 1) between l and r (inclusive).2. Counting the…
Palindrome Function As we all know,a palindrome number is the number which reads the same backward as forward,such as 666 or 747.Some numbers are not the palindrome numbers in decimal form,but in other base,they may become the palindrome number.Like…
Chinese Zodiac Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 2451    Accepted Submission(s): 1645 Problem Description The Chinese Zodiac, known as Sheng Xiao, is based on a twelve-year cycle,…
题目链接 网络赛的水实在太深,这场居然没出线zzz,差了一点点,看到这道题的的时候就剩半个小时了.上面是官方的题意题解,打完了才知道暴力就可以过,暴力我们当时是想出来了的,如果稍稍再优化一下估计就过了zzz.去年有一场现场赛也是n=1000,n^3过了,看来关键时刻实在做不出来就得大胆暴力啊. #include <bits/stdc++.h> using namespace std; typedef long long ll; ; int a[maxn],nex[maxn]; int main…
//大连网络赛 1006 // 吐槽:数据比较水.下面代码可以AC // 但是正解好像是:排序后,前i项的和大于等于i*(i-1) #include <bits/stdc++.h> using namespace std; #define LL long long typedef pair<int,int> pii; const double inf = 123456789012345.0; const LL MOD =100000000LL; ; #define clc(a,b)…
// 树形DP CCPC网络赛 HDU5834 Magic boy Bi Luo with his excited tree // 题意:n个点的树,每个节点有权值为正,只能用一次,每条边有负权,可以走多次,问从每个点出发的最大获益 // 思路: // dp[i]: 从i点出发回到i点的最大值 // d[i][0] 从i点出发不回来的最大值 // d[i][1] 从i点出发取最大值的下一个点 // d[i][2] 从i点出发取次大值 // dfs1处理出这四个 // 然后,从1开始转移,分别DP…
CCPC网络赛 HDU5839 Special Tetrahedron 题意:n个点,选四个出来组成四面体,要符合四面体至少四条边相等,若四条边相等则剩下两条边不相邻,求个数 思路:枚举四面体上一条线,再找到该线两个端点相等的点,放在一个集合里面. 要符合条件的话,则该集合里面找两个点,并且要判断一下. 注意,普通四面体会被重复计算两次,正四面体会重复计算六次 #include <bits/stdc++.h> using namespace std; #define LL long long…
Eliminate Witches! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1124    Accepted Submission(s): 426 Problem Description Kaname Madoka is a Magical Girl(Mahou Shoujo/Puella Magi). The duty of…
北京网络赛的题- -.当时没思路,听大神们说是分块+bitset,想了一下发现确实可做,就试了一下,T了好多次终于过了 题意: 初始有n个人,每个人有五种能力值,现在有q个查询,每次查询给五个数代表查询的五种能力值,输出有多少个人每种能力值都比查询的小 n和q都是50000,每种能力值最大也为50000 思路: 对于某一个大小的能力值,有哪些人的此项能力值比他小可以用一个50000的bitset表示.这样我们在查询的时候就可以拿到5个对应的bitset,对其进行and就可以得出最终的人数 这样每…
这题是某年成都区域赛网络赛的一题. 这题思路非常easy,可是从时间上考虑,不妨不要用矩阵存储,我用的链式前向星. 採用线上查询.利用map对字符串编号,由于非常方便.要推荐的朋友,事实上就是朋友的朋友(这里指的是直接朋友,图中即指有直接边相连的). 所以在寻找时,仅仅须要查找朋友的朋友,并计数. 注意:在输出时不能有对于的空格. 附代码: #include<iostream> using namespace std; #include<cstdio> #include<cs…
补题系列之西安网络赛1011 题目大意:给定一个椭球: 求它到原点的最短距离. 思路: 对于一个椭球的标准方程 x^2/a^2 + y^2/b^2 +z^2/c^2=1 来说,它到原点的最短距离即为min(a,b,c) 所以我们需要把原方程化为标准型. 这时候线代就排上用场了,注意到原方程是一个二次型. 化为标准型 1/(k1)*x^2+1/(k2)*y^2+1/(k3)*z^2=1 后  min(k1,k2,k3)即为答案 而这里的1/k1,1/k2,1/k3 就是二次型矩阵的特征值 如何求特…
HDU 4041 Eliminate Witches! (模拟题 ACM ICPC 2011 亚洲北京赛区网络赛题目) Eliminate Witches! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 863    Accepted Submission(s): 342 Problem Description Kaname Mado…
HDU 4046 Panda (ACM ICPC 2011北京赛区网络赛) Panda Time Limit: 10000/4000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1816    Accepted Submission(s): 632 Problem Description When I wrote down this letter, you may have…
题目链接:哈哈哈哈哈哈 _(:з」∠)_ _(:з」∠)_ _(:з」∠)_ _(:з」∠)_ _(:з」∠)_ 哈哈哈哈哈哈,从9月16日打了这个题之后就一直在补这道题,今天终于a了,哈哈哈哈哈哈. 先把代码贴上,有时间再好好写题解,哈哈哈哈哈哈. ヾ(◍°∇°◍)ノ゙ヾ(◍°∇°◍)ノ゙ヾ(◍°∇°◍)ノ゙ヾ(◍°∇°◍)ノ゙ヾ(◍°∇°◍)ノ゙ 代码,嘻嘻: #include<bits/stdc++.h> using namespace std; typedef long long ll…
http://poj.org/problem?id=2796 https://nanti.jisuanke.com/t/38228 背景 给定一个序列,对于任意区间,min表示区间中最小的数,sum表示区间和,求使得min*sum最大的区间或区间值. POJ-2796中,序列的值非负,而在网络赛I题中,序列存在负值. 解法分析 直觉上,后者是前者的拓展,我们先考虑序列非负的情况. 非负情况 设序列存储在数组a中.当我们考虑数值a[i]作为区间最小值时,显然我们应该向i的左右两侧扩展并终止于遇到更…
题意:四个操作,区间加,区间每个数乘,区间的数变成 2^64-1-x,求区间和. 题解:2^64-1-x=(2^64-1)-x 因为模数为2^64,-x%2^64=-1*x%2^64 由负数取模的性质可知 也就 =(2^64-1)*x%2^64 所以 2^64-1-x=2^64-1+(2^64-1)*x 所以第三个操作也就变成了区间乘 和区间加.  然后就是树剖加线段树多重标记.表示这是第一次写多重标记,整体凭感觉,细节看题解,树剖有点点遗忘,不过还好.今天看群里说邀请赛没什么价值,,细想一下那…
从省赛回来至今4周,每周周末都在打网络赛,每次都是划水,总结下自己弱弱的ACM吧!划水水~~ 首先是新疆赛区,基本上都是图论相关的东西,全靠队友,自己翻水水,实力躺了5道. 然后是沈阳赛区,终于有点贡献了,单刷一道LIS,和队友找规律完成了number number number,最后完成4道,成功划水~~不得不说一下就是对于1009提交的事情,似乎是引起了很大的轰动,但是其实就个人感觉而言,随机提交靠运气过,也不至于这么被骂,又不是用脚本恶意提交,别人凭本事手动提交300+次也是别人的本事,弱…
刚开学没多久就打了一个网络赛,通过这次网络赛我是发现我是真的菜... 放假前校赛的排名让我有些自满,寒假丝毫没有接触ACM,一直沉迷于Steam,这个真的值得好好反省. 虽然现在大一课有点多,在学校也有些事务,但是这些都不是我松懈的理由, 在此写下这篇博客就是为了提醒自己:Why(),How,What 这次比赛的反思: 数论的学习实在是太过于薄弱,要加强,对数字的规律不够敏感,要锻炼, 数据结构最常用的树,不会,要学, 这次题目总体不算特别难,题目的灵活度不大,关键自己会的知识太少. 题目链接…
2018 ICPC 沈阳网络赛 Call of Accepted 题目描述:求一个算式的最大值与最小值. solution 按普通算式计算方法做,只不过要同时记住最大值和最小值而已. Convex Hull 题目描述:定义函数\(gay(x)\),若\(x\)是某个非\(1\)的数的平方的倍数,则\(gay(x)=0\),否则\(gay(x)=x^2\),求\(\sum_{num=1}^{n} ( \sum_{i=1}^{num} gay(x) ) mod p\) solution \[\sum…
Theme Section Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 271    Accepted Submission(s): 121 Problem Description It's time for music! A lot of popular musicians are invited to join us in the…
Stone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 179    Accepted Submission(s): 137 Problem Description Tang and Jiang are good friends. To decide whose treat it is for dinner, they are pla…
Cut the Cake Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 300    Accepted Submission(s): 135 Problem Description MMM got a big big big cake, and invited all her M friends to eat the cake toge…
Poker Shuffle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 95    Accepted Submission(s): 24 Problem Description Jason is not only an ACMer, but also a poker nerd. He is able to do a perfect s…
Flyer Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 386    Accepted Submission(s): 127 Problem Description The new semester begins! Different kinds of student societies are all trying to adver…
Divide Groups Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 423    Accepted Submission(s): 161 Problem Description   This year is the 60th anniversary of NJUST, and to make the celebration mor…
Count The Pairs Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 277    Accepted Submission(s): 150 Problem Description   With the 60th anniversary celebration of Nanjing University of Science…
Walk Through Squares Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 200    Accepted Submission(s): 57 Problem Description   On the beaming day of 60th anniversary of NJUST, as a military colleg…
Mex Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 623    Accepted Submission(s): 209 Problem Description Mex is a function on a set of integers, which is universally used for impartial game t…