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>
#include<vector>
using namespace std;
int main()
{
    int n = 0;
    cin >> n;
    vector<int> nums;
    for(int i =0 ; i < n; i++)
    {
        int temp;
        cin >> temp;
        nums.push_back(temp);
    }
    for(int i = (nums.size()-1) ; i >=0; i--)
    {
        cout << nums[i] << " ";
    }
    cout << endl;
    for(int i =0 ; i < (nums.size()-1); i++)
    {
        if(nums[i] == nums[i+1])
        {
            if(i == (nums.size()-2))
            {
                cout << "B";
                return 0;
            }
        }
        else
        break;
    }
    for(int i =0 ; i < (nums.size()-1); i++)
    {
        if(nums[i] >= nums[i+1])
        {
            if(i == (nums.size()-2))
            {
                cout << "D";
                return 0;
            }
        }
        else
        break;
    }
    for(int i =0 ; i < (nums.size()-1); i++)
    {
        if(nums[i] <= nums[i+1])
        {
            if(i == (nums.size()-2))
            {
                cout << "A";
                return 0;
            }
        }
        else
        break;
    }
    cout << "N";

}

Grading criterion: Determining category
Ascending order
Rating A: correctly classifies the array as ascending

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];
char c;

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


    int reverse [n] ;

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


    for (int i = 0 ; i < n ; i++ ){
        cout << reverse [i] << " ";
    }
  cout << "\n";

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

    else c == 'N';
}
cout << c ;
}

Grading criterion: Determining category
Ascending order
Rating A: correctly classifies the array as ascending

Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: B
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]<<" ";
}return 0;}

Grading criterion: Determining category
Ascending order
Rating A: correctly classifies the array as ascending

Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: C
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]<<" ";
    }
    cout<<endl;


    int con=0;
    for(int i=0;i<n;i++){
        if(nums[i]!=nums[0]){++con;}
    }
    
    int asc=0;
    for(int i=0;i<n-1;i++){
        if(nums[i]>nums[i+1]){++asc;}
    }
   
    int dec=0;
    for(int i=0;i<n-1;i++){
        if(nums[i]<nums[i+1]){++dec;}
    }

    if(con==0){cout<<"B";}
    else if(asc==0){cout<<"A";}
    else if(dec==0){cout<<"D";}
    else{cout<<"N";}

    return 0;
}

Grading criterion: Determining category
Ascending order
Rating A: correctly classifies the array as ascending

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>
#include<vector>
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]<<" ";
    }
    cout<<endl;
    for(int i=0; i<n; i++){
        if(nums[i]>nums[i+1] &&  nums[i]<nums[i+1]){
            cout<<"B"<<endl;
            break;
        } else if(nums[i]<nums[i+1]){
            cout<<"A"<<endl;
            break;
        } else if(nums[i]>nums[i+1]){
            cout<<"D"<<endl;
            break;
        } else{
            cout<<"N"<<endl;
            break;
        }
    }
    

}

//&& nums[i]==nums[i+1]

Grading criterion: Determining category
Ascending order
Rating A: correctly classifies the array as ascending

Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: C
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;
using std::swap;
void max_to_end(int A[], int n) { 
    int maxi=0;
for(int i=1; i<n; i++)
if(A[i] > A[maxi])
maxi = i;
swap(A[maxi],A[n-1]);
}
void equal(int A[],int n){
    for(int a=0;a<n;a++){
        if(A[0]==A[a])
    }
                            
}
int main(){
    int a;
    cin>>a;
    int nums[a];
    int front[a];
    for(int k=0;k<a;k++){
        cin>>nums[k];
        front[k]=nums[k];
    }
    for(int s=0;s<a;s++){
        cout<<nums[a-s-1];
    };


        for(int p=a;p>0;p--){
        max_to_end(nums,p);
   

};int asc[a];
    for(int s=0;s<a;s++){
        if(front[s]==nums[s]){
            asc[s]=1;
        }else
        asc[s]=0;
}
for(int k=0;k<a;k++){
    if(asc[s]==1);
}
}

Grading criterion: Determining category
Ascending order
Rating A: correctly classifies the array as ascending

Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: B
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;
     int a = 0,b = 0,d = 0;
     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-1 ; i++){
        if ( nums[i] == nums[i+1])
      b++;
      if ( nums[i] >= nums[i+1])
      d++;
       if ( nums[i] <= nums[i+1])
      a++;
       
    }
     if ( b == n-1){
        cout << 'B'; }

      else if ( d == n-1){
        cout << 'D';
      }
      else  if ( a == n-1){
        cout << 'A';
      }
     
      
      else if (b != n-1 && a != n-1 && d != n-1)cout << 'N';
}

Grading criterion: Determining category
Ascending order
Rating A: correctly classifies the array as ascending

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>
#include<vector>
#include<algorithm>
using namespace std;

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

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

    vector<int> asc;
    vector<int> des;

    for(int i=0;i<n;i++)
    {
        asc.push_back(nums[i]);
        des.push_back(nums[i]);

    }
    sort(asc.begin(), asc.end());
    sort(des.begin(),des.end(),greater<int>());

    bool a=true;
    bool d=true;

    for(int i=0;i<n;i++)
    {
        if(nums[i]!=asc[i]) 
        {
            a=false;
            break;
        }
    }
    for(int i=0;i<n;i++)
    {
        if(nums[i]!=des[i]) 
        {
            d=false;
            break;
        }
    }
    cout<<endl;
    if(a==true && d==true) cout<<"B";

    else if(a==true && d==false) cout<<"A";

    else if(a==false && d==true) cout<<"D";

    else if(a==false && d==false) cout<<"N";

    }

Grading criterion: Determining category
Ascending order
Rating A: correctly classifies the array as ascending

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 reversePrint (int n,int arr[]) {
    for (int i = 0; i < n; i++) {
        cout << arr[n-1-i] << " ";
    }
    cout << endl;
}

void checkCases (int n, int arr[]) {
    bool A = true, B = true, D = true;

    for (int i = 0; i < n-1; i++) {
        if (arr[i] != arr[i+1]) {
            B = false; 
        } if (arr[i] < arr[i+1]) {
            D = false;
        } if (arr[i] > arr[i+1]) {
            A = false;
        }
    }

    if (A) {
        cout << "A";
    } else if (B) {
        cout << "B";
    } else if (D) {
        cout << "D";
    } else {
        cout << "N";
    }
}

int main () {
    int n; cin >> n;
    int nums[n];

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

    reversePrint(n, nums);
    checkCases(n, nums);
}

Grading criterion: Determining category
Ascending order
Rating A: correctly classifies the array as ascending

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 numsr[n];

     for(int i=0; i<n; i++){
        numsr[i]= nums[n-i-1];
     }
     
     for(int i=0; i<n; i++){
        cout<<numsr[i]<<" ";
     }
int max = nums[0];
int min = nums[0];
int eq = nums[0];



for(int i=1;i<n+1;i++){
    if(max<=nums[i]) max=nums[i];}
    if(max==nums[n-1] && max!=nums[0]) cout<<"A";

for(int i=1;i<n+1;i++){
    if(min>=nums[i]) min=nums[i];}
    if(min==nums[n-1]&& min!=nums[0]) cout<<"D";

for(int i=1;i<n+1;i++){
   if(eq==nums[i]) eq= nums[i];}
   if(eq==nums[n-1] && eq==nums[0]) cout<<"B";
 


}

Grading criterion: Determining category
Ascending order
Rating A: correctly classifies the array as ascending

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