Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

做了个测试,发现,图像宽度会很大,容易产生RE

Posted by wlys_test at 2007-05-04 18:24:36 on Problem 1009
我的测试代码如下:
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator