摘要: 链接:https://www.nowcoder.com/acm/contest/157/A 来源:牛客网 题目描述 xb有m种石子,每种无限个,Ta想从这些石子中取出n个,并按顺序排列起来,为了好看,相邻的石子不能相同。xb想知道有多少种排列的方法。 输入描述: 第一行有两个正整数n,m。 输出描述 阅读全文
posted @ 2018-08-14 11:00 子诚- 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 题目地址:https://vjudge.net/problem/UVA-400 大致题意:输入n个文件名,排序后左对齐输出,一行最多输出60字符,并且每列最右一列M字符,其他列为M+2字符 我碰到的几个坑:1求出最长的字符,每次求字符长度时用length()记得int强制类型转换 2求列数可以先减去 阅读全文
posted @ 2018-08-09 15:37 子诚- 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://cn.vjudge.net/problem/UVA-1588 #include <iostream> #include <string.h> using namespace std; int kick(char *s1,char *s2, int n, int m) { in 阅读全文
posted @ 2018-07-14 10:16 子诚- 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://cn.vjudge.net/problem/UVA-1587 #include <iostream> #include <stdio.h> #include <string.h> #include <algorithm> using namespace std; pair<i 阅读全文
posted @ 2018-07-14 09:56 子诚- 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 题目:https://cn.vjudge.net/problem/UVA-10340 #include <iostream> #include <stdio.h> #include <string.h> using namespace std; char s[1000005],t[1000005]; 阅读全文
posted @ 2018-07-14 09:45 子诚- 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目:https://vjudge.net/problem/UVA-202 https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=138 #include <io 阅读全文
posted @ 2018-07-14 09:41 子诚- 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://vjudge.net/problem/UVA-1368 https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4114 #include 阅读全文
posted @ 2018-07-09 21:54 子诚- 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Problem Description 给你n个整数,请按从大到小的顺序输出其中前m大的数。 Input 每组测试数据有两行,第一行有两个数n,m(0<n,m<1000000),第二行包含n个各不相同,且都处于区间[-500000,500000]的整数。 Output 对每组测试数据按从大到小的顺序 阅读全文
posted @ 2018-07-09 15:37 子诚- 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Problem Description A Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1. F(1) 阅读全文
posted @ 2018-07-08 16:13 子诚- 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Problem Description Given an equilateral triangle with n the length of its side, program to count how many triangles in it. Input The length n (n <= 5 阅读全文
posted @ 2018-07-08 11:17 子诚- 阅读(257) 评论(0) 推荐(0) 编辑