- 博客(6)
- 收藏
- 关注
原创 java家庭作业——上车人数
题目描述公共汽车从始发站(称为第1站)开出,在始发站上车的人数为a,然后到达 第2站,在第2站有人上、下车,但上、下车的人数相同,因此在第2站开出时(即在到达第3站之前)车上的人数保持为a人。从第3站起(包括第3站)上、下 车的人数有一定的规律:上车的人数都是前两站上车人数之和,而下车人数等于上一站上车人数,一直到终点站的前一站(第n-1站),都满足此规律。现给出的 条件是:共有n个车站,始发...
2018-10-29 18:49:04 366
原创 hdu 2710【Max Factor】
Problem Description To improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct serial number in the range 1..20,000. Unfortunately, ...
2018-10-08 14:21:26 122
原创 学校月赛题目
A bit string has odd parity if the number of 1's is odd. A bit string has even parity if the number of 1's is even.Zero is considered to be an even number, so a bit string with no 1's has even parity....
2018-10-02 14:46:40 139
原创 练习题 最大连续子序列
题目:给定一个整数序列,a0, a1, a2, …… , an(项可以为负数),求其中最大的子序列和。如果所有整数都是负数,那么最大子序列和为0; 之前思路:#include<cstdio>int main(){ int i,j,max=0,sum=0,flag=0,flag1,flag2; int n,a[10005]; while(scanf("%d",&...
2018-09-24 18:55:06 223
原创 [codevs] 4125 2的n次方
这道题虽然是水题但是技巧性很强,对于初学者显然有很大的坑,即数据范围,我本来是使用<math.h>做的,结果发现出现100组数据的时候就没法AC了,然后换了while,即输入n便输出2的n次方,这样,便不会出现100组数做不了的情况。代码:#include<stdio.h>int t,n;long long num;int main(){ scanf("%d",&am...
2018-04-18 09:58:02 175
原创 [codevs--1126]统计数字
因为刚刚开始自学C++,所以很多头文件用起来还不是很得心应手,所以直接使用了#include<bits/stdc++.h>这个万能头文件,整道题可以说是有点水,没什么难点,主要就是几个经典算法的合集吧。以下是代码:#include<bits/stdc++.h>using namespace std;int a[200010];///100%的数据满足:1<=n<...
2018-04-08 14:37:29 231
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人