[問題] ACM 10302 Summation of Polynomials

看板C_and_CPP (C/C++)作者 (Party)時間16年前 (2009/08/25 15:11), 編輯推噓2(205)
留言7則, 2人參與, 最新討論串1/1
題目 http://luckycat.kshs.kh.edu.tw/homework/q10302.htm code #include <iostream> #include <math.h> using namespace std; int main() { int num; while(cin>>num) { if(num<1 || num>50000) break; cout<<(long long) (pow(num,2)*pow(num+1,2)/4)<<endl; } system("pause"); return 0; } online judge結果 Hi, This is an automated response from UVa Online Judge. Your submission with number 7340552 for the problem 10302 - Summation of Polynomials has failed with verdict Wrong answer. Although your program was successful at compilation and execution stages, it was not able of solving the proposed problem. Best regards, The UVa Online Judge team 我不知道錯在哪 不知道測資是甚麼 我自己測的話 沒問題 有人可以救救我嗎 - - -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.117.172.23

08/25 15:21, , 1F
測資也就 1 到 50000 而已, 全部測過也不用多久 XD
08/25 15:21, 1F

08/25 15:22, , 2F
50000 拿下去測有對嗎?
08/25 15:22, 2F

08/25 15:23, , 3F
生個檔案裡面放 1 到 50000 的數字餵給你的程式 再檢查看看
08/25 15:23, 3F

08/25 15:26, , 4F
然後... system("pause"); 要記得拿掉喔~
08/25 15:26, 4F

08/25 15:27, , 5F
我試了一下 4=>99 9=>2024 10=>3024 錯的
08/25 15:27, 5F

08/25 15:28, , 6F
有些對 有些錯 ....
08/25 15:28, 6F

08/25 16:05, , 7F
嗯 我函式 pow 格式錯了 改好了 AC =)
08/25 16:05, 7F
文章代碼(AID): #1AauwlrA (C_and_CPP)
文章代碼(AID): #1AauwlrA (C_and_CPP)