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<iostream>
using namespace std;
int f(int n){
        if(n==0) return 0;
        else if(n==1) return 1;
        else return f(n-1)+f(n-2);}
int main(void){
         int m,k;
         cin>>m;
        for(int i=0;i<m;i++){ int x,n=0; cin>>x; while(x>f(n)){n++;}
                              if(x<k){ cout<<"false"; return 1;}
                              if (x!=f(n)){cout<<"false"; return 1;}
                              k=x;
                              }



cout<<"true";
}

Grading criterion: Output
Rating A: correctly prints the output
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 Fib(int n) {
    if (n == 0) { return 0; }
    else if (n == 1) { return 1; }
    else { return Fib(n-1)+Fib(n-2); }
}

bool isFib(int n) {
    int i = 0;
    int x = -1; // -1 < Fib(0)
    for ( ; x < n; i++) {
        x = Fib(i);
    }
    return x == n;
}

int main () {
    int M;
    int t = 0;
    bool answer = true;
    cin >> M;
    int oldN = -2, newN; // creating a random value for oldN just for the first iteration below. Also, -2 < 0.
    for (int count = 0; count < M; count = count + 1) {
        cin >> newN;
        if (newN == 1) {t = t+1;}
        if (t > 2) { // can't have more than 2 '1's'
            answer = false;
            break;
        }
        if ((newN <= oldN && newN!= 1) || (newN < oldN) || !(isFib(newN))) { // only '1' can repeat multiple times
            answer = false;
            break;
        }
        oldN = newN;
    }
    if (answer) {cout << "true";}
    else { cout << "false" ;}
}

Grading criterion: Output
Rating A: correctly prints the output
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,x=1,y=1,z=0,count=0,value;cin>>m;
while(1){cin>>value;count+=1;
if(value<z){cout<<"false";break;}
while(value!=z&& value>z){x=y;y=z;z=x+y;}
if(value<z){cout<<"false";break;}
x=y;y=z;z=x+y;
if(count == m){cout<<"true";break;}}

}

Grading criterion: Output
Rating A: correctly prints the output
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,t1=0,t2=1,x,temp,j=0,b=0;
    cin>>M;
    bool flag=true;
    for(int i=1;i<=M;i++){
        cin>>x;
        while(true){
            if(b<2){
                if(b=1)
                    j=1;
                b++;
            }
            
            else{
                j=t1+t2;
                t1=t2;
                t2=j;
            }
            if(x==j){
                break;
            }
            if(j>x){
                flag=false;
                break;
            }
        if(!flag)
            break;
            
        }

        
    }
    if(flag)
        cout<<'true';
    else    
        cout<<'false';
}

Grading criterion: Output
Rating A: correctly prints the output
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>
void checker(int& n,int a,bool& result,int& ax,int& ay,int& az){ 
if(a==0){n=1;result=true;}
else if(a==1){n=2;result=true;}
else{
    int an=2,ap=1;result=false;
    for(int p=4;p<=20;p++){
if(a==an&&p>n){n=p;result=true;break;}
int tmp;tmp=an;an=an+ap;ap=tmp;
}
};
int tmp;tmp=ax;ax=a;int tmp2;tmp2=ay;ay=tmp;az=tmp2;
if(ax==ay&&ay==az){result=false;};
}

main_program{
    int M;
    cin>>M;
    int n=0;bool result=false;int ax=0,ay=8,az=9;
    for(int c=1;c<=M;c++){
        int a;
        cin>>a;
        checker(n,a,result,ax,ay,az);
        if(!result){break;};
    }
    if(result){cout<<"true";}
    else{cout<<"false";};
}

Grading criterion: Output
Rating A: correctly prints the output
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 fib(int n){
    if(n==0) return 0;
    if(n==1) return 1;
    if(n>1) return fib(n-1)+fib(n-2);
}

int main(){
    int M, index=0; cin>>M;
    bool ans=true;
    for(int i=0; i<M; i++) {
        int x; cin >> x;
        int prev_index = index;
        for(int j= 0 ; x>=fib(j); j++){
            if (x==0) {index=0; break;}
            if (x==1 && prev_index==1) {index=2; break;}
            if (x==fib(j)) {index=j; break;}
        }
        if (prev_index >= index && index){
            ans = false;
            break;
        }
    }
    cout <<boolalpha <<ans;

}

Grading criterion: Output
Rating A: correctly prints the output
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 F(int n){
    int a;
    if(n==0){
        a= 0;
    }else if(n == 1){
        a= 1;
    }else{
        a= F(n-1)+F(n-2);
    }
    return a;
}

