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…
链接: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…
链接: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…
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…
http://www.fjutacm.com/Contest.jsp?cid=705#P4 其实想清楚了就很简单,之前想了很多种方法,以为是二分什么的,看起来就像是一个单峰函数.但是发现直接暴力一波就行了. 不知道有没有人会来搜到我的题解?ID是Yinku2017. 题意:求\(x\)使得\(\sum\limits_{i=1}^{n}[a_i/x]+a_i\%x\) 首先把取余运算换成减法.提公因式. \(\sum\limits_{i=1}^{n}[a_i/x]+a_i\%x=\sum\limi…
第九集,结束亦是开始 题意: 大致意思就是给你n个3进制的数字,让你计算有多少对数字的哈夫曼距离等于i(0<=i<=2^m) 思路: 这个是一个防ak题,做法是要手推公式的fwt 大概就这个意思 把n个数字标记到大小为3^m的数组里 然后一个简单的方法就是,假设a是标记数组 for i=0 i<3^m i++ for j=0 j<3^m j++ ans[dis(a[i],a[j])]+=a[i]*a[j] 可能i==j的时候被算重复了,大概特判减去一下n就行了 我们发现,如果dis…
题目描述 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…