CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: You are given a sequence of integers. Your task is to analyze the order of the elements in the sequence, print the sequence in reverse order, and determine the category of the sequence based on how the elements are arranged.



Categories

After reading the sequence, determine which of the following categories it belongs to:

A - Ascending Order  
   All elements are in strictly increasing order.

D - Descending Order  
   All elements are in strictly decreasing order.

B - Constant Order  
   All elements are equal.

N - None  
   The sequence does not belong to any of the above categories.



Your Task

1. Read an integer n representing the number of elements.
2. Read n integers into an array or vector.
3. Print the elements in reverse order.
4. Traverse the array to determine its category:
   - If every next element is greater than the previous, it is Ascending (A).
   - If every next element is smaller than the previous, it is Descending (D).
   - If all elements are equal, it is Constant (B).
   - Otherwise, it is None (N).
5. Print the corresponding category character after printing the reversed array.



Input Format

- An integer n.
- n integers representing the elements of the array.



Output Format

- First, print the array in reverse order with spaces.
- Then print a single character on a new line representing the category:
  A, D, B, or N.


Assumptions on Input

- 1 <= n <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    int a[n];
    for(int i=0; i<n; i++)
    cin >> a[i];

    for(int j=n-1; j>=0; j--)
    cout << a[j] << " ";

    bool b=true;
    for(int i=0; i< n-1; i++){
        if(a[i]!=a[i+1])
        b=false;
    }
    if(b==true){ cout << endl << "B"; exit(0); }

    bool aa=true;
    for(int i=0; i< n-1; i++){
        if(a[i]>a[i+1])
        aa=false;
    }
    if(aa==true) cout << endl << "A";

    bool d=true;
    for(int i=0; i< n-1; i++){
        if(a[i]<a[i+1])
        d=false;
    }
    if(d==true) cout << endl << "D";

    if(b==false && aa==false && d==false) cout << endl << "N";

    return 0;
}

Grading criterion: Declaration of  array size and array
Rating A: correctly declares the flag variables, array/vector size and array/vector
Rating B: Some issue. 

Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to analyze the order of the elements in the sequence, print the sequence in reverse order, and determine the category of the sequence based on how the elements are arranged.



Categories

After reading the sequence, determine which of the following categories it belongs to:

A - Ascending Order  
   All elements are in strictly increasing order.

D - Descending Order  
   All elements are in strictly decreasing order.

B - Constant Order  
   All elements are equal.

N - None  
   The sequence does not belong to any of the above categories.



Your Task

1. Read an integer n representing the number of elements.
2. Read n integers into an array or vector.
3. Print the elements in reverse order.
4. Traverse the array to determine its category:
   - If every next element is greater than the previous, it is Ascending (A).
   - If every next element is smaller than the previous, it is Descending (D).
   - If all elements are equal, it is Constant (B).
   - Otherwise, it is None (N).
5. Print the corresponding category character after printing the reversed array.



Input Format

- An integer n.
- n integers representing the elements of the array.



Output Format

- First, print the array in reverse order with spaces.
- Then print a single character on a new line representing the category:
  A, D, B, or N.


Assumptions on Input

- 1 <= n <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
void reverseArray(int array[], int sz){
    int start=0;
    int end=sz-1;
    while(start<end){
    swap(start,end);
    start++;
    end--;
}
}
int main(){
    int n;
    int nums[n];
    for(int i=0; i<n; i++){
        cin >> nums[i];
    }
    for(int i=0; i<n; i++){
        if(nums[i]==nums[i+1]){
            cout<< "B" << endl;
        }
        else if(nums[i]<=nums[i+1]){
            cout << "A" << endl;
        }
        else if(nums[i]>=nums[i+1]){
            cout << "D" << endl;
        }
        else 
        cout << "N" << endl;
    }
reverseArray(nums,n);
for(int i=0; i<n; i++){
    cout<< nums[i];
}
return 0;
}

Grading criterion: Declaration of  array size and array
Rating A: correctly declares the flag variables, array/vector size and array/vector
Rating B: Some issue. 

Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to analyze the order of the elements in the sequence, print the sequence in reverse order, and determine the category of the sequence based on how the elements are arranged.



Categories

After reading the sequence, determine which of the following categories it belongs to:

