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>
main_program
{

        int m, a;
        int n=0;
        bool v;
        cin >> m;

        int fn1=0;
        int fn2=1;
        int fn;

        repeat (m)
        {
                cin >> a;

            for(fn==0; n<=m; n++)
            {

                fn=fn1+fn2;
                
                if(a=fn)
                {
                    v==1;
                }

                else
                {
                    v==0;
                }

                fn1=fn2;
                fn2=fn;
                        
            }

        }

        if (v==1)
        {
            cout << "true";
        }

        else
        {
            cout << "false";
        }

}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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 a0 = 0;
    int a1 = 1;
    int m ;
    cin >> m;
    for(int i = 0; i < m; i++){
        int j;
        cin >> j;
        while(a0 < j){
            a1 = a0 + a1;
            a0 = a1 - a0;
        }
        if(a0 != j){
            cout << "false";
            return 0;
        }
        a1 = a1 + a0;
        a0 = a1 -a0;
    }
    cout << "true";

}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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 m){
	int a=0,b=1;
	while(a<m){
		b+=a;
		a=b-a;
	}
	return (a==m?true:false);
}

int main(){
	int n;
	short c1=0;
	bool yes = true;
	int x,y=-1;
	cin>>n;
	while (n--){
		cin>>x;
		if(x==1 || c1>=2) c1++;
		if (yes){
			if((y>=x&&c1!=2) || !check(x)) yes = false;
			y=x;
		}
		
	}
	cout<<(yes?"true":"false");
}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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){       //writing function for fibonacci series
    if(n>=2) return f(n-1) + f(n-2);
    else if(n==1) return 1;
    else return 0;
}
main_program{
    int b; cin >> b;        //no. of terms
    int c; cin >> c;        //the term to check
    for(int a=0;f(a)<=5000;a++){
        if(f(a)==c){    //checks whether c is a fibonacci number or not
            b--;        //b is updated to be the number of terms left to check
            cin >> c;   //if the previous c was a fibonacci number, only then we move to the next c
        }
    }
    if(b==0) cout << "true";    //if all terms are in fibonacci then we get true as output
    else cout << "false";
}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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,i,io,j=0,ioo;
    cin>>M;
    for(io=-1,ioo=-1;M>0;M--,io=i,ioo=io)
    {
        cin>>i;if(i==1 && io==1 && ioo==1)
        {
            cout<<"false";
            j=9;
            break;
        }
         else if(i<=io && i!=1 &&io!=1) 
        {
            cout<<"false"<<endl;
            j=9;
            break;
         
        }else 
        {
            for(int lo=0,ln=1,tmp;;)
            {
                if(i==lo) break;
                tmp=ln+lo;
                lo=ln;
                ln=tmp;
                if(lo>5000)
                {
                    j=10;
                    break;
                }
            }
        }if(j==10) break;
    }if(j==10) cout<<"false"<<endl;
     else if(j==0) cout<<"true"<<endl;
}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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 n,r;
	cin >> n;
	 r=0;
	repeat(n) {
		int a,x,s,t;
		s=0;x=0;t=0;
		cin >> a;
        bool done = false;
		if (a==0 && s==0) {
			r=r+1;
			s=s+1;}
		if (a==1 && t<2){
			r=r+1;
			t=t+1;}

		if ( a>x && a!=1){
		int p,q,k;
		p=0;q=1;k=0;
		
		while (k<=5000){
			k=p+q;
			if(k==a){ done = true;}
			p=q;
			q=k;}
	
		if(done==true){
			r=r+1;}
	       	x=a;}
	}
	if(n==r) { cout << "true" ;}
	else { cout << "false" ; }
}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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 M,a0,a1,next,i,j;
cin>>M;
a0=0;
a1=1;
int p,q;
q=0;
for(i=0;i<M;i++){
    cin>>p;
    if(p>q||(p==1&&q==1)||(p==0&&q==0)){
        q=p;
    }
    else break;
    for(j=0;a1<q;j++){
        next=a0+a1;
        a0=a1;
        a1=next;
    if(a1!=q){
        break;
        cout<<"false";
    }
        else continue;
    }
}
   if(a1==q&&i==M){
    cout<<"true";
  }
}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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;
    bool main=true;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        bool check=false;
        int pp=0,p=1;
        for(int i=0;i<100;i++){
            int pre=p+pp;
            if(pre==x || x==0){
                check=true;
                break;
            }
            pp=p;
            p=pre;
            
        }
        main=main &check;
    }
        if(main==true){
            cout<<"true";

        }
        if(main==false){
            cout<<"false";
        }
    }

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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 M = 0 ;

    cin >> M ;

    int n[M] ;

    for(int it = 0 ; it < M ; it ++){

        cin >> n[it];

    }

    int x = 0 ;
    int y = 1 ;

    int count = 0 ;

    if( n[count] == 0 ) count++;
    if( n[count] == 1 ) count++;

    while( y < 5001){

        y = x + y ;
        x = y - x ;

        if( n[count] == y ) count++ ;

        if(count == M){

            cout << "true" ;
            break;

        }

    }

    if(count != M){

            cout << "false" ;

        }

}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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){
    for(int n=0;n<=50;n++)
    if (n==0)
    return 0;
    if(n==1)
    return 1;
    if(n>=2){
        F(n)=F(n-1)+F(n-2);
        return F(n);
    }
}main_program{
int M;
cin>>M;
int x;
while(M!=0){
    cin>>x;
    M=M-1;
}
}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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 fib(int x){
	static int y=0, z=1;
    for(;z<x;){
        z += y;
        y = z - y;
    }
	return z==x ? true:false;
}

