| ||||||||||
| 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 | |||||||||
不行了,各位大侠帮帮忙吧!#include <iostream.h>
#include <stdlib.h>
int cmp(const void *a, const void *b){
return *(int *)a - *(int *)b;
}
int main(){
unsigned int Place[10000], Num, i;
__int64 Vol = 0, Temp = 1;
cin >>Num;
for (i = 0; i < Num; i++)
cin >>Place[i];
qsort(Place, Num, sizeof(unsigned int), cmp);
for (i = 0; i < Num - 1; i++)
Vol += (Place[i+1] - Place[i]) * (i + 1) * (Num - i - 1) * 2;
while(Temp <= Vol ) Temp *= 10;
Temp /= 10;
while(Temp > 0){
cout <<int(Vol / Temp);
Vol %= 10 ;
Temp /= 10;
}
cout <<endl;
return 0;
}
总是 WA。
顺便问下, __int64类型的该怎么输出
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator