摘要:Largest Point Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 3065 Accepted Submission(s): 1078 P
阅读全文
摘要:Best Solver Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 65535/102400 K (Java/Others)Total Submission(s): 1115 Accepted Submission(s): 645 Pro
阅读全文
摘要:So Easy! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5905 Accepted Submission(s): 1966 Proble
阅读全文
摘要:#include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,a,n) for (int i=a;i=a;i--) #define pb push_back #define mp make_pair #defi...
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/135/A来源:牛客网 若一个集合A内所有的元素都不是正整数N的因数,则称N与集合A无关。 给出一个含有k个元素的集合A={a1,a2,a3,...,ak},求区间[L,R]内与A无关的正整数的个数。 保证A内的元素都是
阅读全文
摘要:Alice and Bob are playing a simple game. They line up a row of nn identical coins, all with the heads facing down onto the table and the tails upward.
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/142/G来源:牛客网 The mode of an integer sequence is the value that appears most often. Chiaki has n integers a1,a2,
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/141/J来源:牛客网 Eddy has graduated from college. Currently, he is finding his future job and a place to live. Sinc
阅读全文
摘要:Naive Operations Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 502768/502768 K (Java/Others)Total Submission(s): 2114 Accepted Submission(s): 9
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/141/A来源:牛客网 Eddy was a contestant participating in ACM ICPC contests. ACM is short for Algorithm, Coding, Math
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/141/E来源:牛客网 Eddy likes to play with string which is a sequence of characters. One day, Eddy has played with a
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/141/C来源:牛客网 Eddy likes to play cards game since there are always lots of randomness in the game. For most of t
阅读全文
摘要:Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 184 Accepted Submission(s): 132 Problem Desc
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/135/G来源:牛客网 题目描述 从前,Apojacsleam家的水族箱里,养了一群热带鱼。 在这几条热带鱼里,Apojacsleam特别喜欢一条叫做TbGx(请勿人肉)的热带鱼,所以每次都让她第一个吃食物。对于每一条鱼
阅读全文
摘要:从前有个东西叫树状数组,它可以轻易实现一些简单的序列操作,比如单点修改,区间求和;区间修改,单点求值等. 但是我们经常需要更高级的操作,比如区间修改区间查询.这时候树状数组就不起作用了,只能选择写一个2000GB的线段树交上去然后被卡常—–或者另一个选择是写ZKW线段树,会好一些. 再但是…谁告诉你
阅读全文
摘要:树状数组主要用于计算区间的和,在区间元素修改值的时候能够快速修改而不是以O(n)的复杂度进行修改; 线段树是把区间以树的形式分拆为若干个小区间,每个小区间存的都有一个值(树状数组的元素存的是区间值),所以线段树可以快速获得这个区间里面的所有的节点(元素),主要用于计算每个区间的最大最小元素(也可以快
阅读全文
摘要:题目 题目描述 JSZKC is going to spend his vacation! His vacation has N days. Each day, he can choose a T-shirt to wear. Obviously, he doesn’t want to wear a
阅读全文
摘要:题目 题目描述 JSZKC is the captain of the lala team. There are N girls in the lala team. And their height is [1,N] and distinct. So it means there are no tw
阅读全文
摘要:Persona5 is a famous video game. In the game, you are going to build relationship with your friends. You have NN friends and each friends have his upp
阅读全文
摘要:Distinct Values Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1411 Accepted Submission(s): 439
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/135/D来源:牛客网 题目描述 输入描述: 输入数据共一行,一个正整数n,意义如“问题描述”。 输出描述: 输出一行描述答案:一个正整数k,表示S的末尾有k个0 <!-- <br/> <h5 style="font-s
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define pb push_back #define mp make_pair #define fi first #define se se...
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/140/I来源:牛客网 White Cloud has a square of n*n from (1,1) to (n,n). White Rabbit wants to put in several cars. Ea
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/140/D来源:牛客网 White Cloud has built n stores numbered from 1 to n. White Rabbit wants to visit these stores in t
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/140/A来源:牛客网 White Cloud is exercising in the playground. White Cloud can walk 1 meters or run k meters per sec
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/133/A来源:牛客网 现在有一棵被Samsara-Karma染了k种颜色的树,每种颜色有着不同的价值 Applese觉得Samsara-Karma染的太难看了,于是打算把整棵树重新染成同一种颜色 但是,由于一些奥妙重重
阅读全文
摘要:Count the number of n x n matrices A satisfying the following condition modulo m. * Ai, j ∈ {0, 1, 2} for all 1 ≤ i, j ≤ n. * Ai, j = Aj, i for all 1
阅读全文
摘要:Given a sequence of integers a1, a2, ..., an and q pairs of integers (l 1, r1), (l2, r2), ..., (lq, rq), find count(l1, r1), count(l2, r2), ..., count
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/139/D来源:牛客网 Two undirected simple graphs and where are isomorphic when there exists a bijection on V satisfyin
阅读全文
摘要:Pave the Parallelepiped time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Pave the Paralle
阅读全文
摘要:Relatively Prime Graph time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Relatively Prime
阅读全文
摘要:Halloween treats Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1097 Accepted Submission(s): 435
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/138/D来源:牛客网 小胖参加了人生中最重要的比赛——MedoC资格赛。MedoC的资格赛由m轮构成,使用常见的“加权标准分”的规则。每位选手需要参加所有的m轮的比赛。在一轮中,能取得的分数为自己的成绩除掉最高分的成绩
阅读全文
摘要:排列组合 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4891 Accepted Submission(s): 2122 Problem De
阅读全文
摘要:Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24975 Accepted Subm
阅读全文
摘要:找单词 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9239 Accepted Submission(s): 6445 Problem Des
阅读全文
摘要:排列 Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 21268 Accepted: 8049 Description 题目描述: 大家知道,给出正整数n,则1到n这n个数可以构成n!种排列,把这些排列按照从小到大的顺序(字典顺序
阅读全文
摘要:Game of Connections Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 9128 Accepted: 4471 Description This is a small but ancient game. You a
阅读全文
摘要:Matrix Power Series Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 27277 Accepted: 11143 Description Given a n × n matrix A and a positiv
阅读全文
摘要:Kiki & Little Kiki 2 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3078 Accepted Submission(s):
阅读全文
摘要:助手Christina发明了一种方格取数的新玩法:在n*m的方格棋盘里,每个格子里写一个数。两个人轮流给格子染色,直到所有格子都染了色。在所有格子染色完后,计算双方的分数。对于任意两个相邻(即有公共边)的格子,如果它们都被同一个人染色,那么这个人将得到这两个格子中的数的异或的分数。所有的分数加和计算
阅读全文
摘要:题目描述 ggwdwsbs最近被Zeratul和Kyurem拉入了日本麻将的坑。现在,ggwdwsbs有13张牌,Kyurem又打了一张,加起来有14张牌。ggwdwsbs想拜托你帮他判断一下,这14张牌能否和。 为了方便起见,本题不考虑字牌,即只有万,筒,条三种类型的牌,牌上带有数字1~9,相同的
阅读全文
摘要:题目描述 众所周知,Alice和Bob非常喜欢博弈,而且Alice永远是先手,Bob永远是后手。 Alice和Bob面前有3堆石子,Alice和Bob每次轮流拿某堆石子中的若干个石子(不可以是0个),拿到所有石子中最后一个石子的人获胜。这是一个只有3堆石子的Nim游戏。 Bob错误的认为,三堆石子的
阅读全文
摘要:Fibonacci Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18607 Accepted: 12920 Description In the Fibonacci integer sequence, F0 = 0, F1 =
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/138/C来源:牛客网 世界杯就要开始啦!真真正正的战斗从淘汰赛开始,现在我们给出球队之间的胜负概率,来预测每支球队夺冠的可能性。 在接下来的篇幅中,我们将简单介绍淘汰赛阶段的规则。 淘汰赛阶段的90分钟常规时间内(含补
阅读全文
摘要:分析: 我们假设购买一种可乐p瓶,我们可以得到期望:p*(m/n*a[i]+(n-m)/n*b[i]),由这个式子我们可以看出唯一的变量是i,所以可以遍历i找出式子的最大值 #include <map> #include <set> #include <stack> #include <cmath>
阅读全文
摘要:Minimum Ternary String time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a te
阅读全文
摘要:Median on Segments (Permutations Edition) time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard outpu
阅读全文
摘要:Summarize to the Power of Two time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output A sequence
阅读全文
摘要:Polycarp and Div 3 time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp and Div 3 ti
阅读全文
摘要:Coins and Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Coins and Queries time
阅读全文
摘要:#include using namespace std; int c[1005][1005]; int main(){ memset(c,0,sizeof(c)); c[0][0] = 1; for(int i = 1; i <= 1000; i ++){ for(int j = 0; j <= i; j ++) if(j == 0 || j == i) c[i]...
阅读全文
摘要:Covered Points Count time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Covered Points Coun
阅读全文
摘要:Light It Up time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Light It Up time limit per te
阅读全文
摘要:Posterized time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Professor Ibrahim has prepared
阅读全文
摘要:Marlin time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The city of Fishtopia can be imagi
阅读全文
摘要:Useful Decomposition time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ramesses knows a lot
阅读全文
摘要:Businessmen Problems time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Two famous competin
阅读全文
摘要:Cut 'em all! time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Cut 'em all! time limit per
阅读全文