2017ACM总结】的更多相关文章

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…
#include<bits/stdc++.h> using namespace std; typedef long long LL; #define ms(a,x) memset(a,x,sizeof(a)) int n,m,ans; ]; struct node { int u,v; } e[]; vector<]; int main() { // freopen("test.txt","r",stdin); int T; scanf("…
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…
HDU 6225 Little Boxes 题意 计算四个整数的和 解题思路 使用Java大整数 import java.math.BigInteger; import java.util.Scanner; /** * * @author reqaw */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner in =…
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…
HDU 6222 Heron and His Triangle 链接:http://acm.hdu.edu.cn/showproblem.php?pid=6222 思路: 打表找规律+大数运算 首先我们可以打个表暴力跑出前几个满足题意的T 打表代码: #include<bits/stdc++.h> using namespace std; bool fun(double n) { if(abs(round(n) - n) < 0.000000000000001) ; ; } int ma…
题意 给一颗\(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序上的起始位置和…
题目链接 Problem Description At Valentine's eve, Shylock and Lucar were enjoying their time as any other couples. Suddenly, LSH, Boss of FFF Group caught both of them, and locked them into two separate cells of the jail randomly. But as the saying goes:…
题目链接 Problem Description Giving two strings and you should judge if they are matched. The first string contains lowercase letters and uppercase letters. The second string contains lowercase letters, uppercase letters, and special symbols: "." an…
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…
题目链接 Problem Description The Eternal Fleet was built many centuries ago before the time of Valkorion by an unknown race on the planet of Iokath. The fate of the Fleet's builders is unknown but their legacy would live on. Its first known action was in…
题目链接 Problem Description The Death Star, known officially as the DS-1 Orbital Battle Station, also known as the Death Star I, the First Death Star, Project Stardust internally, and simply the Ultimate Weapon in early development stages, was a moon-si…
题目链接 Problem Description Galen Marek, codenamed Starkiller, was a male Human apprentice of the Sith Lord Darth Vader. A powerful Force-user who lived during the era of the Galactic Empire, Marek originated from the Wookiee home planet of Kashyyyk as…
题目链接 Problem Description Kyber crystals, also called the living crystal or simply the kyber, and known as kaiburr crystals in ancient times, were rare, Force-attuned crystals that grew in nature and were found on scattered planets across the galaxy.…
题目链接 Problem Description There are n nonnegative integers a1-n which are less than p. HazelFan wants to know how many pairs i,j(1≤i<j≤n) are there, satisfying 1ai+aj≡1ai+1aj when we calculate module p, which means the inverse element of their sum equ…
题目链接 Problem Description HazelFan wants to build a rooted tree. The tree has n nodes labeled 0 to n−1, and the father of the node labeled i is the node labeled ⌊i−1k⌋. HazelFan wonders the size of every subtree, and you just need to tell him the XOR…
题目链接 Problem Description There is a nonnegative integer sequence a1...n of length n. HazelFan wants to do a type of transformation called prefix-XOR, which means a1...n changes into b1...n, where bi equals to the XOR value of a1,...,ai. He will repea…
题目链接 Problem Description There are n points on the plane, and the ith points has a value vali, and its coordinate is (xi,yi). It is guaranteed that no two points have the same coordinate, and no two points makes the line which passes them also passes…
题目链接 Problem Description Bob has a dictionary with N words in it. Now there is a list of words in which the middle part of the word has continuous letters disappeared. The middle part does not include the first and last character. We only know the pr…
题目链接 Problem Description The center coordinate of the circle C is O, the coordinate of O is (0,0) , and the radius is r. P and Q are two points not outside the circle, and PO = QO. You need to find a point D on the circle, which makes PD+QD minimum.…
题目链接 Problem Description Alice and Bob are playing a game called 'Gameia ? Gameia !'. The game goes like this : There is a tree with all node unpainted initial. Because Bob is the VIP player, so Bob has K chances to make a small change on the tree an…
题目链接 Problem Description We define the distance of two strings A and B with same length n is disA,B=∑i=0n−1|Ai−Bn−1−i| The difference between the two characters is defined as the difference in ASCII. You should find the maximum length of two non-over…
题目链接 Problem Description The school set up three elective courses, assuming that these courses are A, B, C. N classes of students enrolled in these courses. Now the school wants to count the number of students who enrolled in at least one course in e…
题目链接 Problem Description Give an array A, the index starts from 1. Now we want to know Bi=maxi∤jAj , i≥2. Input The first line of the input gives the number of test cases T; T test cases follow. Each case begins with one line with one integer n : the…
题目链接 Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them: There are n children and m kinds of candies. The ith child has Ai dollars and the…
题目链接 Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them: For an undirected graph G with n nodes and m edges, we can define the distance bet…
题目链接 Problem Description In mathematics, the function d(n) denotes the number of divisors of positive integer n. For example, d(12)=6 because 1,2,3,4,6,12 are all 12's divisors. In this problem, given l,r and k, your task is to calculate the followin…