CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Write a C++ program to calculate the number of possible sequences that can be formed under certain conditions using recursion. The program should define a recursive function 'combination(int n, int k)' which calculates the total number of ways to arrange 'n' and 'k' such that the count follows a specific recursive relationship.

Code must fulfil these requirements:
A. Input: Accept two integers, 'n' and 'k', from the user

B. Recursive Function Definition: Define a recursive function 'int combination(int n, int k)' that follows the rules below:

C. Base Cases:
    1. If 'n == 1' and 'k >= 1', return '1'
       (Only one way to arrange if one element is available but multiple positions exist.)
    2. If 'k == 1' and 'n >= k', return 'n'
       (If there’s only one position, the number of ways equals the number of elements available.)
    3. If either 'n < 0' or 'k < 0', return '0'
       (Negative values are invalid)

D. Recursive Relation: combination(n, k) = combination(n - 1, k) + combination(n, k - 1)

E. Function Call and Output

Student submission:
#include <iostream>
using namespace std;
int c(int n,int k){

    if (n==1){
        return 1;
    }
    if (k==1){
        return n;
    }
    return(c(n-1,k)+c(k,n-1));
}
int main(){
    int n,k,ans;
    cin>>n;
    cin>>k;
    cout<<c(n,k);
    return 0;
}

Grading criterion: Implementation of the Recursive Relationship
Rating A: Correctly implements the recursive call as defined in the hint. 

Rating B: some issue
Rating C: major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to calculate the number of possible sequences that can be formed under certain conditions using recursion. The program should define a recursive function 'combination(int n, int k)' which calculates the total number of ways to arrange 'n' and 'k' such that the count follows a specific recursive relationship.

Code must fulfil these requirements:
A. Input: Accept two integers, 'n' and 'k', from the user

B. Recursive Function Definition: Define a recursive function 'int combination(int n, int k)' that follows the rules below:

C. Base Cases:
    1. If 'n == 1' and 'k >= 1', return '1'
       (Only one way to arrange if one element is available but multiple positions exist.)
    2. If 'k == 1' and 'n >= k', return 'n'
       (If there’s only one position, the number of ways equals the number of elements available.)
    3. If either 'n < 0' or 'k < 0', return '0'
       (Negative values are invalid)

D. Recursive Relation: combination(n, k) = combination(n - 1, k) + combination(n, k - 1)

E. Function Call and Output

Student submission:
#include<iostream>
using namespace std;
 int fun( int n,int k){
    if(n=n-2) 
     return k;
    return fun(n-1, k) + fun(n, k-1);


 }
int main(){
    int n,k;
    cin>>n>>k;
    

    cout<<fun(n,k);
}

Grading criterion: Implementation of the Recursive Relationship
Rating A: Correctly implements the recursive call as defined in the hint. 

Rating B: some issue
Rating C: major issue
Rating D: 0
Assigned grade: C
Problem: Write a C++ program to calculate the number of possible sequences that can be formed under certain conditions using recursion. The program should define a recursive function 'combination(int n, int k)' which calculates the total number of ways to arrange 'n' and 'k' such that the count follows a specific recursive relationship.

Code must fulfil these requirements:
A. Input: Accept two integers, 'n' and 'k', from the user

B. Recursive Function Definition: Define a recursive function 'int combination(int n, int k)' that follows the rules below:

C. Base Cases:
    1. If 'n == 1' and 'k >= 1', return '1'
       (Only one way to arrange if one element is available but multiple positions exist.)
    2. If 'k == 1' and 'n >= k', return 'n'
       (If there’s only one position, the number of ways equals the number of elements available.)
    3. If either 'n < 0' or 'k < 0', return '0'
       (Negative values are invalid)

D. Recursive Relation: combination(n, k) = combination(n - 1, k) + combination(n, k - 1)

E. Function Call and Output

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

int count (int n, int k){
    if(n ==1){
        return 1;
    }
    if(k ==1){
        return n;
    }
    return((count((n-1),k)) + (count(n,(k-1))));
}

int main (){
    int n;
    int k;

    cin >> n;
    cin >> k;

    cout << count(n , k);

}