A - Ascending Order  
   All elements are in strictly increasing order.

D - Descending Order  
   All elements are in strictly decreasing order.

B - Constant Order  
   All elements are equal.

N - None  
   The sequence does not belong to any of the above categories.



Your Task

1. Read an integer n representing the number of elements.
2. Read n integers into an array or vector.
3. Print the elements in reverse order.
4. Traverse the array to determine its category:
   - If every next element is greater than the previous, it is Ascending (A).
   - If every next element is smaller than the previous, it is Descending (D).
   - If all elements are equal, it is Constant (B).
   - Otherwise, it is None (N).
5. Print the corresponding category character after printing the reversed array.



Input Format

- An integer n.
- n integers representing the elements of the array.



Output Format

- First, print the array in reverse order with spaces.
- Then print a single character on a new line representing the category:
  A, D, B, or N.


Assumptions on Input

- 1 <= n <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int vec[n]={};
    for(int i=0;i<n;i++)
    {
        cin >> vec[i];
    } 
    for(int i=n-1;i>=0;i--)
    {
        cout << vec[i] << " ";
    }
    cout << endl;
    int a=0,b=0,c=0;
    for(int i=0;i<n-1;i++)
    {
        if(vec[i]!=vec[i+1])
        {
            a++;
        }
        if(vec[i]>vec[i+1])
        {
            b++;
        }
        if(vec[i]<vec[i+1])
        {
            c++;
        }
    }
    if(a==0)
    {
        cout << "B";
    }
    else if(b==0)
    {
        cout << "A";
    }
    else if(c==0)
    {
        cout << "D";
    }
    else
    {
        cout << "N";
    }
}

Grading criterion: Declaration of  array size and array
Rating A: correctly declares the flag variables, array/vector size and array/vector
Rating B: Some issue. 

Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to analyze the order of the elements in the sequence, print the sequence in reverse order, and determine the category of the sequence based on how the elements are arranged.



Categories

After reading the sequence, determine which of the following categories it belongs to:

A - Ascending Order  
   All elements are in strictly increasing order.

D - Descending Order  
   All elements are in strictly decreasing order.

B - Constant Order  
   All elements are equal.

N - None  
   The sequence does not belong to any of the above categories.



Your Task

1. Read an integer n representing the number of elements.
2. Read n integers into an array or vector.
3. Print the elements in reverse order.
4. Traverse the array to determine its category:
   - If every next element is greater than the previous, it is Ascending (A).
   - If every next element is smaller than the previous, it is Descending (D).
   - If all elements are equal, it is Constant (B).
   - Otherwise, it is None (N).
5. Print the corresponding category character after printing the reversed array.



Input Format

- An integer n.
- n integers representing the elements of the array.



Output Format

- First, print the array in reverse order with spaces.
- Then print a single character on a new line representing the category:
  A, D, B, or N.


Assumptions on Input

- 1 <= n <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main() {
    int n;cin>>n;

    int nums[n];

    for(int i=0;i<n;i++){
        cin>>nums[i];
    }
    int nums2[n];

    for(int i=0;i<n;i++) {
        nums2[i]=nums[n-1-i];

    }
    for (int i=0;i<n;i++) {
        cout<<nums2[i]<<" ";
    }
    cout<<" "<<endl;
    bool asc=true;
    bool dsc=true;
    bool same=true;

     for(int i=0;i<n-1;i++){
        if(nums2[i]!=nums2[i+1]) {
            same=false;
            break;
        }
     }  
     if(same) { cout<<"B"<<endl;}

     else {
    

        for(int i=0;i<n-1;i++) {
           if (nums2[i]>nums2[i+1]) {
            asc=false; 
            
           }
           if (nums2[i]<nums2[i+1]) {
            dsc=false;

           }
           if (nums2[i]!=nums2[i+1]) {
            same=false;
           }
           

           }
           if(asc) { cout<<"D"<<endl;}
           if(dsc) { cout<<"A"<<endl;}
           if(same) { cout<<"B"<<endl;}
           if(asc==false && dsc==false && same==false ) {
            cout<<"N"<<endl;
           }
     }





    


    return 0;

    
}

