摘要:Bubble Sort Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 659 Accepted Submission(s): 393 Prob
阅读全文
摘要:Color the ball Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 16484 Accepted Submission(s): 820
阅读全文
摘要:对于普通数组,其修改的时间复杂度位O(1),而求数组中某一段的数值和的时间复杂度为O(n),因此对于n的值过大的情况,普通数组的时间复杂度我们是接受不了的。 在此,我们引入了树状数组的数据结构,它能在O(logn)内对数组的值进行修改和查询某一段数值的和。 树状数组是一个查询和修改复杂度都为log(
阅读全文
摘要:同学们~ Stars Problem Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordi
阅读全文
摘要:C. New Year Snowmen time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output As meticulous Gerald
阅读全文
摘要:A. New Year Table time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. New Year Table time
阅读全文
摘要:题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1136 思路:欧拉函数求小于或等于n且与n互质的数字的个数 题目链接:https://www.51nod.com/onlineJudge/questionCode
阅读全文
摘要:思路:利用归并排序,先分解区间。最后合并区间的时候找到逆序的个数。(可以画图来理解归并排序) 代码: 1 #include <iostream> 2 #include <cstring> 3 using namespace std; 4 5 int a[50005]; 6 int res[50005
阅读全文
摘要:Cleaning Shifts Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 17736 Accepted: 4516 Description Farmer John is assigning some of his N (1
阅读全文
摘要:D - Babaei and Birthday Cake Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 629D D - Babaei a
阅读全文
摘要:C - A Simple Problem with Integers Time Limit:5000MS Memory Limit:131072KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 3468 C - A Simple
阅读全文
摘要:A - 敌兵布阵 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1166 A - 敌兵布阵 Submit Status Practice HDU 1166
阅读全文
摘要:E - Find The Multiple Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status E - Find The Multiple Submit Status Descripti
阅读全文
摘要:D - Fliptile Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status D - Fliptile Submit Status Description Farmer John kno
阅读全文
摘要:C - Catch That Cow Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status C - Catch That Cow Submit Status Description Far
阅读全文
摘要:B - Dungeon Master Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description You are trapped i...
阅读全文
摘要:A - 棋盘问题 Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status A - 棋盘问题 Submit Status Description 在一个给定形状的棋盘(形状可能是不规则的)上面
阅读全文
摘要:Evio与观察小白鼠 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description Evio非常喜欢生物,Evio现在想观察小白鼠的记忆能力。Evio想设计一个任意两个房间只有一条路径的地图。这个地图有m条双
阅读全文
摘要:题目描述很简单 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description 输入一棵树的中序遍历和先序遍历,输出后序遍历。 Input 输入多组数据。 每组数据的第一行: 树的中序遍历。 每组数据的第二行:
阅读全文
摘要:阶乘问题 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description N的阶乘写作N!,表示小于等于N的所有正整数的乘积。 阶乘会变大得很快,如13!就必须用32位整数类型来存储,到了70!即使用浮点数也存
阅读全文
摘要:题目链接:点击打开链接 思路:简单的线段树模板,理解了好久。创建+更新+查询。更新只涉及到区间更新次数(+1)即可。查询可以递归查询,累加包含查询结点的树结点(即离散化的区间[l,r])的次数即可。简单的说就是,查询结点所在的区间更新次数的总和。 eg:离散化到树结点,若共有4个结点,更新区间[1,
阅读全文
摘要:D. Remainders Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output D. Remainders Game tim
阅读全文