随笔分类 - 其他
摘要:Description:定义f(i)代表i的所有因子和(包括1和i),给定一个l,r。求f(l)+f(l+1)+...+f(r)。Input:第一行输入一个t(t#include#include#include#include#includeusing namespace std;const int...
阅读全文
摘要:Description:Adam and Eve play a card game using a regular deck of 52 cards. The rules are simple. The players sit on opposite sides of a table, facing...
阅读全文
摘要:Description:The reflected binary code, also known as Gray code after Frank Gray, is a binary numeral system where two successive values differ in only...
阅读全文
摘要:Problem Description:We are all familiar with sorting algorithms: quick sort, merge sort, heap sort, insertion sort, selection sort, bubble sort, etc. ...
阅读全文
摘要:题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=96545#problem/EDescription:Given an array withnintegers, and you are given two indicesiandj...
阅读全文
摘要:题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=94610#problem/JproblemIn normal football games, the winner team gets 3 points, loser team g...
阅读全文
摘要:Description:Kefa wants to celebrate his first big salary by going to restaurant. However, he needs company.Kefa hasnfriends, each friend will agree to...
阅读全文
摘要:Given two integers A and B. Sequence S is defined as follow:• S0 = A• S1 = B• Si = |Si−1 − Si−2| for i ≥ 2Count the number of distinct numbers in S.In...
阅读全文
摘要:Description:A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18...
阅读全文
摘要:Description:For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team fromNstudents of his universit...
阅读全文
摘要:Problem Description:A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, ...
阅读全文
摘要:题目描述我们把十进制整数依次写成一个字符串,123456789101112…请问第n位数码是多少?输入第一行是一个整数T(T≤10000),表示样例的个数。 每行输入一个整数n(1≤n≤788888899)。输出每行输出一个样例的结果。样例输入21788888899样例输出11#include#in...
阅读全文
摘要:Problem DescriptionThe "Harry Potter and the Goblet of Fire" will be on show in the next few days. As a crazy fan of Harry Potter, you will go to the ...
阅读全文
摘要:ACboy was kidnapped!! he miss his mother very much and is very scare now.You can't image how dark the room he was put into is, so poor :(.As a smart A...
阅读全文
摘要:素数1:#include#includeint Judge(int n){ int i, k; if (n == 0 || n == 1) return 0; k = sqrt(n); for (i = 2; i # define N 1000010 int a[N] = {1, 1}; void...
阅读全文