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:一次 AC ,0MS……滚滚长江…………In Reply To:一次 AC ,0MS……滚滚长江………… Posted by:songzhenqi at 2010-07-28 11:30:02 #include <stdio.h> int main(void) { int data[50000]; data[0] = 0; int *p = data + 1; for (int i = 1; p < data + 10001; ++i) { for (int j = 0; j < i; ++j) { *p = p[-1] + i; ++p; } } int x; while (scanf("%d", &x) , x) { printf("%d %d\n", x, data[x]); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator