题目描述 Once there was a pig, which was very fond of treasure hunting. One day, when it woke up, it found itself in a strange land of treasure. As for how to come in, or how to go out, no ways to know. Sad. The good news is, it was lucky that it got the…
题目描述 Given an array A with length n  a[1],a[2],...,a[n] where a[i] (1<=i<=n) is positive integer. Count the number of pair (l,r) such that a[l],a[l+1],...,a[r] can be rearranged to form a geometric sequence. Geometric sequence is an array where each…
题目描述 Small koala special love LiaoHan (of course is very handsome boys), one day she saw N (N<1e18) guys standing in a row, because the boys had some strange character,The first time to Liao them will not be successful, but the second time will be su…
题目描述 In country  A, some roads are to be built to connect the cities.However, due to limited funds, only some roads can be built.That is to say,if the limit is 100$, only roads whose cost are no more than 100$ can be built. Now give you n cities, m r…
题目描述 Once there was a pig, which was very fond of treasure hunting. The treasure hunt is risky, and it is inadvertently caught in the peach blossom trap. Fortunately, it has got a map of peach blossom trap. You can think of it as a matrix of R row an…
题目描述 A mod-dot product between two arrays with length n produce a new array with length n. If array A is a1,a2,...,an and array B is b1,b2,...bn, then A mod-dot B produce an array C c1,c2,...,cn such that c1 =  a1*b1%n, c2 = a2*b2%n,...,ci = ai*bi%n,…
题目描述 We define Shuaishuai-Number as a number which is the sum of a prime square(平方), prime cube(立方), and prime fourth power(四次方). The first four Shuaishuai numbers are: How many Shuaishuai numbers in [1,n]? (1<=n<=50 000 000) 输入描述: The input will co…
题目描述 Yuanyuan Long is a dragon like this picture?                                     I don’t know, maybe you can ask him. But I’m sure Yuanyuan Long likes ballons, he has a lot of ballons.           One day, he gets n white ballons and k kinds of pi…
题目描述 BSD is a lazy boy. He doesn't want to wash his socks, but he will have a data structure called 'socks heap'.By maintaining this structure, he can quickly pick out two of the most smelless socks from millions of socks everyday. As one of his good…
题目描述 Two endpoints of two line segments on a plane are given to determine whether the two segments are intersected (there is a common point or there is a partial coincidence that intersects). If intersected, output "Yes", otherwise output "…
链接:https://ac.nowcoder.com/acm/contest/338/I 来源:牛客网 题目描述 IG won the S championship and many people are excited, ii and gg are no exception. After watching the game, the two of them also want to play a game. There is now an infinite chessboard with on…
链接:https://ac.nowcoder.com/acm/contest/338/G来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld 题目描述 This is a very simple problem! Your only job is to calculate a + b + c + d! 输入描述: There are several cases. In the first line…
RANK  0 题数 0 期末复习没有参加,补几道喜欢的题. A: AFei Loves Magic  签到 思路 :不需考虑 碰撞 直接计算最终状态即可. #include<bits/stdc++.h> using namespace std; #define maxn 12345 int ans,n,l,t,x,d; int main() { scanf("%d%d%d",&n,&l,&t); for(int i=1;i<=n;i++) {…
E.Easy Problem Description: Zghh likes number, but he doesn't like writing problem description. So he will just give you a problem instead of telling a long story for it. Now given a positive integer x and k digits a1,a2,...,ak, can you find a positi…
Dandan's lunch Description: As everyone knows, there are now n people participating in the competition. It was finally lunch time after 3 hours of the competition. Everyone brought a triangular bread. When they were going to eat bread, some people fo…
A.关电脑 #include<bits/stdc++.h> using namespace std; typedef long long LL; int T,h1,m1,s1,h2,m2,s2,t1,t2,ans; int main(){ while(cin>>T){ ;cas<=T;++cas){ cin>>h1>>m1>>s1>>h2>>m2>>s2; t1=h1*+m1*+s1,t2=h2*+m2*…
如下图这是“今日头条杯”首届湖北省大学程序设计竞赛的第一题,作为赛后补题 题目描述:链接点此 这套题的github地址(里面包含了数据,题解,现场排名):点此 Let  be a regualr triangle, and D is a point in the triangle. Given the angle of . Then let AD, CD and BD form a new triangle, what is the size of the three angles? 输入描述:…
题目描述:链接点此 这套题的github地址(里面包含了数据,题解,现场排名):点此 题目描述 由于系统限制,C题无法在此评测,此题为现场赛的D题 Who killed Cock Robin? I, said the Sparrow, With my bow and arrow,I killed Cock Robin. Who saw him die? I, said the Fly.With my little eye,I saw him die. Who caught his blood?…
题目描述:链接点此 这套题的github地址(里面包含了数据,题解,现场排名):点此 链接:https://www.nowcoder.com/acm/contest/104/D来源:牛客网 题目描述 Do you remember Kanna-chan we met last year? She is so cute, and this year, she entered middle school, with Cirno. As we know, Cirno is bad at math, s…
题目描述:链接点此 这套题的github地址(里面包含了数据,题解,现场排名):点此 链接:https://www.nowcoder.com/acm/contest/104/H来源:牛客网 题目描述 Mingming, a cute girl of ACM/ICPC team of Wuhan University, is alone since graduate from high school. Last year, she used a program to match boys and…
题目描述:链接点此 这套题的github地址(里面包含了数据,题解,现场排名):点此 题目描述 Given n positive integers , your task is to calculate the product of these integers, The answer is less than 输入描述: The first line of input is an integer n, the i-th of the following n lines contains the…
传送门 B-小宝的幸运数组 题目描述 对于小宝来说,如果一个数组的总和能够整除他的幸运数字k,就是他的幸运数组,而其他数组小宝都很讨厌.现在有一个长度为n的数组,小宝想知道这个数组的子数组中,最长的幸运子数组有多长. 对于子数组的定义,如果可以通过从开头和从结束分别删除若干个(可以为零或全部,前后删除个数不必相同)元素来从数组b获得数组a,则称数组a是数组b的子数组.(子数组包含原数组,但不包含空串) 题意: 对一个数组求数组和能整除k的子数组的个数,子数组是指原数组中任意连续的数组,长度大于0…
题目链接  校赛签到 对每个操作之间建立关系. 比较正常的是前$3$种操作,若第$i$个操作属于前$3$种,那么就从操作$i-1$向$i$连一条有向边. 比较特殊的是第$4$种操作,若第$i$个操作属于第$4$种这个时候我们需要从操作$k$向操作$i$连一条有向边. 那么一共有$q+1$个结点,$q$条边,很明显是一个树的结构.$0$号点为根结点. 那么从根结点出发,依次操作就可以了~,遇到操作$3$则打标记 我太懒  用bitset + fread挂过去了. 时间复杂度$O(\frac{mq}…
题目链接 提交连接:http://acm-software.hrbust.edu.cn/problemset.php?page=5 1470-1482 只做出来四道比较水的题目,还需要加强中等题的训练. 题解: E666 这个题是让求有多少个子串只含有6.寻找连续的6,然后用n*(n+1)/2求出这一段的子串个数,然后把每一段连续的加起来. 做的时候wa了很多次,原来是在n*(n+1)的地方已经超过int型了,所以需要设置类型为long long. #include <cstdio> #inc…
题目链接  2016 BUAA-Final Problem B 考虑一对可行的点$(x, y)$ 根据题意,设$x = ak + 1,y = bk + 1$ 又因为$x$是$y$的祖先的祖先的祖先,所以$y = 8x + d, 0 <= d <= 7$; 那么代入到之前的那个式子    $y = 8x + d$       $= 8(ak + 1) + d = 8ak + d + 8$ 注意到$8ak$对$k$取模后值为$0$,那么如果要满足题意,$d + 8$对$k$取模后值必须为$1$.…
题目链接  Problem J 这道题思路还是很直观的,但是有两个难点: 1.题目中说$1<=NM<=10^{6}$,但没具体说明$N$和$M$的值,也就是可能出现: $N = 1, M = 1000000$ 这样的数据. 2.对每个查询的分类讨论. #include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i(0); i < (n); ++i) #define rep(i,a,b) for(…
新生初赛题目.解题思路.参考代码一览 1001. 无聊的日常 Problem Description 两位小朋友小A和小B无聊时玩了个游戏,在限定时间内说出一排数字,那边说出的数大就赢,你的工作是帮他们统计他们获胜的次数. Input 第一行是一个T,代表游戏的次数T(T≤1000).每组两个整数p,y(1≤p≤\(10^{100}\),1≤y≤\(10^{100}\)),分别表示两位小朋友说出的数字. Output 输出两个数,A和B获胜的次数.后面没有换行,仅此一题 Sample Input…
Minieye杯第十五届华中科技大学程序设计邀请赛现场同步赛 I Matrix Again https://ac.nowcoder.com/acm/contest/700/I 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 KK is the engineer responsible for sensor sensing in MINIEYE. KK recently need to u…
Problem A: pigofzhou的巧克力棒 Description 众所周知,pigofzhou有许多妹子.有一天,pigofzhou得到了一根巧克力棒,他想把这根巧克力棒分给他的妹子们.具体地,这根巧克力棒长为 n,他想将这根巧克力棒折成 n 段长为 1 的巧克力棒,然后分给妹子们. 但是他妹子之一中的 15zhazhahe 有强迫症.若它每次将一根长为 k 的巧克力棒折成两段长为 a 和 b 的巧克力棒,此时若 a=b,则15zhazhahe会得到一点高兴值. pigofzhou想知…
题解 被你们虐了千百遍的题目和 OJ 也很累的,也想要休息,所以你们别想了,行行好放过它们,我们来看题解吧... A. 诡异的计数法 Description cgy 太喜欢质数了以至于他计数也需要用质数表示!在他看来,2(第一小质数)表示1,3(第二小质数)表示2--可正因为他的计数方法太奇葩,所以他的数学成绩非常差而且拖累了他的绩点. lxy 得知 cgy 的绩点排名之后打算告诉他,可是必须以极度麻烦的 cgy 质数计数法的方式表示. lxy 出重金 ¥(10000000 mod 10) 请你…