摘要:
定义了一些常见的语句,如memset,for int与long long 的快速读入 cpp // ZJ_MRZ's Code include include include include include include define ini(a) memset(a,0,sizeof(a)) de 阅读全文
摘要:
A. The Fair Nut and Elevator time limit per test : 1 second memory limit per test : 256 megabytes input : standard input output : standard output The 阅读全文
摘要:
一.如何对待不会做的题? 1.题解 2.学一下算法,再打。 3.与同学交流。 二.如何写题解? 1.AC二十四小时以后,写题解的黄金时间。要把别人的题解给忘的差不多再写。 2.AC四十八小时候,还做得出来,就基本上掌握了。 阅读全文
摘要:
题目链接:http://codeforces.com/problemset/problem/158/BDescriptionAfter the lessons n groups of schoolchildren went outside and decid... 阅读全文
摘要:
题目链接:http://codeforces.com/problemset/problem/1017/BDescriptionRudolf is on his way to the castle. Before getting into the castle... 阅读全文
摘要:
题目链接:http://codeforces.com/problemset/problem/1017/ADescriptionJohn Smith knows that his son, Thomas Smith, is among the best stu... 阅读全文
摘要:
英文DescriptionProblems that require minimum paths through some domain appear in many different areas of computer science. For exam... 阅读全文
摘要:
题目:点击链接即可:http://codeforces.com/problemset/problem/1016/A背景:You received a notebook which is called Death Note. This notebook has... 阅读全文
摘要:
英文DescriptionGiven is an ordered deck of n cards numbered 1 to n with card 1 at the top and card n at the bottom. The following o... 阅读全文
摘要:
英文DescriptionTrung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence of consecutiv... 阅读全文
摘要:
说明:学习该模板比较推荐洛谷P3367 【模板】并查集,以下是该题链接及描述: https://www.luogu.org/problemnew/show/P3367题目描述如题,现在有一个并查集,你需要完成合并和查询操作。输入格式:第一行包含两个整数N、M... 阅读全文
摘要:
时间:1s 空间:32M题目描述:给你一副无向图,求连通块的个数 比如上图有3个连通块输入格式:第一行输入两个整数n,m,表示图的节点数量,边的数量 接下来输入m行,每行两个整数a,b表示a,b之间有一条无向边输出格式:输出一个整数样例输入:15 12... 阅读全文
摘要:
英文DescriptionAn organic compound is any member of a large class of chemical compounds whose molecules contain carbon. The molar m... 阅读全文
摘要:
时间:1s 空间:128M题目描述:给你一棵以1为根的树,求树的深度输入格式:第一行输入一个整数n,表示树的总点数 第二行输入n−1个数,第i个数表示i+1的父节点标号输出格式:输出一个整数表示树的深度(根节点的深度为1)样例输入:4 1 2 3样例输出... 阅读全文
摘要:
时间:0.5s 空间:128M题目描述:给你一棵以1为根的树,求树的深度,如下的树深为5 输入格式:第一行输入一个整数n,表示树的总点数 第二行输入n−1个数,第i个数表示i+1的父节点标号输出格式:输出一个整数表示树的深度(根节点的深度为1)样例输入:... 阅读全文
摘要:
英文DescriptionThere is an objective test result such as “OOXXOXXOOO”. An ‘O’ means a correct answer of a problem and an ‘X’ means ... 阅读全文
摘要:
英文DescriptionFor a positive integer N, the digit-sum of N is defined as the sum of N itself and its digits. When M is the digitsu... 阅读全文
摘要:
英文Time Limit:1s Memory Limit:256MDescriptionN grid in a line.Using three colour(red,pink and green) to dye the grid,each grid d... 阅读全文
摘要:
英文Time Limit:0.5s Memory Limit:32MDescription The position of 8 is (2,3),please tell us the position of n. 1#include #include #... 阅读全文
摘要:
英文Time Limit:1s Memory Limit:256MDescriptionInput n interval,output the union set from small to large.InputThe first line conta... 阅读全文
摘要:
时间:1s 空间:128M题目描述:给你n个数,输出这n个数离散化后的结果 比如4 100 80 10000 离散化后为1 3 2 4 每个数的值为在原先数组中大小的排名,相同排名输出相同。 如1 1000 100 100 输出1 4 2 2输入格式:第... 阅读全文
摘要:
英文Time Limit:1s Memory Limit:256MDescriptionGiven a n*m map.A “Mengxin” is trapped.You are the one to rescue him.In the map,the... 阅读全文
摘要:
英文Time Limit:1s Memory Limit:256MDescription Please calculate the least steps knight moves from one position to another.InputTh... 阅读全文
摘要:
英文:Time Limit:0.2s Memory Limit:32MDescription Every time you can climb one step or two steps,please calculate how many ways yo... 阅读全文
摘要:
时间:1s 空间:256M题目描述:输出(a+b)^n的展开式输入格式:输入一行,包含一个整数n输出格式:见样例输出,注意空格的使用样例输入1:2样例输出1:(a+b)^2 = a^2 + 2*a*b + b^2样例输入2:3样例输出2:(a+b)^3 ... 阅读全文
摘要:
时间:1s 空间:128M题目描述:给你两个十进制数,数位最多有1000位,求他们的乘积输入格式:第一行输入一个整数 第二行输入一个整数输出格式:输出一个整数样例输入:12312312312142343254354354 4124354364565765... 阅读全文
摘要:
方法还是与高精度加法的方法差不多,列一个竖式,就可以发现其中的规律了。#include #include #include #include #include #include #define N 3001using namespace std ;int m... 阅读全文
摘要:
时间:1s 空间:128M题目描述:给你两个十进制数,数位最多有1000位,求他们的差输入格式:第一行输入一个整数 第二行输入一个整数输出格式:输出一个整数样例输入:12312312312142343254354354 41243543645657654... 阅读全文
摘要:
高精度减法要注意的是被减数必须必减数大,同时需要处理借位。方法类似于高精度加法。#include #include #include #include #include #include #define N 1001using namespace std ;... 阅读全文
摘要:
时间:1s 空间:256M题目描述:给你两个有序的数组。合并这两个数组成为一个新的有序数组,并输出。输入格式:第一行输入两个整数n,m 第二行输入n个数,表示第一个有序数组 第三行输入m个数,表示第二个有序数组输出格式:输出n+m个数,表示两个数组合并之... 阅读全文
摘要:
以下代码就可以算a^b%c的值,总的思路还是二分思想吧。要仔细体会一下(^_^)#include #include #include #include #include #include using namespace std ;int lxx ( long... 阅读全文
摘要:
今年,2018年。我从杭州市建兰中学毕业了。建兰中学应该在杭州乃至浙江省都是信息学奥林匹克竞赛的强校了。初一时,我通过了学校特意组织的数学考试,加入了建兰的信奥社团。三年来,我虽然没有取得重大的成绩,但建兰还是带给了我许多。首先,信奥社团给了我学习编程的兴趣... 阅读全文
摘要:
时间:1s 空间:128M题目描述:从1到n有n块砖需要刷油漆,砖的编号被a整除的要被刷成红色,被b整除的被刷成蓝色,同时被a,b整除的既可以被刷成红色,也可以被刷成蓝色。等你刷完后,对于每块红色的砖,老板会奖励给你p个巧克力,对于每块蓝色的砖,老板奖励... 阅读全文
摘要:
时间:1s 空间:128M题目描述:f(0)=0 f(2∗x)=f(x) f(2∗x+1)=f(x)+1 你有一个序列a1,a2,a3…an 现在你想知道有多少对的f(ai)=f(aj)(1#include #include #include #incl... 阅读全文
摘要:
时间:1s 空间:256M题目描述:给你两个十进制数,数位最多有1000位,求他们的和输入格式:第一行输入一个整数 第二行输入一个整数输出格式:输出一个整数样例输入:12312312312142343254354354 41243543645657654... 阅读全文
摘要:
注意点:1. 用字符串、数组进行储存;2.注意高精度位数的确定;3.注意进位借位处理; #include #include #include #include #include #include #define N 10001using namespace ... 阅读全文
摘要:
时间:1s 空间:256M题目描述:输入两个数,分别打印这两个数的横式和竖式运算式子。输入格式:输入两个整数a,b 以空格隔开输出格式:第一行打印横式运算式子,接下来四行打印竖式运算式子样例输入:45 237样例输出:45+237=282 45+... 阅读全文
摘要:
题目描述:农夫约翰搭了一间有N间牛舍的小屋。牛舍排在一条线上,第i号牛舍在xi的位置.但是他的M头牛对小屋很不满意,因此经常互相攻击。约翰为了防止牛之间互相伤害,因此决定把每头牛都放在离其他牛尽可能远的牛舍。也就是要最大化最近的两头牛之间的距离。输入格式:第... 阅读全文
摘要:
时间:1s 空间:256M题目描述:寻找一个最小的N,使得N!末尾恰好有Q个0输入格式:输入一个整数Q输出格式:如果有解输出一个整数N;否则输出”impossible”样例输入1:2样例输出1:10样例输入2:5样例输出2:impossible约定:1#... 阅读全文