How Many Answers Are Wrong Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3404    Accepted Submission(s): 1310 Problem Description TT and FF are ... friends. Uh... very very good friends -_____…
Problem Description TT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin with, TT should write down a sequence of integer…
思路跟 LA 6187 完全一样. 我是乍一看没反应过来这是个并查集,知道之后就好做了. d[i]代表节点 i 到根节点的距离,即每次的sum. #include <cstdio> #include <cstring> #include <cstdlib> ; int N, Q; int p[MAXN]; int d[MAXN]; int FindSet( int x ) { if ( p[x] == x ) return x; int root = FindSet(…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3038 题意:就是给出n个数和依次m个问题,每个问题都是一个区间的和,然后问你这些问题中有几个有问题,有问题的直接忽略. 每个问题给出a-b之间的和为s,其实就是val(b)-val(a-1)的值为s,这样就容易想到用向量的方法来求解 #include <iostream> #include <cstring> #include <cmath> #include <cs…
http://acm.hdu.edu.cn/showproblem.php?pid=3038 How Many Answers Are Wrong Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3648 Accepted Submission(s): 1401 Problem Description TT and FF are ... fri…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3038 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description TT and FF are ... friends. Uh... very very good friends -________-b FF is a bad boy, he is always…
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=3038 How Many Answers Are Wrong Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15582    Accepted Submission(s): 5462 Problem Description TT and FF…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5458 Problem Description Given an undirected connected graph G with n nodes and m edges, with possibly repeated edges and/or loops. The stability of connectedness between node u and node v is defined by…
hdu 1811 Rank of Tetris Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Description 自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球. 为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响.关于如何排名,这个不用说都知道是根据R…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1856 题意:朋友圈问题,A和B是朋友,B和C是朋友则A和C也是朋友,依次类推,题目的意思就是求最大的朋友圈,即求最大集合中元素的个数.裸的并查集加个秩数组就行了. #include <stdio.h> ]; ]; int Find_Set (int x) { if(x!=father[x]) father[x] = Find_Set(father[x]); return father[x]; }…