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 |
注意这道题输入占1秒时间,最好自己写输入函数,另外用ll做随机的话一次就应该过不介意的话用下面这个: char get1char() { static char buffer[5600]; static int cnt; if(buffer[cnt]==0) { gets(buffer); cnt = 0; return '\n'; } return buffer[cnt++]; } int readInt() { int i = 0; bool positive = true; char ch = get1char(); while(ch==' '||ch=='\n')ch=get1char(); if(ch == '-') { positive = false; ch = get1char(); } while(ch<='9' && ch>='0') { i*=10; i+=ch-'0'; ch=get1char(); } if(positive) return i; return -i; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator