2017ACM/ICPC Guangxi Invitational Solution】的更多相关文章

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…
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…
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序上的起始位置和…