Grading criterion: Declaration of  array size and array
Rating A: correctly declares the flag variables, array/vector size and array/vector
Rating B: Some issue. 

Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to analyze the order of the elements in the sequence, print the sequence in reverse order, and determine the category of the sequence based on how the elements are arranged.



Categories

After reading the sequence, determine which of the following categories it belongs to:

A - Ascending Order  
   All elements are in strictly increasing order.

D - Descending Order  
   All elements are in strictly decreasing order.

B - Constant Order  
   All elements are equal.

N - None  
   The sequence does not belong to any of the above categories.



Your Task

1. Read an integer n representing the number of elements.
2. Read n integers into an array or vector.
3. Print the elements in reverse order.
4. Traverse the array to determine its category:
   - If every next element is greater than the previous, it is Ascending (A).
   - If every next element is smaller than the previous, it is Descending (D).
   - If all elements are equal, it is Constant (B).
   - Otherwise, it is None (N).
5. Print the corresponding category character after printing the reversed array.



Input Format

- An integer n.
- n integers representing the elements of the array.



Output Format

- First, print the array in reverse order with spaces.
- Then print a single character on a new line representing the category:
  A, D, B, or N.


Assumptions on Input

- 1 <= n <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;

int main(){
    int n;
    cin>>n;
    int nums[n];
    for(int i=0;i<n;i++){
        cin>> nums[i];
    }
    for(int i=n-1;i>=0;i--){
        cout<<nums[i];
    }
    bool A,B,D;
    for(int i=1 ;i<n;i++){if (nums[i]==nums[0]) B = true;
                            else B = false;}
    for(int i=0 ; i<n-1;i++){if(nums[i]<=nums[i+1]) A =true;
                            else A =false;}
    for(int i=0 ; i<n-1;i++){if(nums[i]>=nums[i+1]) D=true;
                            else D =false;}
    if(B){ cout<<"B";}
    else if (A){cout<<"A";}
    else if (D){cout<<"D";}
    else cout<<"N"<<endl;
}

Grading criterion: Declaration of  array size and array
Rating A: correctly declares the flag variables, array/vector size and array/vector
Rating B: Some issue. 

Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to analyze the order of the elements in the sequence, print the sequence in reverse order, and determine the category of the sequence based on how the elements are arranged.



Categories

After reading the sequence, determine which of the following categories it belongs to:

A - Ascending Order  
   All elements are in strictly increasing order.

D - Descending Order  
   All elements are in strictly decreasing order.

B - Constant Order  
   All elements are equal.

N - None  
   The sequence does not belong to any of the above categories.



Your Task

1. Read an integer n representing the number of elements.
2. Read n integers into an array or vector.
3. Print the elements in reverse order.
4. Traverse the array to determine its category:
   - If every next element is greater than the previous, it is Ascending (A).
   - If every next element is smaller than the previous, it is Descending (D).
   - If all elements are equal, it is Constant (B).
   - Otherwise, it is None (N).
5. Print the corresponding category character after printing the reversed array.



Input Format

- An integer n.
- n integers representing the elements of the array.



Output Format

- First, print the array in reverse order with spaces.
- Then print a single character on a new line representing the category:
  A, D, B, or N.


Assumptions on Input

- 1 <= n <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
#include<vector>
int main()
{
    int n;
    cin>> n;
    vector<int> A;
    for(int i=0;i<n;++i)
    {
        int a;
        cin >> a;
        A.push_back(a);
    }
    for(int i=n-1;i>=0;--i)
        cout << A[i] << " ";
    cout << endl;
    
    bool a=true,b=true,c=true;
    int k =A[0];
    for(int i=0;i<n;++i)
    {
        if(A[i] != k) 
            a =false;
    }
    for(int i=0;i<n-1;++i)
    {
        if(A[i] > A[i+1]) 
            b = false;
    }
    for(int i=1;i<n;++i)
    {
        if(A[i] > A[i-1]) 
            c = false;
    }
    if(a){ 
        cout << "B" << endl;}
    else if(b)
        cout << "A" << endl;
    else if(c)
        cout << "D" << endl;
    else 
        cout << "N" <<endl;
}

Grading criterion: Declaration of  array size and array
Rating A: correctly declares the flag variables, array/vector size and array/vector
Rating B: Some issue. 

Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to analyze the order of the elements in the sequence, print the sequence in reverse order, and determine the category of the sequence based on how the elements are arranged.