Grading criterion: Implementation of the Recursive Relationship
Rating A: Correctly implements the recursive call as defined in the hint. 

Rating B: some issue
Rating C: major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to calculate the number of possible sequences that can be formed under certain conditions using recursion. The program should define a recursive function 'combination(int n, int k)' which calculates the total number of ways to arrange 'n' and 'k' such that the count follows a specific recursive relationship.

Code must fulfil these requirements:
A. Input: Accept two integers, 'n' and 'k', from the user

B. Recursive Function Definition: Define a recursive function 'int combination(int n, int k)' that follows the rules below:

C. Base Cases:
    1. If 'n == 1' and 'k >= 1', return '1'
       (Only one way to arrange if one element is available but multiple positions exist.)
    2. If 'k == 1' and 'n >= k', return 'n'
       (If there’s only one position, the number of ways equals the number of elements available.)
    3. If either 'n < 0' or 'k < 0', return '0'
       (Negative values are invalid)

D. Recursive Relation: combination(n, k) = combination(n - 1, k) + combination(n, k - 1)

E. Function Call and Output

Student submission:
#include<iostream>
using namespace std;
int func(int n, int k){
    if(k==0) return 0;
    if(n==1) return 1;
    if(k==1) return n;
    return func(n-1,k) + func(n,k-1);
}

int main(){
    int n,k;
    cin>>n>>k;
    cout<<func(n,k);
	return 0;
}

Grading criterion: Implementation of the Recursive Relationship
Rating A: Correctly implements the recursive call as defined in the hint. 

Rating B: some issue
Rating C: major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to calculate the number of possible sequences that can be formed under certain conditions using recursion. The program should define a recursive function 'combination(int n, int k)' which calculates the total number of ways to arrange 'n' and 'k' such that the count follows a specific recursive relationship.

Code must fulfil these requirements:
A. Input: Accept two integers, 'n' and 'k', from the user

B. Recursive Function Definition: Define a recursive function 'int combination(int n, int k)' that follows the rules below:

C. Base Cases:
    1. If 'n == 1' and 'k >= 1', return '1'
       (Only one way to arrange if one element is available but multiple positions exist.)
    2. If 'k == 1' and 'n >= k', return 'n'
       (If there’s only one position, the number of ways equals the number of elements available.)
    3. If either 'n < 0' or 'k < 0', return '0'
       (Negative values are invalid)

D. Recursive Relation: combination(n, k) = combination(n - 1, k) + combination(n, k - 1)

E. Function Call and Output

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

int func(int n,int k){
    if (n ==0){return 0;}
    if (k ==0){return 0;}
    if (n ==1){return 1;}
    if (k ==1){return n;}
  return func(n-1,k)+ func(n,k-1);
}





int main(){

    int n,k;
    cin>>n>>k;

   cout<< func(n,k)<<endl;
}

Grading criterion: Implementation of the Recursive Relationship
Rating A: Correctly implements the recursive call as defined in the hint. 

Rating B: some issue
Rating C: major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to calculate the number of possible sequences that can be formed under certain conditions using recursion. The program should define a recursive function 'combination(int n, int k)' which calculates the total number of ways to arrange 'n' and 'k' such that the count follows a specific recursive relationship.

Code must fulfil these requirements:
A. Input: Accept two integers, 'n' and 'k', from the user

B. Recursive Function Definition: Define a recursive function 'int combination(int n, int k)' that follows the rules below:

C. Base Cases:
    1. If 'n == 1' and 'k >= 1', return '1'
       (Only one way to arrange if one element is available but multiple positions exist.)
    2. If 'k == 1' and 'n >= k', return 'n'
       (If there’s only one position, the number of ways equals the number of elements available.)
    3. If either 'n < 0' or 'k < 0', return '0'
       (Negative values are invalid)

D. Recursive Relation: combination(n, k) = combination(n - 1, k) + combination(n, k - 1)

E. Function Call and Output

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

int c(int n, int k){
    if (k == 0) return 1;
    if (n ==1) return 1;
    
    return c(n-1,k)+c(n,k-1);
}

