一.题目 A + B = C 二.分析 比较考验码力的题. 对于$c$,因为首位肯定不为0,那么$a$或者$b$至少有一个最高位是和$c$平齐的,或者少一位(相当于$a$+$b$进位得到). 那么这里,我们可以分四种情况 1 让$a$与$c$变为等长$A$和$C$ 等长后判断$R = C - A$是否等于$b$,这里的等实际上是${R}\times{10^{d1}}$与${b}\times{10^{d2}}$比较,$d1$和$d2$都可能为结果做出贡献. 2 让$a$与$c$变为等长$A$和$C…
Sequence Problem Description Let us define a sequence as below f1=A f2=B fn=C*fn-2+D*fn-1+[p/n] Your job is simple, for each task, you should output Fn module 109+7. Input The first line has only one integer T, indicates the number of tasks. Then,…
题目描述 Let us define a sequence as belowYour job is simple, for each task, you should output Fn module 109+7. 输入 The first line has only one integer T, indicates the number of tasks.Then, for the next T lines, each line consists of 6 integers, A , B, C…
Hard challenge Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 1487 Accepted Submission(s): 352 Problem Description There are n points on the plane, and the ith points has a value vali, an…
Kolakoski Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 0 Accepted Submission(s): 0 Problem Description This is Kolakosiki sequence: 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1--. This seque…
Euler theorem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 0 Accepted Submission(s): 0 Problem Description HazelFan is given two positive integers a,b, and he wants to calculate amodb.…
链接:https://www.nowcoder.com/acm/contest/145/C来源:牛客网 A binary string s of length N = 2n is given. You will perform the following operation n times : - Choose one of the operators AND (&), OR (|) or XOR (^). Suppose the current string is S = s1s2...sk.…
Find the median 题目链接: https://ac.nowcoder.com/acm/contest/887/E 题目描述 Let median of some array be the number which would stand in the middle of this array if it was sorted beforehand. If the array has even length let median be smallest of of two middl…
原题: Given a,b,c, find an arbitrary set of x,y,z such that a*10^x+b*10^y=c*10^z and 0≤x,y,z≤10^6. 给你三个高精度数a.b.c,要求找出任意一组x.y.z满足a*10^x+b*10^y=c*10^z 首先需要发现一个性质 乘上10的幂会往数的最后面填上0,而不会对最前面的位造成影响 一开始我的思路是考虑三个数的个位,这种就很麻烦了 (听说能忽略前导零然后讨论,但我总觉得是假做法) 考虑前面位的话,就只有…