Skip to content

small doubt #1

Open
Open
@kotadinesh

Description

@kotadinesh

Hi Bro, I am new to competitive programming I want to know what the difference between your code and my code is? I got WA for my code but your code gets accepted.

include

include

int greater_num(int a,int b)
{
int big,temp=0;
if(a>=temp)
big=a;
else
big=b;
return b;
}

using namespace std;

int main()
{
int n,m,g,i,temp;
vector s;
vector q;
cin>>n;
for(i=0;i<n;i++)
{
cin>>temp;
s.push_back(temp);
}
cin>>m;
for(i=0;i<m;i++)
{
cin>>temp;
q.push_back(temp);
}

g=greater_num(n,m);

for(i=1;i<=g;i++)
{
                 if(s[i]==q[i])
                 cout<<i+1<<" ";
}


system("pause");
return 0;

}

Thank you.

please mail me on [email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions