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>
int main(){
    using namespace std;
    vector<int>nums;
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        int input;
        cin>>input;
        nums.push_back(input);
    }
    for(int i=0;i<n;i++){
        cout<<nums[n-1-i]<<' ';
    }
    cout<<endl;
    bool inc=false,dec=false,eq=false;
    int temp=nums[0];
    int i=1;
    while(temp==nums[i]){
    temp=nums[i];
    if(i==n-1){eq=true;
    break;}
    i++;}
    temp=nums[0];
    i=1;
    while(temp<=nums[i]){
    temp=nums[i];;
    if(i==n-1){inc=true;
    break;}
    i++;}
    temp=nums[0];
    i=1;
    while(temp>=nums[i]){
    temp=nums[i];
    if(i==n-1){dec=true;
    break;}
    i++;}
    if(eq){cout<<'B';}
    else if(dec){cout<<"D";}
    else if(inc){cout<<"A";}
    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;
using std::cout;using std :: cin;
int main()
{
    int n;
    cin >>n;
    int nums[n];
    for (int i=0;i<n;i++)
    {
        cin >> nums[i];
    }
    for (int i=0;i<n;i++){
        cout<<nums[n-1-i]<<" ";
    }
    cout<<endl;
    for (int i=0; i<n; i++){
        if (nums [i]>=nums[i+1])
        
        {
            cout<<"D";
        }
        
   
         if (nums[i]<=nums[i+1])
        {
            cout<<"A";
        }

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

cout<<nums[n]<<""<<endl;

 if(nums[n-1]<nums[0]);
cout<<"A"<<""<<endl;
 if(nums[n-1]>nums[0])
cout<<"D"<<""<<endl;
 if(nums[n-1]=nums[0])
cout<<"B"<<""<<endl;
if(nums[n-1]!=nums[0])
 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;

bool check(int A[],int n){
    bool k=true;
    for (int i=0;i<n-1;i++){
        if(A[i]!=A[i+1])
        k=false;
    }
        return k;
}

bool checkasc(int A[],int n){
    bool k=true;
    for (int i=0;i<n-1;i++){
        if(A[i]>A[i+1])
        k=false;
    }
    return k;
}

bool checkdes(int A[],int n){
    bool k=true;
    for (int i=0;i<n-1;i++){
        if(A[i]<A[i+1])
        k=false;
    }
    return k;
}

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

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

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

    if(check(arr,s))
    cout<<"\nB";
    else if(checkasc(arr,s))
    cout<<"\nA";
    else if(checkdes(arr,s))
    cout<<"\nD";
    else
    cout<<"\nN";

    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>
using namespace std;

bool ascend(std::vector<int> v, int n){
	bool is = true;
	for (int i = 0; i < n; ++i)
	{
		if(i != 0){
			if(v[i] < v[i-1]){
				is = false;
			}
		}
	}
	return is;
}

bool dscend(std::vector<int> v, int n){
	bool is = true;
	for (int i = 0; i < n; ++i)
	{
		if(i != 0){
			if(v[i] > v[i-1]){
				is = false;
			}
		}
	}
	return is;
}

bool same(std::vector<int> v, int n){
	bool is = true;
	for (int i = 0; i < n; ++i)
	{
		if(i != 0){
			if(v[i] != v[i-1]){
				is = false;
			}
		}
	}
	return is;
}
int main(){
    vector<int> nums;
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
    	int inp;
    	cin >> inp;
    	nums.push_back(inp);
    }
    for (int i = 0; i < n; ++i)
    {
    	cout << nums[n-i-1] << " ";
    }
    cout << endl;
    if(same(nums, n)){
    	cout << 'B';
    }else if(ascend(nums, n)){
    	cout << 'A';
    }else if(dscend(nums, 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>
#include <iomanip>
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] << " ";
    }

    int y=1, t=1, o=1;
    bool r=true;
    for (int i=1; i<n; i++){
        if (nums[i] > nums[i-1]) { y++; r= false;}
        else if (nums[i] < nums[i-1]){ t++; r= false;}
        else if (nums[i] = nums[i-1]) { y++; t++;o++;}
        
}
if (y==n && o!=n){
    cout << endl <<"A";}
    
    if ( t==n && o!=n ){ cout << endl<<"D";}

if(o==n){ cout << endl <<"B";}
if (y!=n && t!=n && o!=n){ cout << endl <<"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=1; i<n; i++){
        cout<<nums[n-i]<<" ";
    }
    cout<<nums[0]<<endl;

    int a=0, b=0, c=0;
    for(int i=0; i<n; i++){
        if(nums[0]==nums[i]){a++;}
        else break;
    }
    
     for(int i=0; i<n-1; i++){
     if(nums[i]<=nums[i+1]){b++;}
     else break;   
    }

    for(int i=0; i<n; i++){
        if(nums[i+1]<=nums[i]){c++;}
     else break; 
    }

    if(a==n){cout<<"B";}
    else if(b==n){cout<<"A";}
    else if(c==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
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 std::cin;
using std::cout;
int main(){
    int n;
    cin>>n;
    std::vector <int> nums(n);
    for (int i=0;i<n;i++){
        cin>>nums[i];
    }
    for (int i=0;i<n;i++){
        cout<<nums[n-1-i]<<" ";
    }
    cout<<std::endl;
    int count1=0,count2=0,count3=0;
    for(int i=0;i<n-1;i++){
        if(nums[i]==nums[i+1]){
            count1++;
        }
    }
    for(int i=0;i<n-1;i++){
        if(nums[i]<=nums[i+1]){
            count2++;
        }
    }
    for(int i=0;i<n-1;i++){
        if(nums[i]>=nums[i+1]){
            count3++;
        }
    }
    if(count1==n-1){cout<<"B";}
    else if (count2==n-1){cout<<"A";}
    else if (count3==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;
    char out='N';
    int count1=0,count2=0,count3=0;
    cin>>n;
    int input[n];
    for( int i=0;i<n;i++){
        cin>>input[i];
    }
    for( int i=n-1;i>=0;i--){
        cout<<input[i]<<" ";
    }
    cout<<endl;
    for( int i=0;i<n-1;i++){
        if( input[i]==input[i+1]) count1++;
    }
    for( int i=0;i<n-1;i++){
        if( input[i]>=input[i+1]) count2++;
    }
    for( int i=0;i<n-1;i++){
        if( input[i]<=input[i+1]) count3++;
    }
    if( count2==(n-1)) out='D';
    if( count3==(n-1)) out='A';
     if( count1==(n-1)) out='B';
    cout<<out<<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;
int main(){
    int nums[100];int n;
    cin>>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 same=false;
for(int i=0;i<n-1;i++){
    if(nums[i]==nums[i+1])same=true; else{same=false ;break;}
}
char x;
for(int i=0;i<n-1;i++){
    if(nums[i]<=nums[i+1])x='A';else{ x='N';break;}
}
if(x=='N'){
for(int i=0;i<n-1;i++){
    if(nums[i]>=nums[i+1])x='D';else{x='N';break;}
}}
if(same=true)x=='B';
    cout << x; }

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