int main(){
	int m, x;
	bool sub=true;
	cin >> m >> x;
	if(fib(x)|| x==1){
		for(int i=1; i<m; i++){
			cin >> x;
			if(!fib(x)){
			sub = false;
			break;
			}
		}
	}
	(sub ?  cout << "true" : cout << "false");
}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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 a;
	bool fib=true;
	int a1,a2=1,a3=0,x;
	for(int i=1;i<=m;i++){
		cin>>a;
		while(true){
			x=a3;
			a1=a2+a3;
			a3=a2;a2=a1;
			if(a==x)break;
			else if(a<x){
				fib=false;
				break;
				break;
			}
		}
	}
	if(fib)cout<<"true";
	else cout<<"false";
}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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 fib(int n)
{
    int ans;
    if(n==0) return 0;
    else if(n==1) return 1;
    else
    {
        ans=fib(n-1) + fib(n-2);
        return ans;
    }
}
bool fibcheck(int n)
{
    for(int i=0;i<30;i++)
    {
        if(n==fib(i)) return true; 
    }
    return false;
}
int main()
{
    int M,inp;
    static int c=0;
    cin >> M;
    for(int a=0;a<M;a++)
    {
        cin >> inp;
        if(fibcheck(inp)) c++;
    }
    if(c==M) cout << "true";
    else cout << "false";
    return 0; 
}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
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 x; bool fibonacci=true;
    int a=-1, b=1, c=0; //They are 'like' F(-1)=1 and F(-2)=-1 by extending the sequence backwards

    cin >> x;
    while (c<x){         // find a number in fibonacci >= x (first of M integers)
        a=b; b=c; c=a+b; // construction of fibonacci
    }

    if (c!=x) fibonacci=false; // if x isn't present in fibonacci
    else {
        if (M>1&&x==1) {
            cin >> x;
            a=b; b=c; c=a+b;
            if (x==2) {a=b; b=c; c=a+b;}
            if (c!=x) {fibonacci=false;}
        
            for (int i=2; i<M; i++){ // now we have found where the fibonacci is starting, so we construct the elemnets ahead and match them one-by-one with inputs
            cin >> x;
            a=b; b=c; c=a+b;
            if (c!=x) {fibonacci=false; break;}
            }
        }  
        else {for (int i=1; i<M; i++){ // now we have found where the fibonacci is starting, so we construct the elemnets ahead and match them one-by-one with inputs
            cin >> x;
            a=b; b=c; c=a+b;
            if (c!=x) {fibonacci=false; break;}
            }} 
    }

    cout << (fibonacci?"true":"false");
}

Grading criterion: Loop M times
Rating A: correctly iterates the loop M times
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A