Day 1 NTT #include <bits/stdc++.h> #define inf 0x3f3f3f3f #define m_k make_pair #define mod 998244353 #define int long long using namespace std; const int N=4*1e5+100; int n,l,c,len,inv[N],rev[N],f[N],g[N]; int fac[N]; inline int m_pow(int a,int b)…
Billboard Time Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 15625 Accepted Submission(s): 6580 Problem Description At the entrance to the university, there is a huge rectangular billboard of…
Billboard Time Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 14144 Accepted Submission(s): 6058 Problem Description At the entrance to the university, there is a huge rectangular billboard of…
继续畅通project Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 17319 Accepted Submission(s): 7445 Problem Description 省政府"畅通project"的目标是使全省不论什么两个村庄间都能够实现公路交通(但不一定有直接的公路相连,仅仅要能间接通过公路可达就可以).…
f(n)定义为n的十进制表示下所有位的平方和. 问你方程K*f(n)=n在a<=n<=b中的解的个数. 发现f(n)最大不超过2000,可以直接枚举f(n),然后判断K*f(n)的位的平方和是否恰好为f(n). #include<cstdio> #include<iostream> using namespace std; typedef long long ll; ll K,a,b; int main(){ // freopen("g.in",&q…
给你一个1~n的排列,让你找出4个下标a b c d,满足 (a+b)%n=(c+d)%n (w(a)+w(b))%n=(w(c)+w(d))%n,并且是非平凡解. 发现对于每个数i,找出两个数和为其的数量大概是O(n),于是可以随机找,压到vector里存下,直到找到一个解为止. #include<cstdio> #include<cstdlib> #include<vector> using namespace std; int n,a[1000010]; vect…
Every year, hundreds of people come to summer camps, they learn new algorithms and solve hard problems. This is your first year at summer camp, and you are asked to solve the following problem. All integers starting with 1 are written in one line. Th…
Problem H. Hiking in the Hills 题目连接: http://codeforces.com/gym/100531/attachments Description Helen is hiking with her friends in a highland. Their plan is to hike from their camp A to a beautiful showplace B. Unfortunately, Helen started feeling diz…
ZOJ Problem Set - 1025 题目分类:基础题 原题地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1025 题目大意就是有很多木头,都有各自的长度和重量.现在要加工这些木头,如果加工某根木头的长度和重量大于等于它上一根木头的长度和重量,那么加工它不需要时 间,否则要花1分钟.现给出一堆木头的长度和重量,要求加工完这堆木头可以花的最少时间.例如给出5根木头长度重量分别为(4,9), (5,2),…
2015 UESTC Winter Training #7 2010-2011 Petrozavodsk Winter Training Camp, Saratov State U Contest 据说这套题写出3题就是金牌水平了... Problem D. Group Stage 足球比赛,现在有n(2<= n <=100)支球队.要从中选拔m(1<= m <=n-1)支球队,每支球队互相比赛一场,即比赛n*(n-1)/2场,胜者得3分,平局各得1分.最后从大到小列出排名,如果有…