04 2018 档案
摘要:Input测试输入包含若干测试用例。每个测试用例的第1行包含两个整数 N (#include #include #include using namespace std;struct Student{ strin...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1234Problem Description每天第一个到机房的人要把门打开,最后一个离开的人要把门关好。现有一堆杂乱...
阅读全文
摘要:参照HPUOJ1163题: 题目描述给定两个整数A和B,让你求出A+B的值。输入第一行输入一个整数T,代表有T组测试数据。每组数据占两行,第一行输入一个整数A,第二行输入一个整数B。注:1 #include ...
阅读全文
摘要:题目链接:http://codeforces.com/problemset/problem/299/A因为最大的数为十的九次方,所以我用了vector(根据输入的数据来分配相应的空间)来进行数据的存储和排序。代码...
阅读全文
摘要:题目链接:http://codeforces.com/contest/382/problem/A简要说明题目:输入一个字符串,并且含有字符“|”一个(除此之外输入只含有大写字母),表示分隔线,在分割线两边大写字母...
阅读全文
摘要:There is a hill with n holes around. The holes are signed from 0 to n-1. A rabbit must hide in one of the ...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2044这种题个人觉得就是找规律,把数据多列出来几个,你会发现得到的数列跟Fibonacci数列十分相像。。。当然,做...
阅读全文
摘要:问题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2043代码:#include #include #include using namespace std;int m...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2037下面我附上两篇代码,一篇是AC的,另一篇是WA的,错误原因是什么谁知道麻烦告诉我,谢谢了AC代码:#inclu...
阅读全文
摘要:列出前几个数据,你会发现结果跟菲波纳茨数列有点像#include using namespace std;int main(){ int n,m; int a[41]={0},i,k; cin>>n; while...
阅读全文
摘要:Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,...
阅读全文
摘要:注明出处,摘自 http://www.cnblogs.com/chaosheng/archive/2012/01/26/2329583.html(1) n条直线最多分平面问题 题目大致如:n条直线,最多...
阅读全文
摘要:#include #include using namespace std;int main(){ int n,m; int a[101],b[101]; int i,j,k,h,q; w...
阅读全文
摘要:今天是清明节假期的最后一天,突然发现自己在假期基本什么都没学,玩了三天!记得放假前自己还计划做前三年英语竞赛的卷子,但是一玩起来什么都被抛在了脑后,将我从无脑玩耍中拽出来的是学委在班群里发的C++老师布...
阅读全文
摘要:此题需要注意每个杨辉三角之间都要有一个空行#include #include using namespace std;int main(){ int a[31][31]={0},i; int n,j,k; whi...
阅读全文
摘要:要求A^B的后三位整数,每次乘积后再对1000取余即可,其中第一种为快速幂。#include #include using namespace std;long long mod_pow(long long x,...
阅读全文
摘要:需要注意的是,虽然最后输出为32位整数,但是a*b可能会超出int范围(最小公倍数=a*b/a和b最大公约数)在此提供两个写法都可以AC: 1 2 3 4 5 6 7 8 91011121314151617181...
阅读全文

浙公网安备 33010602011771号