Categories

After reading the sequence, determine which of the following categories it belongs to:

A - Ascending Order  
   All elements are in strictly increasing order.

D - Descending Order  
   All elements are in strictly decreasing order.

B - Constant Order  
   All elements are equal.

N - None  
   The sequence does not belong to any of the above categories.



Your Task

1. Read an integer n representing the number of elements.
2. Read n integers into an array or vector.
3. Print the elements in reverse order.
4. Traverse the array to determine its category:
   - If every next element is greater than the previous, it is Ascending (A).
   - If every next element is smaller than the previous, it is Descending (D).
   - If all elements are equal, it is Constant (B).
   - Otherwise, it is None (N).
5. Print the corresponding category character after printing the reversed array.



Input Format

- An integer n.
- n integers representing the elements of the array.



Output Format

- First, print the array in reverse order with spaces.
- Then print a single character on a new line representing the category:
  A, D, B, or N.


Assumptions on Input

- 1 <= n <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;

void check(int nums[], int n){
     int b=0; int c=0; int d=0;
     for(int i=0; i<n ; i++){
        int maxi=0; int maxs=0; int maxd=0;
        if(nums[i]>nums[maxi]) {
            maxi=i;  b++;
        }
        else if(nums[i]<nums[maxs]){
            maxs=i; c++;
        }
        else if(nums[i]==nums[maxd]){
            maxd=i; d++;
        }
     }

     for(int i=n-1; i>=0; i--){
        cout<<nums[i]<<" ";
    }
       cout<<endl;
      if(b==n-1){
            cout<<"A"<<endl;
        }
      else if(c==n-1){
        cout<<"D"<<endl;
      }
      else if(d==n){
        cout<<"B"<<endl;
      }
      else cout<<"N"<<endl;

}

int main(){
    int N;
    cin>>N;
    int nums[N];
    for(int i=0; i<N ;i++){
        cin>>nums[i];
    }
     check(nums , N);
     
    

}

Grading criterion: Declaration of  array size and array
Rating A: correctly declares the flag variables, array/vector size and array/vector
Rating B: Some issue. 

Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to analyze the order of the elements in the sequence, print the sequence in reverse order, and determine the category of the sequence based on how the elements are arranged.



Categories

After reading the sequence, determine which of the following categories it belongs to:

A - Ascending Order  
   All elements are in strictly increasing order.

D - Descending Order  
   All elements are in strictly decreasing order.

B - Constant Order  
   All elements are equal.

N - None  
   The sequence does not belong to any of the above categories.



Your Task

1. Read an integer n representing the number of elements.
2. Read n integers into an array or vector.
3. Print the elements in reverse order.
4. Traverse the array to determine its category:
   - If every next element is greater than the previous, it is Ascending (A).
   - If every next element is smaller than the previous, it is Descending (D).
   - If all elements are equal, it is Constant (B).
   - Otherwise, it is None (N).
5. Print the corresponding category character after printing the reversed array.



Input Format

- An integer n.
- n integers representing the elements of the array.



Output Format

- First, print the array in reverse order with spaces.
- Then print a single character on a new line representing the category:
  A, D, B, or N.


Assumptions on Input

- 1 <= n <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int nums[n];
for(int i=0;i<n;++i){
    cin>>nums[i];
}
int temp[n];
for(int i=0;i<n;++i){
    temp[i]=nums[n-1-i];
}
for(int i=0;i<n;++i){
    nums[i]=temp[i];
cout<<nums[i];}
cout<<endl;
for(int i=0;i<n;++i){
    if(nums[i]==nums[i+1])
    cout<<"B";
    else if(nums[i]<nums[i+1])
    cout<<"A";
    else if(nums[i]>nums[i+1])
    cout<<"D";
    else 
    cout<<"N";}}

Grading criterion: Declaration of  array size and array
Rating A: correctly declares the flag variables, array/vector size and array/vector
Rating B: Some issue. 

Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to analyze the order of the elements in the sequence, print the sequence in reverse order, and determine the category of the sequence based on how the elements are arranged.



Categories

After reading the sequence, determine which of the following categories it belongs to:

A - Ascending Order  
   All elements are in strictly increasing order.

