![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
水题
文章平均质量分 59
Hilo-建军
这个作者很懒,什么都没留下…
展开
-
Begin1 - Unit5 - 队列的逆转 tyvj 以后我自己不会看
:现在,我有一个n*m的矩阵,,请你把它顺时针旋转90°事成之后,,我给你1000000 mod 10元RMB ..原创 2014-07-15 23:31:32 · 358 阅读 · 0 评论 -
【简单】判断素数
1.首先,1不是素数,2是素数;2.然后,设计函数原创 2014-07-11 16:13:10 · 341 阅读 · 0 评论 -
利用递归方法求最大公约数 gcd
#include #includeusing namespace std;//求最大公约数//时间超标,需要优化int gcd(int a, int b)//函数定义{ int max = a > b ? a : b; int min = a < b ? a : b; a = max; b = min; int r = a % b; if(0原创 2014-07-11 16:30:52 · 1252 阅读 · 0 评论 -
巧克力 tyvj begin 水题
背景 BackgroundUnit1 巧克力提示:1.本题有一定的思考难度,请尝试证明你的做法!描述 Description 小Z最爱吃巧克力了,有一次妈妈给他了一块巧克力,如下图为两个2*2的巧克力。 聪敏的小Z开始思考,如果给他一个N*M的巧克力,他最少需要掰多少次才可以让巧克力变成一块一块的?(不能重叠着掰) 对于图中的一块巧克力,最少需要掰3次。输入格原创 2014-07-31 09:34:51 · 941 阅读 · 0 评论 -
HDU 贪心 今年暑假不AC 2037
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7618 Accepted Submission(s): 3874Problem Description“今年暑假不AC?”“是的。”“那你干什么呢?”“看世界杯呀,笨蛋!”转载 2014-07-30 15:51:48 · 512 阅读 · 0 评论 -
tyvj begin 闰秒 wa了2个小时竟然 【水题】
背景 BackgroundUnit 2, Section D描述 Description对于给定的秒数,请输出它以时:分:秒的形式的表示。当然,为了增加难度,我们假设每一分钟都有闰秒,也就是说一分钟有61秒。输入格式 InputFormat输入一行,一个整数,表示秒数(0<n<5000)。输出格式 OutputFormat输出一行,以时:分:秒的形式的表示。我的wa点就是原创 2014-08-01 08:03:47 · 514 阅读 · 0 评论 -
hello kitty tyvj begin 不能再水了 字符串输入
背景 BackgroundUnit1, Section E描述 Description"我整个人都Hello Kitty了 ..."因为真的不知道干什么了 ,所以小A决定,从今往后,只要有人跟他说话他就原样把他说出去!(真是个无聊的人啊 ......)输入格式 InputFormat输入包含不知道多少行,有若干字符输出格式 OutputFormat输出包含不知道多少行,和输入一模原创 2014-07-31 17:21:51 · 691 阅读 · 0 评论 -
hello cube tyvj 水题 不能再水了
背景 BackgroundUnit1, Section D描述 Description魔方大家都玩过吧? 常见的魔方,每边上有3个小正方体,如下图所示我们把魔方每边上的小正方体数量叫魔方的“阶”所以,常见的魔方叫“3阶魔方”。 不过,魔方可不是只有3阶的,还有2、4、5……阶的呢,如下图所示:观察所有的魔方,你会发现,我们可以把魔方表面上的小正方体分为三类: 第一类:有三原创 2014-07-31 17:05:47 · 1250 阅读 · 0 评论 -
找零钱
//转载自《零基础学算法·第三版》,仅供交流,切勿盗用。#include #include #define MAXN 9int parvalue[MAXN]={10000,5000,2000,1000,500,200,100,50,20,10};//定义人民币面额数组int num[MAXN]={0};//定义找零钱中各对应面额人民币的数量int exchange(int n){转载 2014-12-09 21:26:49 · 490 阅读 · 0 评论 -
比赛日程安排
//运用分治算法的思想,将问题分解,再合成//转载自《零基础学算法·第三版》,仅供交流,切勿盗用。#include #include #define MAXN 64int a[MAXN+1][MAXN+1]={0};//定义全局数组void gamecal(int k,int n)//处理编号k开始的n个选手的日程{ int i,j; if(n==2) {转载 2014-12-09 21:13:50 · 389 阅读 · 0 评论 -
一道简单的求约数的个数问题
输入一个整数N,求其约数的个数,被wa原创 2014-07-11 16:00:43 · 383 阅读 · 0 评论 -
tyvj 贪心 p1019 配对 【贪心初级】
描述 Description 给出2个序列A={a[1],a[2],…,a[n]},B={b[1],b[2],…,b[n]},从A、B中各选出n个元素进行一一配对(可以不按照原来在序列中的顺序),并使得所有配对元素差的绝对值之和最大。原创 2014-07-30 13:56:47 · 519 阅读 · 0 评论 -
关于C++/C 输入一行整型数据,数量不定问题,如何读入
读取一行数据,以回车符结束,这个看似简单的问题,我原创 2014-07-16 09:52:03 · 1014 阅读 · 0 评论 -
关于分解质因数,并且输出的问题,ex:42=7*3*2;
质因数,质因数,开始以为要判断原创 2014-07-15 22:33:07 · 877 阅读 · 0 评论 -
无脑switch题,Unit2 键盘,tyvj BEGIN【以后不需要再看,除非有BUG】
这是输入键盘上一个字母,输出该字母左上方和右上方分别是什么键。以下为键盘上键的名称和位置:1 2 3 4 5 6 7 8 9 0 - Q W E R T Y U I O P A S D F G H J K L Z X C V B N M ,原创 2014-07-16 22:02:39 · 377 阅读 · 0 评论 -
C++选择排序法,按从大到小排序,long long 型
输入格式 InputFormat第一行一个整数n,表示数列的长度接下来有n行,每行有一个整数,表示数组中的元素输出格式 OutputFormat共n行,输出他们排序后的结果原创 2014-07-17 07:25:50 · 3268 阅读 · 0 评论 -
HDU 最小公倍数 1108 【水】
#include using namespace std;int main(){ int m,n,temp; cin>>m>>n; if(m>n){temp=m;m=n;n=temp;} for(int i=n;;i++) if(i%m==0&&i%n==0) { cout << i<< endl;break;原创 2014-07-18 14:10:56 · 317 阅读 · 0 评论 -
Rotating Sentences
#include#include#define maxn 107int line,len;char s[maxn][maxn];int main(){ memset(s,0,sizeof(s)); line=len=0; while(gets(s[line])) { if(len<strlen(s[line]))转载 2014-06-16 21:10:51 · 307 阅读 · 0 评论 -
UVa 445 Marvelous Mazes
Marvelous Mazes Your mission, if you decide to accept it, is to create a maze drawing program. A maze will consist of the alphabetic characters A-Z, * (asterisk), and spaces.Input and OutputYour转载 2014-06-16 21:20:15 · 296 阅读 · 0 评论 -
Kindergarten Counting Game
Kindergarten Counting Game Everybody sit down in a circle. Ok. Listen to me carefully.``Woooooo, you scwewy wabbit!''Now, could someone tell me how many words I just said?Input and OutputInp原创 2014-06-16 20:59:17 · 573 阅读 · 0 评论 -
UVa 694 The Collatz Sequence
The Collatz Sequence An algorithm given by Lothar Collatz produces sequences of integers, and is described as follows:Step 1:Choose an arbitrary positive integer A as the first item in the seq原创 2014-06-17 22:27:41 · 413 阅读 · 0 评论 -
生成彩票号码组合
//转载自《零基础学算法·第三版》,仅供交流,切勿盗用。#include #include int main(){ int i[7],j; for(i[0]=1;i[0] for(i[1]=1;i[1] { if(i[0]==i[1]) continue; for(i[2]=1;i[2]转载 2014-12-10 14:37:09 · 2032 阅读 · 0 评论