
补题
SDUTyangkun
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
解方程
解方程 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Problem Description 小璐有一天获得了一个形如 x | a = b的方程(a,b已知) ( |代表按位或) 她现在想要知道有多少个非负整数x能满足这个方程 聪明的你能帮帮她吗? Input 多组输入,每组输入两个原创 2016-08-31 22:36:26 · 597 阅读 · 0 评论 -
C - Magical GCD UVALive - 6582 (STL )
题意:就是找个连续子序列,使得长度乘上这个子序列的gcd的值最大。 #include using namespace std; #define ll long long mapv; map::iterator it,itt; ll a[110000]; int main() { int t; scanf("%d", &t); while(t--) {原创 2017-02-20 21:06:04 · 363 阅读 · 0 评论 -
Applications zoj 3705
Applications Time Limit: 2 Seconds Memory Limit: 65536 KB Recently, the ACM/ICPC team of Marjar University decided to choose some new members from freshmen to take part in the ACM/ICPC comp原创 2017-02-13 20:00:47 · 365 阅读 · 0 评论 -
cf B. Code For 1
B. Code For 1 time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jon fought bravely to rescue the wildlings wh原创 2017-02-22 09:04:38 · 746 阅读 · 0 评论 -
C - Cent Savings UVALive - 6952
注意动态规划的思路 就是由各个状态递推到下一个状态 规定dp【i】【j】为 第i跟数分割为j块 #include using namespace std; #define INF 0x3f3f3f3f int dp[2200][22]; int sum[2200]; int a[2200]; int main() { int n,d; while(~scanf("%d%d",原创 2017-02-22 16:00:11 · 540 阅读 · 0 评论 -
codefoces A. k-th divisor
A. k-th divisor time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given two integers n and k. Find原创 2017-01-26 13:00:28 · 747 阅读 · 0 评论 -
Finding Lines UVALive 6955(rand随机化过题 )
题意:给 n(10^5)个点,问是否满足超过%p的点在同一条直线上。 #include using namespace std; int x[101000],y[101000]; using namespace std; bool judge(int a, int b, int c)//判断三点是否共线 { return (y[b] - y[a]) * (x[c] - x[a]) =原创 2017-02-23 08:42:08 · 405 阅读 · 0 评论 -
(转)三分问题 + UVALive 6954 Euclidean TSP
三分查找 我们都知道 二分查找 适用于单调函数中逼近求解某点的值。 如果遇到凸性或凹形函数时,可以用三分查找求那个凸点或凹点。 下面的方法应该是三分查找的一个变形。 如图所示,已知左右端点L、R,要求找到白点的位置。 思路:通过不断缩小 [L,R] 的范围,无限逼近白点。 做法:先取 [L,R] 的中点 mid,再取 [mid,R] 的中点 mmid原创 2017-02-23 10:02:54 · 729 阅读 · 0 评论 -
UVALive 6953 Digi Comp II(拓扑)
题意: m个开关,n个球。每个开关有两个状态,左或右,左则滚到左边,右则滚到右边。每滚一个球状态则反转一次。问最后每个开关的状态是怎样的。 解题: 因为球数实在太多(10^18),一个一个模拟果断不行,而开关的最后状态只取决于滚过的球数和初始状态。所以计算出每个点球的流量并记录节点初始的状态即可。 注意:左右可以连同一个点!!!并且一开始不仅仅只有一为原创 2017-02-23 20:55:18 · 469 阅读 · 0 评论 -
Beehive UVALive - 7528
There is an infinite beehive like the one given in the figure. We consider two cells to be adjacent if andonly if they share a side. A path of length k from cell c0 to cell ck is a sequence of cells c原创 2017-02-21 14:23:58 · 462 阅读 · 0 评论 -
Problem on Group Trip UVALive - 7219
#include using namespace std; #define maxn 500 struct node { int s[4]; } p[maxn]; int room[4]; int flag[4]; int main() { int t; scanf("%d",&t); int cas = 1; while(t--) {原创 2017-02-18 14:49:40 · 401 阅读 · 2 评论 -
UVA 7360 run step(组合数学)
#include long long C(int a,int b) { long long ans=1; for(int i=0;i<b;i++) { ans*=(a-i); ans/=i+1; } return ans; } int main() { int t; int n; int i,j,k,原创 2016-10-10 16:57:04 · 360 阅读 · 0 评论 -
Minimum Inversion Number
Minimum Inversion Number Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1394 Description The inversion number of a given nu原创 2016-11-03 21:41:28 · 287 阅读 · 0 评论 -
Equal Sum Sets
Let us consider sets of positive integers less than or equal to n. Note that all elements of a set aredifferent. Also note that the order of elements doesnt matter, that is, both {3, 5, 9} and {5, 9,原创 2016-11-03 21:44:33 · 437 阅读 · 0 评论 -
Talented Chef
C - Talented Chef ZOJ - 3778 #include #include #define max(a,b) a>b?a:b using namespace std; int main() { int n; int m; int t; scanf("%d",&t); while(t--)原创 2017-01-14 18:40:18 · 373 阅读 · 0 评论 -
What day is that day?(打表找周期)
ZOJ 3785 What day is that day?(打表找周期) 题意: It's Saturday today, what day is it after 11 + 22 + 33 + ... + NN days? Input There are multiple test cases. The first line of input contains an原创 2017-01-14 18:45:58 · 633 阅读 · 0 评论 -
Paint the Grid Reloaded zoj3781(缩点+dfs + bfs 染色)
Paint the Grid Reloaded Time Limit: 2 Seconds Memory Limit: 65536 KB Leo has a grid with N rows and M columns. All cells are painted with either black or white initially. Two cells A and B原创 2017-01-14 23:47:31 · 396 阅读 · 0 评论 -
hdu Coconuts 5925(二维离散化+dfs)
Coconuts Time Limit: 9000/4500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 762 Accepted Submission(s): 223 Problem Description TanBig, a friend of原创 2017-02-17 08:49:54 · 457 阅读 · 0 评论 -
uva 7529 - DNA Sequencing
#include using namespace std; mapma; int num[10000]; int len[10000]; char s[550][550]; char tmp[5500]; int k, m, n; int main() { while(~scanf("%d%d",&n,&k)) { ma.clear(); if(!n原创 2017-02-17 14:54:13 · 462 阅读 · 0 评论 -
Basic Data Structure hdu 5929
Basic Data Structure Time Limit: 7000/3500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1366 Accepted Submission(s): 338 Problem Description Mr. Fr原创 2017-02-15 19:51:47 · 348 阅读 · 0 评论