Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么是wrong answer,向各位大牛、小牛求救

Posted by jiangpengchangan at 2007-09-18 08:24:38 on Problem 1019
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator