CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

Student submission:
#include<simplecpp>
int f(int n){
    if(n==1) return 0;
    if(n==2) return 1;
    if(n>=2) return (f(n-1)+f(n-2));
}
bool order(int array[],int n){
    for(int i=0;i<n-1;i++){
        if(array[i]>array[i+1]) return false;
    }
    return true;

}
main_program{
    int n;
    cin>>n;
    int array[n];
    bool array2[n]={};
    for(int i=0;i<n;i++){cin>>array[i];}
    while(true){
        if(!order(array,n)){cout<<"flase";break;}
        int t=2;
        for(int i=0;i<n;i++){
            if(array[i]==0) continue;
            for(;;t++){
                if(array[i]==f(t)){array2[i]=true;break;}
                if(!(array[i]>f(t-1) && array[i]<=f(t))) break;
                continue;
            }
        
        }
        break;
    }
    int sum=0;
    for(bool element :array2){
        sum+=(int)element;
    }
    if(sum==n-1) cout<<"true";
    else cout<<"false";
}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: C
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

Student submission:
#include <simplecpp>

int ntermFibonacci(int n){
    if(n==0)
        return 0;
    else if(n==1)
        return 1;
        
    int n1 = 0;
    int n2 = 1;

    for(int i = 1; i<=n-1 ; i++){
        int temp = n1;
        n1 = n2;
        n2 = temp+n1;
    }
    return n2;
}

main_program{
    int M, index = 0;
    int c=0;      //to count the number of terms of sub sequence match the terms in fibonacci sequence
    cin >> M;
    
    for(int i=1;i<=M ; i++){
        int n;
        cin >> n;
        for( ; index <=19 ; index++){
            //index is not initialized back to zero since the subsequence entered will only
            //be a fibonacci subsequence if it is in the increasing order and this ensures that

            //index goes till 19 only since the 19th term is less than 5000
            //and the 20th term is greater than 5000
            //also it is given that the input numbers will be less than or equal to 5000
            if(n==ntermFibonacci(index)){
                index++;
                c++;
                break;
            }
        }
    }

    if(c==M)
        cout << "true";
    else
        cout << "false";
    
}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

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

int fibonacci(int a){
 if(a==0)return 0;
 if(a==1)return 1;
 else {
    return (fibonacci(a-1)+fibonacci(a-2));
}
}

int main(){
    int M;
    cin>>M;
    while(M>0){
        int numbers;
        cin>>numbers;
        M--;
    }
   
   
}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: C
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

Student submission:
#include<iostream>

using std::cin; using std::cout; using std::endl;

bool is_fibo(int n){
    int x1=0, x2=1;
    while(x2 <= 5000){
        if(n == 0 || n == x2){
            return true;
        }
        int tmp = x2;
        x2 += x1;
        x1 = tmp;
    }

    return false;
}


int main(){
    int M;
    cin >> M;
    bool last = true;
    int n_prev = -1 , count1=0;
    for(int b=0;b<M;b++){
        int n;
        cin >> n;
        if(n==1) count1++;
        if (is_fibo(n) == false) last = false;
        if (n <= n_prev && n_prev != 1) {last = false;}
        else if( n == n_prev && count1 >2){last = false;}
        n_prev = n;
    }
    cout << (last?"true":"false");
}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

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

struct Fibonacci{
	int F, Fp;
	void update(){
		int temp = F; F += Fp; Fp = temp;
	}
};

int main(){
	int M, a;
	Fibonacci fib = {0, 1};
	int &x = fib.F;
	cin >> M;
	for(int i = 0; i < M; i++){
		cin >> a;
		while(x < a) fib.update();
		if(x == a){
			fib.update();
			continue;
		} else{
			cout << "false";
			return 0;
		}
	}
	cout << "true";
	return 0;
}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

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

int fibonacci(int n){
    if(n==0) return 0;
    if(n==1) return 1;
    int a=0;
    int b=1;
    for(int i=1; i<n; i++){
        b=a+b;
        a=b-a;
    }
    return b;
}

bool check(int n, int& low){
    bool ans = false;
    int i = low;
    while(n >= fibonacci(i)){
        ans = ans || (n == fibonacci(i));
        if(n == fibonacci(i)){
            low = i + 1;
            return ans;
        }
        i++;
    }
    return ans;
}
int main(){
    int M;
    cin >> M;
    int window = 0;
    int input;
    bool okay = true;

    for(int j=0; j<M; j++){
        cin >> input;
        okay = okay && check(input, window);
    }

    if(okay)
        cout << "true";
    else
        cout << "false";

}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n,l;
    cin>>n;
    l=n;
    int k,c=0,c1=0;
    int f0=0,f1=1,f2=1;
    for(cin>>k;l>0;cin>>k,l=l-1){
        if (k==0 && l==n) c=c+1;
        else if (k==1 && ((l==n) ||(l==n-1) ||((l==n-2) && ((k!=f0) || (f0==f1))))){
            c=c+1;
            c1=c1+1;
        } ;
        for(;k>=f2;){
            
            f0=f1;
            f1=f2;
            f2=f1+f0;
            

        }
        if (k==f1 && k!=f0) c=c+1;
    

    }
    if (c==n && c1<3)cout<<"true";
    else cout<<"false";


}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

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