int main(){
    int n, k;
    cin>>n>>k;
    cout << c(n,k);
}

Grading criterion: Implementation of the Recursive Relationship
Rating A: Correctly implements the recursive call as defined in the hint. 

Rating B: some issue
Rating C: major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to calculate the number of possible sequences that can be formed under certain conditions using recursion. The program should define a recursive function 'combination(int n, int k)' which calculates the total number of ways to arrange 'n' and 'k' such that the count follows a specific recursive relationship.

Code must fulfil these requirements:
A. Input: Accept two integers, 'n' and 'k', from the user

B. Recursive Function Definition: Define a recursive function 'int combination(int n, int k)' that follows the rules below:

C. Base Cases:
    1. If 'n == 1' and 'k >= 1', return '1'
       (Only one way to arrange if one element is available but multiple positions exist.)
    2. If 'k == 1' and 'n >= k', return 'n'
       (If there’s only one position, the number of ways equals the number of elements available.)
    3. If either 'n < 0' or 'k < 0', return '0'
       (Negative values are invalid)

D. Recursive Relation: combination(n, k) = combination(n - 1, k) + combination(n, k - 1)

E. Function Call and Output

Student submission:
#include<iostream>
using namespace std;
int sequences(int n, int k)
{
    if(n==1)
    {
        return 1;
    }
    if(k==1)
    {
        return n;
    }
    return (sequences(n-1,k) + sequences(n,k-1));
}
int main()
{
    int n,k;
    cin>>n>>k;
    int res=sequences(n,k);
    cout<<res<<endl;
}

Grading criterion: Implementation of the Recursive Relationship
Rating A: Correctly implements the recursive call as defined in the hint. 

Rating B: some issue
Rating C: major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to calculate the number of possible sequences that can be formed under certain conditions using recursion. The program should define a recursive function 'combination(int n, int k)' which calculates the total number of ways to arrange 'n' and 'k' such that the count follows a specific recursive relationship.

Code must fulfil these requirements:
A. Input: Accept two integers, 'n' and 'k', from the user

B. Recursive Function Definition: Define a recursive function 'int combination(int n, int k)' that follows the rules below:

C. Base Cases:
    1. If 'n == 1' and 'k >= 1', return '1'
       (Only one way to arrange if one element is available but multiple positions exist.)
    2. If 'k == 1' and 'n >= k', return 'n'
       (If there’s only one position, the number of ways equals the number of elements available.)
    3. If either 'n < 0' or 'k < 0', return '0'
       (Negative values are invalid)

D. Recursive Relation: combination(n, k) = combination(n - 1, k) + combination(n, k - 1)

E. Function Call and Output

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

int rec(int n ,k){
    for(n=0;)
}
int main(){
    cin >>n,k;
    
}

Grading criterion: Implementation of the Recursive Relationship
Rating A: Correctly implements the recursive call as defined in the hint. 

Rating B: some issue
Rating C: major issue
Rating D: 0
Assigned grade: C
Problem: Write a C++ program to calculate the number of possible sequences that can be formed under certain conditions using recursion. The program should define a recursive function 'combination(int n, int k)' which calculates the total number of ways to arrange 'n' and 'k' such that the count follows a specific recursive relationship.

Code must fulfil these requirements:
A. Input: Accept two integers, 'n' and 'k', from the user

B. Recursive Function Definition: Define a recursive function 'int combination(int n, int k)' that follows the rules below:

C. Base Cases:
    1. If 'n == 1' and 'k >= 1', return '1'
       (Only one way to arrange if one element is available but multiple positions exist.)
    2. If 'k == 1' and 'n >= k', return 'n'
       (If there’s only one position, the number of ways equals the number of elements available.)
    3. If either 'n < 0' or 'k < 0', return '0'
       (Negative values are invalid)

D. Recursive Relation: combination(n, k) = combination(n - 1, k) + combination(n, k - 1)

E. Function Call and Output

