![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
刷题人生
文章平均质量分 65
骚然勿外
记录我编程之路上的点点滴滴,不断吸取,不断反思,不断进步!
展开
-
初学C#斐波那契三解
#include int fib_rec( int n ){ if(n==0||n==1)return 1; else return fib_rec(n-1)+fib_rec(n-2);}int fib_iter( int n ){ int i=2; int num=0; if(n<2)return 1; int head=1,hair=1; for(;i<=n;i++){原创 2015-08-22 11:24:15 · 970 阅读 · 0 评论 -
SOJ.Letters and Words
Letters and Words 时间限制:1秒 内存限制:256兆 题目描述Calculate the number of letters (including white spaces but excluding line breaks) and the number of wo原创 2015-05-25 15:07:26 · 979 阅读 · 3 评论 -
数的计算
1011 数的计算 2001年NOIP全国联赛普及组 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 白银 Silver题目描述 Description我们要求找出具有下列性质数的个数(包含输入的自然数n):先输入一个自然数n(n1.原创 2015-06-10 14:19:39 · 356 阅读 · 0 评论 -
有鱼的声音
1275 有鱼的声音 2012年CCC加拿大高中生信息学奥赛 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 青铜 Bronze 题目描述 DescriptionA fish-finder is a device used by angler原创 2015-06-10 14:22:10 · 752 阅读 · 0 评论 -
Leetcode.Longest Common Prefix
Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings.找最长公共前缀class Solution {public: string longestCommonPrefix(vector &str原创 2015-06-24 11:33:29 · 481 阅读 · 0 评论 -
SOJ.Parity
1712. Parity 总提交数量:1469通过数量:1049评价:2.9/5.0(14 票)012345 时间限制:1秒 内存限制:原创 2015-06-18 16:01:22 · 418 阅读 · 0 评论 -
SOJ.Cannonball Pyramids
1701. Cannonball Pyramids 时间限制:1秒 内存限制:32兆 题目描述If you visit historical battlegrounds from periods when cannon were used, you may see cannonb原创 2015-06-18 15:38:24 · 486 阅读 · 0 评论 -
Factorial
Factorial 时间限制:1秒 内存限制:256兆 题目描述 Many years later, Alice grow up and she become a high-school student.One day she learned factorial on math class. The fac原创 2015-05-09 17:27:05 · 642 阅读 · 0 评论 -
Coprimes
CoprimesTime Limit:250MS Memory Limit:4096KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionFor given integer N (1N104) find amount of positive numbers not greater原创 2015-03-30 19:43:18 · 521 阅读 · 0 评论 -
SOJ.Opening Ceremony
1003. Opening Ceremony 总提交数量:123通过数量:34 时间限制:1秒 内存限制:256兆 题目描述For the grand opening of原创 2015-03-29 20:41:07 · 598 阅读 · 0 评论 -
SOJ.Biker's Trip Odomete
1051. Biker's Trip Odomete限制条件时间限制: 1 秒, 内存限制: 32 兆 题目描述Most bicycle speedometers work by using a Hall Effect sensor fastened to the front fork of the bicycle. A magnet is attached to one of the spoke原创 2015-07-11 13:27:25 · 531 阅读 · 0 评论 -
SOJ.AutoReset
AutoReset 题目描述“只要我离开了你的世界,无论你做过什么,我都能忘记你回到从前!”小PY今天很小清新的,大家不要说他腹黑啊。他知道今天大家都学习了析构函数!现在请大家帮他实现一个类AutoReset,这个类的功能是在一个作用域开始的时候,保存某个变量的值,而当该作用域结束的时候能够实现变量值的Re原创 2015-07-05 17:20:11 · 978 阅读 · 0 评论 -
SOJ.Concatenation and substring
Concatenation and substring 时间限制:1秒 内存限制:256兆题目描述In this problem, you are required to concatenate given integers and letters into a string S, and output a原创 2015-05-26 16:23:36 · 426 阅读 · 0 评论 -
SOJ.MyString Class
MyString Class 时间限制:1秒 内存限制:256兆 题目描述定义一个MyString类如下,该类有构造函数、拷贝构造函数、析构函数、成员函数和静态成员函数,有一个C字符串指针变量,还有一个静态成员变量numberOfObjects。请你完成类的实现。class MyString{原创 2015-04-20 00:57:40 · 451 阅读 · 0 评论 -
SOJ.Robot
Robot 题目描述PY喜欢玩机器人,他最近做了一台性能卓越、超乎想象的机器人,只可惜他有一个问题没有解决——这个机器人不会动。他想要让机器人动起来,所以他先要写一个控制机器人的程序。你作为PY的专属IT民工,很荣幸的接到了这个任务。PY给了你一个类Robot,请你把它实现。类的定义如下:s原创 2015-07-05 17:26:55 · 693 阅读 · 0 评论 -
SOJ.MyVector
1001. MyVector 时间限制:1秒 内存限制:256兆 题目描述有一个向量类MyVector,包括一个点的坐标位置x、y和z,实现其构造函数和三个友元函数,完成两个向量的加法、减法、点乘与叉乘运算。MyVector的定义如下: class MyVector原创 2015-04-15 01:29:07 · 881 阅读 · 0 评论 -
SOJ.MyVector
MyVector时间限制:1秒 内存限制:256兆 题目描述有一个向量类MyVector,包括一个点的坐标位置x、y和z,实现其构造函数和三个友元函数,完成两个向量的加法、减法、点乘与叉乘运算。MyVector的定义如下: class MyVector {public: MyVe原创 2015-04-20 00:58:33 · 683 阅读 · 0 评论 -
SOJ.分数排名查询
分数排名查询 总提交数量:641通过数量:239 时间限制:1秒 内存限制:256兆 题目描述张老师在同学们考试结束后,收到很多邮件。有的同学问学号为“12号”的多少分原创 2015-03-17 13:41:01 · 628 阅读 · 0 评论 -
SOJ.Date Class with Exception
Date Class with Exception 时间限制:1秒 内存限制:256兆 题目描述As we have learnt before, we can use the subscript [] in the class Date to access the year,原创 2015-06-08 21:11:22 · 532 阅读 · 0 评论 -
SOJ.Hex to Int
Hex to Int 时间限制:1秒 内存限制:256兆 题目描述 Write a function that parses a hex number as a string into a decimal integer. The function is原创 2015-06-08 21:29:55 · 706 阅读 · 1 评论 -
SOJ.Binary Search
Binary SearchWrite a binary search function to use a generic type for searching array elements. You should test the function with array of int, double and so on. The definition of the function i原创 2015-07-05 17:29:35 · 546 阅读 · 0 评论 -
SOJ.Dice Game
1000. Dice Game 总提交数量:100通过数量:59 时间限制:1秒 内存限制:256兆 题目描述Gunnar and Emma play a lot of b原创 2015-03-29 19:33:21 · 786 阅读 · 0 评论 -
SOJ.Subtraction
Subtraction 时间限制:1秒 内存限制:256兆 题目描述某小朋友已经四岁了,她开始学习数字减法,但她还不理解负数的概念,如果被减数和减数中出现负数,或者被减数小于减数,她都不会算。这里某人已设计函数c原创 2015-06-08 21:01:05 · 621 阅读 · 0 评论 -
Div 3
Div 3Time Limit:250MS Memory Limit:4096KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThere is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N e原创 2015-03-30 20:16:04 · 651 阅读 · 0 评论 -
SOJ.Output the Yanghui triangel
Output the Yanghui triangel 总提交数量:225通过数量:59 时间限制:1秒 内存限制:256兆 题目描述 Write program to o原创 2015-03-16 16:02:35 · 699 阅读 · 0 评论 -
大数运算(模板)
大数运算(模板)原创 2015-02-01 12:01:02 · 5340 阅读 · 0 评论 -
SOJ.Alice and Bob
1798. Alice and BobDescriptionBob is very famous because he likes to play games. Today he puts a chessboard in the desktop, and plays a game with Alice. The size of the chessboard is原创 2015-01-12 16:30:10 · 952 阅读 · 0 评论 -
CSDN.3n+1
题目详情对任何一个自然数n,如果它是偶数,那么把它砍掉一半;如果它是奇数,那么把(3n+1)砍掉一半。这样一直反复砍下去,最后一定在某一步得到n=1。卡拉兹在1950年的世界数学家大会上公布了这个猜想,传说当时耶鲁大学师生齐动员,拼命想证明这个貌似很傻很天真的命题,结果闹得学生们无心学业,一心只证(3n+1),以至于有人说这是一个阴谋,卡拉兹是在蓄意延缓美国数学界教学与科研的进展……原创 2015-01-10 16:47:09 · 419 阅读 · 0 评论 -
Sicily题目分类
*************************程序设计题*************************sicily 1293, uva 100, pc 110101, 3n+1数链问题, 难度1sicily 1813 M进制数问题 sicily 1157 The hardest problem. 简单大小比较,难度0sicily 1830 SZ Fibonacci Sequ转载 2015-01-11 13:51:26 · 612 阅读 · 0 评论 -
CSDN.石子游戏
题目详情甲乙两人面对若干堆石子,其中每一堆石子的数目可以任意确定。两人轮流按下列规则取走一些石子,游戏的规则如下:1.每一步应取走至少一枚石子;2.每一步只能从某一堆中取走部分或全部石子;3.如果谁无法按规则取子,谁就是输家。如果甲乙两人都采取最优的策略,甲先拿,请问,是甲必胜还是乙必胜.输入格式:多组数据,每组数据两行,第一行是原创 2015-01-10 16:58:18 · 414 阅读 · 0 评论 -
ACM模板
ACM模板原创 2015-01-10 15:15:01 · 1092 阅读 · 0 评论 -
SOJ.A-B v2
题目描述输入两个数A和B把A精确到小数后两位(四舍五入,只考慮小数后第三位),B精确到小数后两位(不用四舍五入),负数不考虑四舍五入然后输出A - B (结果保证不输出浮点数多余的0)输入A = B = 0时程序结束样例输入3.145 3.0093 912.782 5.009样例输出0.15-67.78{CSDN原创 2015-01-10 14:19:52 · 684 阅读 · 1 评论 -
SOJ.取位
时间限制:1秒 内存限制:256兆 题目描述 编写一个程序,取出一个整数a的二进制表示中从右端开始的4到7位,并把结果用十进制的形式输出。例如216的二进制表示为00000000 00000000 00000000 11011000,从右端开始的4到7位为1101,所以结果为13。输入格式 输入包括多组测试用例,通过EOF结束。每组测试用例包括一行,为一个原创 2015-01-10 14:23:39 · 473 阅读 · 0 评论 -
寒假集训.Reverse Root
B - Reverse RootTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThe problem is so easy, that the authors were lazy to write a原创 2015-01-29 14:12:37 · 683 阅读 · 0 评论 -
寒假集训.K-based Numbers
记忆化搜索:算法上依然是搜索的流程,但是搜索到的一些解用动态规划的那种思想和模式作一些保存。一般说来,动态规划总要遍历所有的状态,而搜索可以排除一些无效状态。更重要的是搜索还可以剪枝,可能剪去大量不必要的状态,因此在空间开销上往往比动态规划要低很多。记忆化算法在求解的时候还是按着自顶向下的顺序,但是每求解一个状态,就将它的解保存下来,以后再次遇到这个状态的时候,就不必重新求解了。这种方法综合了搜索和动态规划两方面的优点,因而还是很有实用价值的。原创 2015-01-29 13:43:19 · 545 阅读 · 0 评论 -
寒假集训.Discrete-Function
Discrete FunctionTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThere is a discrete function. It is specified for integer arg原创 2015-02-01 12:51:26 · 891 阅读 · 3 评论 -
寒假集训.Lucky Tickets. Easy!
Lucky Tickets. Easy!Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionBackgroundThe public transport administration of Ekateri原创 2015-02-01 13:18:42 · 656 阅读 · 0 评论 -
寒假集训.ID Codes
ID CodesTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusDescription ID Codes It is 2084 and the year of Big Brother has原创 2015-02-02 13:31:00 · 566 阅读 · 0 评论 -
SOJ.旋转矩阵
旋转矩阵 总提交数量:14通过数量:10 时间限制:1秒 内存限制:256兆 题目描述输入一个n*n的字符矩阵,把它左转90度后输出。输入格式输入仅包含一个原创 2015-03-16 14:34:42 · 536 阅读 · 0 评论 -
SOJ.The hardest problem
1157. The hardest problem限制条件时间限制: 1 秒, 内存限制: 32 兆 题目描述In the final exam, you are given n problems to solve, each one of which has an integer value indicating its difficulty, the larger, the原创 2015-02-17 13:03:12 · 537 阅读 · 0 评论