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

Re:I have Compile it in dev-c++.However, the OJ judge it "Compile Error".

Posted by Selfind at 2007-10-21 20:19:51 on Problem 1007
In Reply To:I have Compile it in dev-c++.However, the OJ judge it "Compile Error". Posted by:Selfind at 2007-10-21 20:17:27
//I got some right answers.
//The OJ JUDGE IT 'COMPILE ERROR' IN C++,'WRONG ANSWER' IN G++

#include <iostream>

using namespace std;

int main()
{   int a,b;
    cin >> a >> b;
    char DNA[100][50];
    
    for(int n=0;n<b;n++) 
    {
            for(int m=0;m<a;m++)
            {
                    cin>>DNA[n][m];
            }
    }
    
    int x[100];
    int loop;
    for(loop=0;loop<=49;loop++)
    x[loop]=0;
    
    for(int n=0;n<b;n++)
    {
                    for(int m=0;m<a;m++)
                    {
                                    for(int r=m;r<a;r++)
                                    {
                                            if(DNA[n][r]<DNA[n][m])
                                            x[n]++;
                                    }
                    }
    }
    for(int w=0;w<=(a*(a-1))/2;w++)
    {
            for(int n=0;n<b;n++)
            {
               if(x[n]==w)
               {
                          for(int m=0;m<a;m++)
                          {
                          cout<<DNA[n][m];
                          }
                          cout<<endl;
               }
            }
    }
    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