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 |
为什么是wrong answer,向各位大牛、小牛求救Source Problem: 1019 User: jiangpengchangan Memory: N/A Time: N/A Language: G++ Result: Wrong Answer Source #include<iostream> #include<cstddef> using namespace std; int main() { int t; cin>>t; int*p=new int[t]; for(int i=0;i<t;i++) cin>>p[i]; for(int i=0;i<t;i++) { size_t sum=0; for(int s=1;;s++) { sum+=s; if(sum>=p[i]) { cout<<s-(sum-p[i])<<endl; break;} } } delete []p; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator