
Acm
弱水三千321
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU_1013
这个题目尤其需要注意的是开始输入的时候的数的大小,开始输入时有可能非常的大超过了长整型的范围,所以不能开始用整形来存放输入的,,就是开始的时候没有注意到这个问题所以开始的时候一直没有AC,后来就是用一个数组接收输入,然后在经过第一步转化之后就可以用一个整数来装了原创 2014-08-01 20:04:07 · 387 阅读 · 0 评论 -
A+B for Input-Output Practice (I)
A+B for Input-Output Practice (I)#include using namespace std;//#define N 10000005//int S[N];//保存数组//int mmax[N];//保存前j的数据,分成i<=j组的最大值int main(){ int a,b; while(cin>>a>>b) { cout<<a+b原创 2014-09-06 17:27:47 · 516 阅读 · 0 评论 -
hdu_1012
#include #includeusing namespace std;int main(){ cout<<'n'<<' '<<'e'<<endl; cout<<"- -----------"<<endl; cout<<0<<' '<<1<<endl; cout<<1<<' '<<2<<endl; cout<<2<<' '<<2.5<<endl; fo原创 2014-08-14 10:48:30 · 323 阅读 · 0 评论 -
Merge Sorted Array ---leetcode---AC1
这道题采用了C++zh原创 2014-11-07 15:02:52 · 412 阅读 · 0 评论 -
Sort Colors —1—Leetcode
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers原创 2014-10-28 16:42:21 · 431 阅读 · 0 评论 -
Best Time to Buy and Sell Stock_Runtime error 1
#include#include#define INF -32760 using namespace std;class Solution {public: int maxProfit(vector &prices) { int *P; int result; P=new int[prices.size()]; for(int i=0;i<prices.siz原创 2014-10-30 20:18:15 · 435 阅读 · 0 评论 -
Insertion Sort List ---leetcode---Runtime Error
报错,,可能是因为链表的错误/** * Definition for singly-linked list. * struct ListNode * { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {publ原创 2014-11-07 09:14:15 · 501 阅读 · 0 评论 -
ZigZag Conversion ---leetcode
/*ZigZag Conversion.cpp*/#include#includeusing namespace std;string convert(string s,int nrows){ string last_result; if(nrows==1)//开始没有考虑 { last_result=s; return last_result; } //cout原创 2014-11-06 15:08:56 · 372 阅读 · 0 评论 -
leetcode_remove element
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.#原创 2014-12-03 08:58:41 · 486 阅读 · 0 评论 -
HDU 1003 Max Sum
#include using namespace std;#define N 100001int main(){ int a[N]; int T; int beging ,ending;//记录开始,结束的位置 int position1;//记录更改开始的位置 int thissum;//记录之前子数组大小 int maxsum;//记录最大值 cin>>T; for(原创 2014-09-05 22:08:14 · 336 阅读 · 0 评论 -
HDU A+B for Input-Output Practice (II)
#include using namespace std;int main(){int N;cin>>N;int a,b;while(N--){cin>>a>>b;cout}system("pause");return 0;}原创 2014-09-05 21:57:19 · 631 阅读 · 0 评论 -
A+B for Input-Output Practice (V)
#include using namespace std;#define N 1000int main(){ int numbers1; int arry[N]; int i; cin>>numbers1; while(numbers1--) { int numbers2; int result=0;原创 2014-07-31 15:03:53 · 408 阅读 · 0 评论 -
ACM输入输出
写给第一次参加现场赛的同学们一般来说ACM的现场赛会规定输入输出或者是文件输入标准输出也可能是文件输入文件输出如果没有规定的话那么一般就是标准的输入输出了那说一下输入输出的重定向一般用下面两种方法c++常用:#include ifstream filein("data.in"); // 定义一个文件输入流ofstream fileout("data.ou转载 2014-07-29 21:34:19 · 497 阅读 · 0 评论 -
HDU1018
#include #include #include void main(){int numbers;int i;long int n;long double result;int result_last;scanf("%d",&numbers);//printf("\n");for (i=0;i{scanf("%d",&n);//ffl原创 2014-07-29 21:50:46 · 443 阅读 · 0 评论 -
HDU_A+B for Input-Output Practice (III)
#include using namespace std;int main(){ int a,b; while(1) { cin>>a>>b; if(a==0&&b==0) break; cout<<a+b<<endl; } return 0;}原创 2014-07-31 14:19:26 · 314 阅读 · 0 评论 -
A+B for Input-Output Practice (IV)
#include using namespace std;#define N 1000int main(){ int numbers; int arry[N]; while(1) { int result=0; cin>>numbers; if(numbers==0) break;原创 2014-07-31 14:44:28 · 478 阅读 · 0 评论 -
HDU1019(未通过)
#include #include #include #define N 1000//求两个数的最大公约数.int lmc_min_2(int a,int b){ int min_ab,max_ab,r=0; if(a>=b) {max_ab=a;min_ab=b;} else {max_ab=b;min_ab=a;} r=min_ab;原创 2014-07-31 12:37:30 · 378 阅读 · 0 评论 -
A+B for Input-Output Practice (VI)
#include using namespace std;#define N 1000int main(){ int arry[N]; int numbers; while(cin>>numbers) { int result=0; int i=0; while(numbers--) {原创 2014-07-31 16:04:31 · 292 阅读 · 0 评论 -
A+B for Input-Output Practice (VII)
#include using namespace std;int main(){ int a,b; while((cin>>a>>b)!=NULL) { cout<<a+b<<endl; cout<<'\n'; } return 1;}原创 2014-07-31 21:21:25 · 316 阅读 · 0 评论 -
A+B for Input-Output Practice (VIII)
#include using namespace std;#define N 1000int main(){ int numbers0; cin>>numbers0; int arry[N]; int result; while(numbers0--) { int numbers2; cin>>numbers2; result=0;原创 2014-07-31 22:03:16 · 423 阅读 · 0 评论 -
leetcode——Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is原创 2014-12-11 22:04:30 · 505 阅读 · 0 评论