- 博客(17)
- 收藏
- 关注
原创 DNA Sorting
Problem DescriptionOne measure of unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the letter sequenceDAABEC’’, this m...
2020-03-27 12:25:28
169
原创 Tian Ji -- The Horse Racing
Here is a famous story in Chinese history.“That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.”“Both of Tian...
2020-03-25 01:05:51
130
原创 今年暑假不AC
今年暑假不ACTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 44 Accepted Submission(s) : 25Problem Description“今年暑假不AC?”“是的。”“那你干什么呢?”“看世界杯呀,笨蛋...
2020-03-23 22:27:58
111
原创 Number Sequence
Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).InputThe input ...
2020-03-22 21:25:10
91
原创 Fibonacci Again
Problem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).InputInput consists of a sequence of lines, each containing an integer n. (n &l...
2020-03-21 11:04:29
105
原创 人见人爱A^B
Problem Description求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方”Input输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1<=A,B<=10000),如果A=0, B=0,则表示输入数据的结束,不做处理。Output对于每个测试实例,请输出A^B的最后三位表示的整数,每个输出占一行。Sample Input2 ...
2020-03-20 10:24:52
72
原创 Rightmost Digit
Problem DescriptionGiven a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T which is t...
2020-03-19 10:20:00
112
原创 最小公倍数
给定两个正整数,计算这两个数的最小公倍数。Input输入包含多组测试数据,每组只有一行,包括两个不大于1000的正整数.Output对于每个测试用例,给出这两个数的最小公倍数,每个实例输出一行。Sample Input10 14Sample Output70#include<stdio.h>int main(){ int a,b; while(scanf("%...
2020-03-18 14:36:17
78
原创 Elevator
ElevatorTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 41 Accepted Submission(s) : 21Problem DescriptionThe highest building in our city ha...
2020-03-17 12:07:59
84
原创 Sum Problem
Sum ProblemTime Limit : 1000/500ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 40 Accepted Submission(s) : 19Problem DescriptionHey, welcome to HDOJ(Hangzhou Dia...
2020-03-16 11:50:36
95
原创 1008 Big Number 1009 Digital Roots
#include<stdio.h>#include<math.h>int main(){ int n,a; double sum; scanf("%d",&n); for(int j=1;j<=n;j++) { sum=0; scanf("%d",&a); for(int i=1;i<=a;i++) ...
2020-03-13 23:04:19
81
原创 A+B for Input-Output Practice (VII) The Hardest Problem Ever
#include<stdio.h>int main(){ int a,b; while(scanf("%d %d",&a,&b)!=EOF) { printf("%d\n\n",a+b); } return 0;}#include<stdio.h>#include<string.h>int main(){ char...
2020-03-12 11:49:14
109
原创 A+B for Input-Output Practice(V) (VI)
#include<stdio.h>int main(){ int n; scanf("%d",&n); int sum,a,k; for(int i=1;i<=n;i++) { sum=0; scanf("%d",&a); for(int j=1;j<=a;j++) { scanf("%d",&k); sum...
2020-03-11 14:27:41
154
原创 A+B for Input-Output Practice (IV)
#include<stdio.h>int main(){ int n,sum,k; while(1) { sum=0; scanf("%d",&n); if(n) { for(int i=1;i<=n;i++) { scanf("%d",&k); sum+=k; } printf("%d\n",su...
2020-03-10 09:34:54
101
原创 A+B for Input-Output Practice (III)
#include<stdio.h>int main(){ int a,b; while(1) { scanf("%d %d",&a,&b); if(a==0&&b==0) break;//return 0; else printf("%d\n",a+b); } return 0;} 注意程序的结束方式。...
2020-03-10 09:31:18
99
原创 1001 A+B for Input-Output Practice (II)
在这里插入代码片#include<stdio.h>int main(){int a,b;int n;scanf("%d",&n);for(int i=1;i<=n;i++){scanf("%d %d",&a,&b);printf("%d\n",a+b); }return 0;}跟1001 A+B for Input-Outpu...
2020-03-09 22:28:04
114
1
原创 1000 A+B for Input-Output Practice (I)
在这里插入代码片``#include<stdio.h>int main(){ int a,b; while(scanf("%d %d",&a,&b)!=EOF) { printf("%d\n",a+b); } return 0;}一开始看一眼以为好简单,提交了一遍说超时,才反应过来得写EOF,犯了好几次了。。...
2020-03-09 22:17:51
66
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人