int fibonacci(int size){
    if(size >= 3)size--;
    int a=0,b=1,c=0;
    for(int i=1;i<size;i++){
        c = a + b;
        a = b;
        b = c;
    }
    return c;
}

bool is_fib_subseq(int n){
    static int cur=1;
    if(n == fibonacci(cur)){
        cur++;
        return true;
    }
    else if(n > fibonacci(cur)){
        while(fibonacci(cur)!= n){
            if(n>fibonacci(cur)){
                cur++;
            }
            else return false;
        }
        cur++;
        return true;
    }
    else{
        return false;
    }

}

int main(){
    int m;
    int num;
    cin >> m;
    for(int i=0;i<m;i++){
        cin >> num;
        if(!is_fib_subseq(num)){
            cout << "false";
            return 0;
        }
    }
    cout << "true";
    return 0;
}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

Student submission:
#include<simplecpp>
int main() {
        int n ;
        cin>>n;
       repeat(n)        {
                int x;
                cin>>x;
                int t1=0;
                int t2=1;
                int next;
                for (int i=3;i<=20;i++) {
                        next=t1+t2;
                        t1=t2;
                        t2=next;
                        if(x==next){
                                cout<<i;
                        }

                if (x==0) {
                        cout<<"1";
                }
                }
                }

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: C
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

Student submission:
#include <simplecpp>
main_program{
        int M;
        cin >> M;
        bool k=false;
        for (int x=0, prevy=0, prev1y=0; x<M; ++x) {
                int y;
                cin >> y;
                if (x==0&&y==0) {k=true; continue;};
                int a=0, b=1;
                if (prev1y==prevy&& prevy==y) {k=false;break;};
                if (y<=prevy&&(y!=1)) {k=false; break;}
                else { for (int i=0; i<5000; ++i) {
                        int c;
                        c=a+b;
                        a=b;
                        b=c;
                        if (y==c) {k=true; break;};
                        k=false;};};
                if (k==false) {break;};
                prev1y=prevy;
                prevy=y;};
        k?cout<<"true":cout<<"false";}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

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

bool isFibonacci(int a){
    if(a==0 || a==1) return true;
    int x=0,y=1;
    int z=x+y;
    while(z<=5000 && z<=a){
        if(a==z) return true;
        x=y;
        y=z;
        z=y+x;
    }
    return false;
}
int main(){
    int M;
    cin>>M;

    int l;
    cin>>l;
    if(!isFibonacci(l)){
        cout<<"false";
        return 0;
    }
    int flag=true;
    for(int i=1 ; i<M ; i++){
        int a;
        cin>>a;
        if(a<=l && a!=1){
            cout<<"false";
            return 0;
        }
        if(a==l && a==1){
            if(flag) flag=false;
            else{
                cout<<"false";
                return 0;
            }
        }
        if(!isFibonacci(a)){
            cout<<"false";
            return 0;
        }
        l=a;
    }
    cout<<"true";
}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

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

int fibonacci(int i) {
    int tmp0{0},tmp1{1},fib{0};
    if (i==0) return 0;
    if (i==1) return 1;
    for (int j{2}; j<=i; j++, tmp0=tmp1, tmp1=fib) fib=tmp0+tmp1;
    return fib;
}

int main() {
    int M, input, index{0}; cin >> M;
    bool isfibonacci{true};
    for (int i{1}; i<=M ; i++) {
        cin >> input;
        for (; input>fibonacci(index) ; index++);
        if (input != fibonacci(index)) {
            isfibonacci = false;
            break;
        }
        else {index++;}
    }
    cout << ((isfibonacci) ? "true" : "false");

    return 0;
}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In this problem, you need to check if a given finite sequence appears as a sub-sequence in the Fibonacci sequence. A finite sequence is said to be a Fibonacci sub-sequence if it is contained in the Fibonacci sequence in the same relative order but not necessarily consecutively. 
For example, the finite sequence 2, 5, 8 is a Fibonacci sub-sequence.  But 2, 8, 5 is not. Write a C++ program to accept an integer M followed by a finite sequence of M numbers. Your task is to determine if this finite sequence is a Fibonacci sub-sequence. You should output the following:
●	true or false
○	true: if the given finite sequence is a Fibonacci sub-sequence. E.g. on inputs “3 3 8 13”  and “3 3 5 8”
○	false  otherwise
Input Format An integer M followed by M integers

Assumptions on Input
●	Assume that the integer M will be between 1 and 19, both inclusive 
●	Assume that the sub-sequence numbers will be between 0 and 5000, both inclusive

Student submission:
#include <simplecpp>
main_program{
    int m,n,prevN=0,N=1,tmp;
    cin >> m>>n;
    while(1){
        if (n==prevN){if(m!=1){cin>>n;}
                      m-=1;}
        else if(n<prevN){cout << "false"<<endl;break;}
        if(m==0){cout << "true"<<endl;
        break;}
        tmp=N;
        N+=prevN;              
        prevN=tmp;
    }
}

Grading criterion: Checking the condition for output
Rating A: correctly Checking the condition for output to print True or False
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A