Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
做了个测试,发现,图像宽度会很大,容易产生RE我的测试代码如下: #include<stdlib.h> #include<iostream> using namespace std; void main() { int width; while((cin>>width) && width>0) { cout<<width<<endl; int *lastData = new int[width];// last line data int *lastDiff = new int[width];//last line diff int *curData = new int[width]; int *curDiff = new int[width]; int value, count;//in cin>>value>>count; while(count) { for(int i=0; i<width; i++) lastData[i] = curDiff[i] = lastDiff[i] = curData[i] = 0; cin>>value>>count; } delete[] lastDiff; delete[] lastData; delete[] curDiff; delete[] curData; cout<<"0 0"<<endl; } cout<<0<<endl; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator