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;
void ReverseArray(int nums[],int n){
    int start=0;int end=n-1;
    while(start<end){
        swap(nums[start],nums[end]);
        start++;
        end--;
    }
}
int main (){
    
    int n;
    cin>>n;
    int nums[n];
    for(int i=0;i<n;i++){
        cin>>nums[i];
    }
    

    ReverseArray(nums,n);
for(int i=0;i<n;i++){
    cout<<nums[i]<<" ";
}
cout<<endl;

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


}

Grading criterion: Output
Rating A: Correctly prints the output
Rating B: Some Issue
Rating C: 0
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>
#include<vector>
using namespace std;
int main(){
    vector<int> nums;
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        nums.push_back(a);
    }
    for(int i=n-1;i>=0;i--){
        cout<<nums[i]<<" ";
    }
  int count=0;
  int asc=0;
  int des=0;
  for(int i=0;i<n;i++){
    if(nums[i]==nums[1]){
    count++;}
  }
  if(count==n){cout<<endl<<"B";}
    for(int i=0;i<n-1;i++){
        if(nums[i]>=nums[i+1]){
            des++;
        }
       
    }
     for(int i=0;i<n-1;i++){
            if(nums[i]<=nums[i+1]){
                asc++;
            }
        }
    if(asc==n-1){
        cout<<endl<<"A";
    }
    else if(des==n-1){
        cout<<endl<<"D";
    }
    else{
        cout<<endl<<"N";
    }
}

Grading criterion: Output
Rating A: Correctly prints the output
Rating B: Some Issue
Rating C: 0
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 size, counta=0, countd=0;
    cin >> size;
    int nums[size];
    for(int i=0; i<size; i++)
    cin >> nums[i];
    for(int i=size-1; i>=0; i--)
    cout << nums[i] << " ";
    cout<<endl;
    for(int i=1; i<size; i++){
        if(nums[i]>=nums[i-1])
        counta++;
        if(nums[i]<=nums[i-1])
        countd++;
    }
    if(counta==size-1 && countd!=size-1)
    cout << "A";
    else if(countd==size-1 && counta!=size-1)
    cout << "D";
    else if(counta==size-1 && countd==size-1)
    cout << "B";
    else
    cout << "N";
}

Grading criterion: Output
Rating A: Correctly prints the output
Rating B: Some Issue
Rating C: 0
Rating D: 0
Assigned grade: A