轻量级前端框架助力开发者提升项目效率与性能
628
2022-11-12
2015 Multi-University Training Contest 5
比赛链接:click here~~
hdu 5344 MZL's xor
【题意】:
Problem Description
MZL loves xor very much.Now he gets an array A.The length of A is n.He wants to know the xor of all (Ai+Aj)(1≤i,j≤n) The xor of an array B is defined as B1 xor B2...xor Bn
Input
Multiple test cases, the first line contains an integer T(no more than 20), indicating the number of cases. Each test case contains four integers:n,m,z,lA1=0,Ai=(Ai−1∗m+z) mod l1≤m,z,l≤5∗105,n=5∗105
Output
For every test.print the answer.
Sample Input
2 3 5 5 7 6 8 8 9
Sample Output
14 16
根据公式递推数列后几项,然后两两相加异或,看完题写完,然后看到5*10^5的范围,居然不敢交,以为要什么优化,然后最后发现当ai!=aj时,(ai+aj)和(aj+ai)抵消,所以最后答案就是相加异或输出就ok了。
代码:
/*************hdu 5344 **************#include
hdu 5349 MZL's simple problem
【题意】RT:
Problem Description
A simple problem Problem Description You have a multiple set,and now there are three kinds of operations: 1 x : add number x to set 2 : delete the minimum number (if the set is empty now,then ignore it) 3 : query the maximum number (if the set is empty now,the answer is 0)
Input
The first line contains a number N (N≤106),representing the number of operations. Next N line ,each line contains one or two numbers,describe one operation. The number in this set is not greater than 109.
Output
For each operation 3,output a line representing the answer.
Sample Input
6 1 2 1 3 3 1 3 1 4 3
Sample Output
3 4
【题意】RT
代码:
#include
hdu 5351 MZL's Border
【题意】:
给出一个斐波那契字符串,求截取前m个字符串得到之后的最大重复子串
ps:最后一个小时推出了规律,就是斐波那契数列!调试完大数模板,在比赛最后一分钟提交,可惜超内存了囧~~最后题目拉到hduoj上之后,改了一下取模的大数类型就过了啊,真心后悔比赛的时候没有认真去看题,没有和队友讨论,如果早一点疯狂讨论,思路其实不难推出来,因为给定的n其实是没什么作用,我们只要推出前m个字符串有多少个对称子串,最后会发现其实是满足规律的,可以发现,只要找到第一个i使得m+1 代码: #include hdu 5347 【题意】RT: Problem Description MZL define F(X) as the first ionization energy of the chemical element X Now he get two chemical elements U,V,given as their atomic number,he wants to compare F(U) and F(V) It is guaranteed that atomic numbers belongs to the given set:{1,2,3,4,..18,35,36,53,54,85,86} It is guaranteed the two atomic numbers is either in the same period or in the same group It is guaranteed that x≠y Input There are several test cases For each test case,there are two numbers u,v,means the atomic numbers of the two element Output For each test case,if F(u)>F(v),print "FIRST BIGGER",else print"SECOND BIGGER" Sample Input 1 2
5 3 Sample Output SECOND BIGGER
FIRST BIGGER 两个化学元素U,V,给出它们的原子序数,比较F(U)和F(V),同一周期或同一族,暴力打表了 代码: #include 先发比赛的时候做出的,没做出的明天补上~~
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~