Student submission:
#include<iostream>
using namespace std;
int recurse(int n,int k){
    if(k==0){
        return 1;
    }
    if(n==0){
        return 0;
    }

    return (recurse(n-1,k)+recurse(n,k-1));
    
}
int main(){
    int n;
    int k;
    cin>>n;
    cin>>k;
    int y=recurse(n,k);
    cout<<y;
}

Grading criterion: Implementation of the Recursive Relationship
Rating A: Correctly implements the recursive call as defined in the hint. 

Rating B: some issue
Rating C: major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to calculate the number of possible sequences that can be formed under certain conditions using recursion. The program should define a recursive function 'combination(int n, int k)' which calculates the total number of ways to arrange 'n' and 'k' such that the count follows a specific recursive relationship.

Code must fulfil these requirements:
A. Input: Accept two integers, 'n' and 'k', from the user

B. Recursive Function Definition: Define a recursive function 'int combination(int n, int k)' that follows the rules below:

C. Base Cases:
    1. If 'n == 1' and 'k >= 1', return '1'
       (Only one way to arrange if one element is available but multiple positions exist.)
    2. If 'k == 1' and 'n >= k', return 'n'
       (If there’s only one position, the number of ways equals the number of elements available.)
    3. If either 'n < 0' or 'k < 0', return '0'
       (Negative values are invalid)

D. Recursive Relation: combination(n, k) = combination(n - 1, k) + combination(n, k - 1)

E. Function Call and Output

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

int sequence(int n, int k){
    if(n == 1){
        return 1;
    }
    if(n== 2 && k == 2){
        return 3;
    }
    if(n>k && k == 1){
        return n;
    }
    return (sequence(n-1,k)+ sequence(n,k-1));

}
int main(){
    int n,k;
    cin>>n>>k;
    cout<<sequence(n,k);
}

Grading criterion: Implementation of the Recursive Relationship
Rating A: Correctly implements the recursive call as defined in the hint. 

Rating B: some issue
Rating C: major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that accepts a dynamically sized array and performs the following operations:

Initialization: Accept an integer n denoting the array size, followed by n integer elements.

Reverse Traversal: Output the array elements in reverse sequence, space-separated, on a single line.

Peak Detection: Identify all "peak" elements within the array. A peak is strictly defined as an element that is greater than both its preceding and succeeding neighbors. Print the 0-based indices of all identified peaks on a new line, separated by spaces. If the array contains no peaks, leave the second line blank.

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

int main(){
    int n;
    cin>>n;
    int no[n];
    for(int i=0;i<n;i++){
                        cin>>no[i];}
    for(int i=1;i<=n;i++){cout<<no[n-i]<<" ";}
    cout<<endl;
    
    for(int i=1;i<n;i++){
        if(no[i-1]<no[i] && no[i+1]<no[i]){cout<<i<<endl;}
    }
}

Grading criterion: Declaration of variables and array/vector.
Rating A: correctly declares the two variables n, and array/vector

Rating B: Some Issue.
Rating C: Major Issue.
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that accepts a dynamically sized array and performs the following operations:

Initialization: Accept an integer n denoting the array size, followed by n integer elements.

Reverse Traversal: Output the array elements in reverse sequence, space-separated, on a single line.

Peak Detection: Identify all "peak" elements within the array. A peak is strictly defined as an element that is greater than both its preceding and succeeding neighbors. Print the 0-based indices of all identified peaks on a new line, separated by spaces. If the array contains no peaks, leave the second line blank.

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;
    for (int i=1;i<n-1;i++){
        if(arr[i]>arr[i-1]&&arr[i]>arr[i+1]){
            cout<<i;
        }
    }
}

Grading criterion: Declaration of variables and array/vector.
Rating A: correctly declares the two variables n, and array/vector

Rating B: Some Issue.
Rating C: Major Issue.
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that accepts a dynamically sized array and performs the following operations:

Initialization: Accept an integer n denoting the array size, followed by n integer elements.

Reverse Traversal: Output the array elements in reverse sequence, space-separated, on a single line.

Peak Detection: Identify all "peak" elements within the array. A peak is strictly defined as an element that is greater than both its preceding and succeeding neighbors. Print the 0-based indices of all identified peaks on a new line, separated by spaces. If the array contains no peaks, leave the second line blank.

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

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

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

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

