11942 - Lumberjack Sequencing

All about problems in Volume 119. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

11942 - Lumberjack Sequencing

Post by brianfry713 » Thu Sep 11, 2014 1:15 am

Use this thread to discuss this problem.
Check input and AC output for thousands of problems on uDebug!

EMON
New poster
Posts: 1
Joined: Fri Mar 23, 2018 8:43 pm

Re: 11942 - Lumberjack Sequencing

Post by EMON » Mon Mar 26, 2018 8:21 pm

#include<iostream>
using namespace std;
int main()
{
int N,i,j;
cin>>N;
cout<<"Lumberjacks:"<<endl;
if(N>0 && N<20)
{
for(i=1;i<=N;i++)
{
int arr[10];
for(j=0;j<10;j++)
{
cin>>arr[j];
}
if((arr[0]<arr[1] && arr[1]<arr[2] && arr[2]<arr[3] && arr[3]<arr[4] && arr[4]<arr[5])||(arr[0]>arr[1] && arr[1]>arr[2] && arr[2]>arr[3] && arr[3]>arr[4] && arr[4]>arr[5]))
{
cout<<"Ordered"<<endl;
}
else
{
cout<<"Unordered"<<endl;
}
}
}
}


what is the problem here?

Post Reply

Return to “Volume 119 (11900-11999)”