D - Descending Order  
   All elements are in strictly decreasing order.

B - Constant Order  
   All elements are equal.

N - None  
   The sequence does not belong to any of the above categories.



Your Task

1. Read an integer n representing the number of elements.
2. Read n integers into an array or vector.
3. Print the elements in reverse order.
4. Traverse the array to determine its category:
   - If every next element is greater than the previous, it is Ascending (A).
   - If every next element is smaller than the previous, it is Descending (D).
   - If all elements are equal, it is Constant (B).
   - Otherwise, it is None (N).
5. Print the corresponding category character after printing the reversed array.



Input Format

- An integer n.
- n integers representing the elements of the array.



Output Format

- First, print the array in reverse order with spaces.
- Then print a single character on a new line representing the category:
  A, D, B, or N.


Assumptions on Input

- 1 <= n <= 10^5
- Elements are integers.

Student submission:
#include <iostream>
using namespace std;


int main(){
    int n; cin>>n;
    int arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    for(int i=n-1;i>=0;i--)
    {
        cout<<arr[i]<<" ";
    }
    cout<<endl;
 int count=0;
 int asc=0;
 int des=0;
    for(int i=0;i<n;i++)
    {
       if(arr[1]==arr[i]){ count++;} 
    }
    if(count==n){cout<<"B"; 
    return 0;}

    int  arr1[n];
    for(int i=0;i<n;i++)
    {
        arr1[i]=arr[i];
    }
    


    for(int i=0;i<n;i++)
    {
        for(int j=i;j<n;j++){
            if(arr1[j]<=arr1[i]){ int t=arr1[j];
                
                arr1[j]=arr1[i];
                arr1[i]=t;}
        }
    }




     
    for(int i=0;i<n;i++)
    {
       if(arr1[i]==arr[i]){ asc++;} 
    }
    
    for(int i=0;i<n;i++)
    {
       if(arr1[n-1-i]==arr[i]){ des++;} 
    }
    if(asc==n){ cout<<"A";}
    else if (des==n){
        cout<<"D";
    }
    else cout<<"N";
}

Grading criterion: Declaration of  array size and array
Rating A: correctly declares the flag variables, array/vector size and array/vector
Rating B: Some issue. 

Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to analyze the order of the elements in the sequence, print the sequence in reverse order, and determine the category of the sequence based on how the elements are arranged.



Categories

After reading the sequence, determine which of the following categories it belongs to:

A - Ascending Order  
   All elements are in strictly increasing order.

D - Descending Order  
   All elements are in strictly decreasing order.

B - Constant Order  
   All elements are equal.

N - None  
   The sequence does not belong to any of the above categories.



Your Task

1. Read an integer n representing the number of elements.
2. Read n integers into an array or vector.
3. Print the elements in reverse order.
4. Traverse the array to determine its category:
   - If every next element is greater than the previous, it is Ascending (A).
   - If every next element is smaller than the previous, it is Descending (D).
   - If all elements are equal, it is Constant (B).
   - Otherwise, it is None (N).
5. Print the corresponding category character after printing the reversed array.



Input Format

- An integer n.
- n integers representing the elements of the array.



Output Format

- First, print the array in reverse order with spaces.
- Then print a single character on a new line representing the category:
  A, D, B, or N.


Assumptions on Input

- 1 <= n <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std ;
int main () {
    int n;
    cin>>n;
    int nums[n] ;
    for( int i=0 ; i<n ; i++ ) {
        cin>>nums[i];
    }
     for( int i=n-1; i>-1 ; i-- ) {
        cout<<nums[i]<<" ";
    }
    cout<<endl;
     for( int i=0 ; i<n; i++ ) {
        if (nums[i]<= nums[i+1] ) {
        cout<<"A" ;
        break;
        }
        else if (nums[i]>=nums[i+1] ) {
        cout<<"D";
        break;
        }
        else if (nums[i]== nums[i+1] ) {
        cout<<"B";
        break;
        }
    else {cout<<"N" ;
    break; }

    }
}

Grading criterion: Declaration of  array size and array
Rating A: correctly declares the flag variables, array/vector size and array/vector
Rating B: Some issue. 

Rating C: Major issue
Rating D: 0
Assigned grade: B