main_program{
    int x=1 ;
    int y = 0;
    int a;
    int c=-1;
    cin >> a;
    for(int i=1;i <= a;i++){
        int b;
        cin >> b;
        if(b < y){
            x=0;
        }else{
            if(x==1){
        for(int i=c+1;F(i)< 5000;i++){
            if(b == F(i)){
                x=1;
                c=i;
                break;
            }else if(b < F(i)){
                x=0;
                break;
            }
        }
        
        y=b;
        }
        }
    }
    if(x == 0){
        cout << "false" << endl;
    }else if(x == 1){
        cout << "true" << endl;
    }
}

Grading criterion: Output
Rating A: correctly prints the output
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>

bool check(int& n){
        int a = 0, b = 1, c;
        while(a<n){
                c = b+a;
                a = b;
                b = c;
        }
        if(a == n) return true;
        return false;
}

int main(){
        bool valid = true;
        int M;
        cin>>M;
        int n;
        cin>>n;
        if(M == 1) {
                if(check(n)) cout<<"true"<<endl;
                else cout<<"false"<<endl;
                return 0;
        }
        int p, q = 0;                           //q is number of 1 taken in
        if(n == 1) q++;
        for(int i = 1; i<M; i++){
                p = n;
                cin>>n;
                if(n < p) {
                        cout<<"false"<<endl;
                        valid = false;
                        break;
                }
                if(n == 1) q++;
                if(q > 2) {
                        cout<<"false"<<endl;
                        valid = false;
                        break;
                }
                if(check(p) && check(n)){}
                else{
                        cout<<"false"<<endl;
                        valid = false;
                        break;
                }
        }
        if(valid){
                cout<<"true"<<endl;
        }
}

Grading criterion: Output
Rating A: correctly prints the output
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;cin>>M;
	int i=1,t,n,p; bool var,man;
	while (i<=M){
		cin>>n;
		if(i>1){
			if(n<t) var = true;
			if(n==0&&t==0) var=true;
		}
		t=n;
		p=n;
		if(n>1&&t>1){
			if (n==t)var = true;
		}
		if(var) cout<< "false";
		if(var)break;
		i++;
		int fir=0,sec=1,thir=0;
		while(thir<=n&&thir<5001){
			thir= sec + fir;
			sec=thir; fir=sec;
			if (thir==n)man=true;
			else man = false;
		}
		if(man)cout<<"true";
		else cout<<"false";



	}
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: B
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,a0,a1,n0,n1,n2;
    bool b=true;
    cin >> M;
    n0=1;
    n1=1;
    n2=2;
        for(int i=1;i<=M;i++){
        cin >> a0;
        do{
            if(a0==n0 || a0==n1) break;
            n2=n0+n1;
            if(a0!=n2) b=false;
            n0=n1; n1=n2;    
        } while(a0>=n2);
        if(a0==n1 || a0==n0) b=true;
        if(!b) break;
        a1=a0;
    }
    if(!b) cout << "false" << endl;
    if(b) cout << "true" << endl;
}

Grading criterion: Output
Rating A: correctly prints the output
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>
bool check(int & a){
    for(int e=0, q=0,w=1;q<=5000 ;){
        e=q;
        q=w;
        w=e+q;
        if(a==q || a==0){
            a=e;
            return true;
        }
    }
}
main_program{
    int n;
    cin>>n;
    bool done=false,a1=false,a2=false;
    for(int i=0,t;i<n;i++){
        int a,p=0;
        cin>>a;
        if(i==0){p=a;
            done=check(a);
            if(done){
                t=a;
            }
        }
        if(i==1){
            if(a==(t+p)){
                a1=true;
            }
        }
        if(i==2){
            if(a==(t+2*p)){
                a2=true;
            }
        }
    }
    if(done && a1 && a2){
        cout<<"true";
    }
    else{
        cout<<"false";
        }
}

Grading criterion: Output
Rating A: correctly prints the output
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 namespace std;

int main(){
    int length;
    cin >> length;
    bool check1 = true;
    int n1 = 0;
    int n2 = 1;
    for(int i=1; i<=length; i++){
        int input;
        cin >> input;
        bool check2 = false;
        while(n2<=5000){
            if(n1 == input) {check2 = true; break;}
            int rem = n2;
            n2 = n2 + n1;
            n1 = rem;
            //if(check2 == true) break;
        }
        if(check2 == false) {check1 = false; break;}
        int rem2 = n2;
        n2 = n1 + n2;
        n1 = rem2;
    }
    if(check1 == true) cout << "true";
    else cout << "false";
}

Grading criterion: Output
Rating A: correctly prints the output
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() {
	bool fib=true;
	int M, term,nold=0,nnew=1;
	cin>>M;
	for(int i=0;i<M && fib==true;i++) {
		cin>>term;
		int temp;
		while(nold<=term) {
			if(term==0) break;
			temp=nold;
                	nold=nnew;
                	nnew+=temp;
			if(nold==term) {fib=true; break;}
                        else fib=false;
		}
	}
	if(fib==true) cout<<"true"<<endl;
	else cout<<"false"<<endl;
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A