| ||||||||||
| 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 | |||||||||
this is my code for the special judge, could anybody told my that my code is not true??void acceptnace(vector<int> ar)
{
for(int i=0;i<ar.size();i++)
{
int count=1;
for(int j=i-1;j>=0;j--)
{
if(ar[i]+i==j-ar[j]/*||ar[i]+count==ar[j]*/)
{
cout<<"REJECTED"<<endl;
return;
}
count++;
}
}
for(int i=0;i<ar.size();i++)
{
for(int j=i+1;j<ar.size();j++)
{
if(ar[i]==ar[j])
{
cout<<"REJECTED"<<endl;
return;
}
}
}
cout<<"ACCEPTED"<<endl;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator