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;cin>>n;
    vector<int> num;
    for(int i=0;i<n;i++){
        int a;cin>>a;
        num.push_back(a);
    }
    vector<int> u=num;
    for(int i=0;i<n;i++){
        int v=u.back();
        cout<<v<<" ";
        u.pop_back();
    }
    cout<<endl;
    int c=0;
    for(int i=0;i<n-1;i++){
        if(num[i]!=num[i+1]) {c=1;break;}
    }
    if(c==0) {cout<<"B";return 0;}
    int c1=0;
    for(int i=0;i<n-1;i++){
        if(num[i]>=num[i+1]){
            c1++;
        }
    }
    if(c1==n-1){ cout<<"D";return 0;}
    int c2=0;
    for(int i=0;i<n-1;i++){
        if(num[i]<=num[i+1]){
            c2++;
        }
    }
    if(c2==n-1){ cout<<"A";return 0;}

    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 std::cin;
using std::cout;
using std::endl;

int main()
{
    int n;
    cin>>n;
    int a=0,b=0,d=0;

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

    for (int i=0;i<n;i++)
    {
        cout<<arr[n-i-1]<<" ";
    }
    cout<<endl;

    for (int i=0;i<(n-1);i++)
    {
        if(arr[i]==arr[i+1])
        {b++;}
    }

    for (int i=0;i<(n-1);i++)
    {
        if(arr[i]<=arr[i+1])
        {a++;}
    }

    for (int i=0;i<(n-1);i++)
    {
        if(arr[i]>=arr[i+1])
        {d++;}
    }

    if(b==n-1) {cout<<"B";}
    else if(a==n-1) {cout<<"A";}
    else if(d==n-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 A[100];
    for(int i=0; i<n;i++){
        cin>>A[i];
    }
    
    
      
      

    for( int i=0; i<n/2;i++){
        int temp=A[i];
        A[i]=A[n-1-i];
        A[n-1-i]=temp;
    }

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

        cout<<endl;

        int t=0;
      int u=0;
      int r=0;
      

    for( int i=0; i<n-1; i++){
        if( A[i]<=A[i+1])
        t++;
    }

    for( int i=0; i<n-1;i++){
        if( A[i]>=A[i+1])
        u++;
    }

    for( int i=0; i<n-1;i++){
        if( A[i]==A[i+1])
        r++;
    }

        
    if(t==(n-1)) cout<<"D";
    else if(u==(n-1))  cout<<"A";
     else if(r==(n-1))  cout<<"B";

    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;

bool ascending (int arr[], int a){
    int count=0;
    for(int b=0; b<a-1; b++){
        if(arr[b]<=arr[b+1]){
            count++;
        }
    }
    if(count==(a-1)){
        return true;
    }
    return false;
}


bool descending (int arr[], int a){
    int count=0;
    for(int b=0; b<a-1; b++){
        if(arr[b]>=arr[b+1]){
            count++;
        }
    }
    if(count==(a-1)){
        return true;
    }
return false;
}


bool same (int arr[], int a){
    int count=0;
    for(int b=0; b<a-1; b++){
        if(arr[b]==arr[b+1]){
            count++;
        }
    }
    if(count==(a-1) ){
        return true;
    }
return false;
}




int main(){
int n;
cin>>n;
int nums[n];
for ( int b=0 ; b<n ; b++){
    cin>>nums[b];
}
for ( int b=n-1 ; b>=0 ; b--){
    cout<<nums[b]<<" ";
}
cout<<endl;

if(ascending(nums,n)){ cout<<"A";}
else if(descending(nums,n)){ cout<<"D";}
else if(same){cout<<"B";}
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];
    int i;
    int max;
    for(i=0; i<n; i++)
    {
        cin>>nums[i];
    }
    for(i=0; i<n; ++i)
    {
        cout<<nums[n-i-1]<<" ";
    }
    
    for(i=0; i<n-1; ++i)
    {
        max = nums[i];
        if(max>nums[i+1] && i!=0)
        {
            break;
        }
        else if(max<nums[i+1] && i == n-2)
        {
            cout<<endl;
            cout<<"A";
        }
    }
    for(i=0; i<n-1; ++i)
    {
        max = nums[i];
        if(max<nums[i+1] && i!=0)
        {
            break;
        }
        else if(max>nums[i+1] && i == n-2)
        {
            cout<<endl;
            cout<<"D";
        }
    }
    for(i=0; i<n-1; ++i)
    {
        max = nums[i];
        if(max != nums[i+1])
        {
            break;
        }
        else if(max == nums[i+1] && i == n-2)
        {
            cout<<endl;
            cout<<"B";
        }
    }
    for(i=0; i<n; ++i)
    {
        max = nums[i];
        if(max>nums[i+1] && i!=0 && max<nums[i-1] && nums[i+1]<nums[i+2])
        {
            cout<<endl;
            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
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 j=n-1;j>=0;j--){
        cout<<nums[j]<<" ";
    }
    int mx=-1;
    for(int r=0;r<n;r++){
        mx=max(mx,nums[r]);
    }
    int mn=2000000;
    for(int q=0;q<n;q++){
        mn=min(mn,nums[q]);
    }

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

int main(){
    int n; cin>>n;

    vector<int>v;

    for(int i=0;i<n; i++){
        int d; cin>>d;
        v.push_back(d);
    }

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

    cout<<endl;
    bool order=false;
    int x=0;//to check order
    string c;

    //ascending
    for(int i=0;i<n-1;i++){
        if(v[i]<=v[i+1]){
            x++;
        }
        else{
            break;
        }
    }
    if(!order && x==n-1){
        order=true;
        c="A";
    }
    else{
        x=0;
    }

    //decending
    for(int i=0;i<n-1;i++){
        if(v[i]>=v[i+1]){
            x++;
        }
        else{
            break;
        }
    }
    if(!order &&x==n-1){
        order=true;
        c="D";
    }
    else{
        x=0;
    }

    //both
    for(int i=0;i<n-1;i++){
        if(v[i]==v[i+1]){
            x++;
        }
        else{
            break;
        }
    }
    if(!order &&x==n-1){
        order=true;
        c="B";
    }
    else{
        x=0;
    }
    cout<<c;

    if(!order){
        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>
#include<algorithm>
using namespace std;
int main(){
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
{
    cin>>arr[i];
}


int arr2[n];
for(int i=0;i<n;i++)
{
    arr2[i]=arr[n-i-1];
}
for(int i=0;i<n;i++)
{
    cout<<arr2[i]<<" ";
}
cout<<endl;
int p=0;
for(int i=0;i<n;i++)
{
    if(arr[i]==arr2[i]){
        p++;
    }
}
sort(arr2,arr2+n);
int k=0;int m=0;int j=0;
for(int i=0;i<n;i++)
{
    if(arr2[i]==arr[i]){
    k++;}
    if(arr2[i]==arr[n-i-1]){
    m++;
    }
}
if(p==n){cout<<"B";}
else if(k==n){cout<<"A";}
else if(m==n){cout<<"D";}
else {cout<<"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