Grading criterion: Declaration of variables and array/vector.
Rating A: correctly declares the two variables n, and array/vector

Rating B: Some Issue.
Rating C: Major Issue.
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that accepts a dynamically sized array and performs the following operations:

Initialization: Accept an integer n denoting the array size, followed by n integer elements.

Reverse Traversal: Output the array elements in reverse sequence, space-separated, on a single line.

Peak Detection: Identify all "peak" elements within the array. A peak is strictly defined as an element that is greater than both its preceding and succeeding neighbors. Print the 0-based indices of all identified peaks on a new line, separated by spaces. If the array contains no peaks, leave the second line blank.

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

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

void maxi(int arr[],int n)
{
    for(int i=1;i<n-1;i++)
    {
        if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
        cout<<i<<" ";
    }
    cout<<endl;
}

int main()
{
    int n;
    cin>>n;
    if(n>100)
    {
        cout<<"exceeded capacity";
        return 0;
    }
    int arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    reverse(arr,n);
    maxi(arr,n);
}

Grading criterion: Declaration of variables and array/vector.
Rating A: correctly declares the two variables n, and array/vector

Rating B: Some Issue.
Rating C: Major Issue.
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that accepts a dynamically sized array and performs the following operations:

Initialization: Accept an integer n denoting the array size, followed by n integer elements.

Reverse Traversal: Output the array elements in reverse sequence, space-separated, on a single line.

Peak Detection: Identify all "peak" elements within the array. A peak is strictly defined as an element that is greater than both its preceding and succeeding neighbors. Print the 0-based indices of all identified peaks on a new line, separated by spaces. If the array contains no peaks, leave the second line blank.

Student submission:
#include <iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    int arr[100];
    for(int i=0; i<n; i++){
        cin>>arr[i];
    }
    for(int j=n-1; j>=0; j--){
        cout<<arr[j]<<" ";
    }
    cout<<endl;
    for(int i=1; i<n-1; i++){
        if((arr[i]>arr[i-1])&&(arr[i]>arr[i+1])){
            cout<<i;
            break;
        }
    }
}

Grading criterion: Declaration of variables and array/vector.
Rating A: correctly declares the two variables n, and array/vector

Rating B: Some Issue.
Rating C: Major Issue.
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that accepts a dynamically sized array and performs the following operations:

Initialization: Accept an integer n denoting the array size, followed by n integer elements.

Reverse Traversal: Output the array elements in reverse sequence, space-separated, on a single line.

Peak Detection: Identify all "peak" elements within the array. A peak is strictly defined as an element that is greater than both its preceding and succeeding neighbors. Print the 0-based indices of all identified peaks on a new line, separated by spaces. If the array contains no peaks, leave the second line blank.

Student submission:
#include<iostream>
using namespace std;
int main(){
    int a[100];
    int n;
    cin >> n;
    for(int i=0;i<n ;++i){
        cin >> a[i];
    }
for(int i=0;i<n;++i){
    cout << a[n-i-1]<< " " ;
}
cout << endl;
for(int i=1;i<n-1;++i){
    if(a[i]>a[i-1]&&a[i]>a[i+1]){
        cout << i;
        break;
    }
}
}

Grading criterion: Declaration of variables and array/vector.
Rating A: correctly declares the two variables n, and array/vector

Rating B: Some Issue.
Rating C: Major Issue.
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that accepts a dynamically sized array and performs the following operations:

Initialization: Accept an integer n denoting the array size, followed by n integer elements.

Reverse Traversal: Output the array elements in reverse sequence, space-separated, on a single line.

Peak Detection: Identify all "peak" elements within the array. A peak is strictly defined as an element that is greater than both its preceding and succeeding neighbors. Print the 0-based indices of all identified peaks on a new line, separated by spaces. If the array contains no peaks, leave the second line blank.

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

Grading criterion: Declaration of variables and array/vector.
Rating A: correctly declares the two variables n, and array/vector

Rating B: Some Issue.
Rating C: Major Issue.
Rating D: 0
Assigned grade: A