CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include <iostream>
using namespace std;
int main () {
        int n;
        cin>>n;
        int vec[n];
        for (int i=0; i<n; i++) {
                int a;
                cin>>a;
                vec[i]=a;
        }
        for (int i=n-1; i>=0; i--) {
                cout<<vec[i]<<" ";
        }
        cout<<"\n";
        for (int i=0; i<n; i++) {
                if (vec[i]%2 != 0) vec[i] = 0;
        }
        for (int i=0; i<n; i++) {
                cout<<vec[i]<<" ";
        }
        cout<<"\n";
        return 0;
}

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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[n];
    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=0;i<n;i++){
        if(a[i]%2==0){cout<<a[i]<<' ';
        }
        else {cout<<0<<' ';}
    }
}

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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[N];
    for(int i=0;i<N;i++){
        cin >> A[i];
    }
    for(int j=(N-1);j>=0;j--){
        cout << A[j] << " ";
    }
cout << endl;

    for(int i =0; i<N ; i++){
        if((A[i]%2)!=0){
            A[i]=0;
        }
        cout << A[i] << " ";
    }
    return 0;
}

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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 m;
    (n>=100?m=100:m=n);
    int V[100];
    for(int i=0;i<m;i++){
        int j;
        cin>>j;
        V[i]=j;
    }
    for(int i=1;i<=m;i++){
        cout<<V[m-i]<<" ";
    }
    cout<<endl;
    for(int i=0;i<m;i++){
        if((V[i]%2)!=0) V[i]=0;
    }
    for(int i=0;i<m;i++){
        cout<<V[i]<<" ";
    }
}

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

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

int main(){
vector<int> v1;
//char c;
int x;
//cin >> noskipws;
//cin >> x;
//for(cin >> x;x != '\n' && x;cin >> x){coot << x;}
//for(cin ; ;){;cout << c;};
//cin >> noskipws;
//cin >> noskipws;

//cin >> noskipws;
char c; unsigned int n;
//for(cin >> c; c<'0' || c>'9'; cin >> c){cout << c;};
cin >> n;


for(int i=0;i<n;i++){cin >> x; v1.push_back(x);}
for(int i=v1.size()-1;i>-1;i--){cout << v1.at(i) << " ";}
for(int i=v1.size()-1;i>-1;i--){if (v1.at(i)%2 == 1){v1.at(i) = 0;}}
cout << endl;
for(int i=0;i<v1.size();i++){cout << v1.at(i) << " ";}



}

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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[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=0;i<n;i++){
        if(A[i]%2!=0){
            A[i]=0;
        }
        cout<<A[i]<<" ";
    }
}

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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

}

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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 a;
    int b[100];
    cin>>a;
    for (int i=0;i<a;i++){
        cin>>b[i];
    }
    for (int i=a-1;i>=0;i--){
        cout<<b[i]<<" ";
    }
    cout<<endl;
    for (int i=0;i<a;++i){
        if (b[i]%2!=0){
            b[i]=0;
        }
    }
    for (int i=0;i<a;i++){
        cout<<b[i]<<" ";
    }
}

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

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

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

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

    for(int i : vec) {
        if(i%2) cout << 0 << " ";
        else cout << i << " ";
    }
    return 0;
}

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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[n];
    for(int i=0;i<n;i++) cin>>A[i];

    for(int j=n-1;j>=0;j--) cout<<A[j]<<' ';

    for(int k=0;k<n;k++){

        if(A[k]%2==1) A[k] = 0;
    }
cout<<endl;
    for(int l=0;l<n;l++) cout<<A[l]<<' ';
}

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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> vec;
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        vec.push_back(a);
    }
    for(int i=n-1;i>=0;i--){
        cout<<vec[i]<<" ";
    }
    cout<<endl;
     
    for(int i=0;i<n;i++){
        if(vec[i]%2==1){
            vec[i]=0;
        }
    }

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

    return 0;
}

Grading criterion: Replacing odd number by 0
Rating A: correctly writes the logic for replacing odd numbers with zero
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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

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

int main(){
    vector<int> V, E;
    int N, inp;
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> inp;
        V.push_back(inp);
        E.push_back(((inp%2 == 0) ? inp : 0));
    }
    for(int i = N-1; i >= 0; i--){
        cout << V[i] << " ";
    }
    cout << endl;
    for(int i = 0; i < N; i++){
        cout << E[i] << " ";
    }
}

Grading criterion: Output
Rating A: Correctly prints the output

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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

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

Grading criterion: Output
Rating A: Correctly prints the output

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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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,arr[100];
    cin>>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=0;i<n;i++)
    {
        if(arr[i]%2!=0)
       { arr[i]=0;}
        cout<<arr[i]<<" ";
    }
}

Grading criterion: Output
Rating A: Correctly prints the output

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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

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[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=0;i<n;i++)
    {
        if(a[i]%2==0)
        cout<<a[i]<<" ";
        else
        cout<<"0 ";
    }
}

Grading criterion: Output
Rating A: Correctly prints the output

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 reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

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

Grading criterion: Output
Rating A: Correctly prints the output

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