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>
bool f(int n){
	if (n==0 || n==1){return true;}
	int b=0,c=1;
	while (c<=n){int tmp=c;
		c+=b;
		b=tmp;
		if (c==n) {return true;}}
	return false;}
	
main_program{bool test=true;
	int n;cin >> n;
	for (int i=0;i<n;i++){
		int k;cin >> k;bool t=f(k);
		if (t==false){test=false;cout << "false";}}
	if (test) cout << "true";}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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);
bool inSequence(int n);
int main(){
    //we exploit the constraint on the input
    int len; cin>>len;
    int p = 1;
    int count=0;
    int max =0;
    for(int i=1; i<=len;i++){
        int n; cin>>n;
        (n==1)?count+=1:count+=0;
        (inSequence(n))?p*=1:p*=0;
        (count>=3)?p*=0:p*=1;//case for 1 has to be handled separately, it is the only case with two equal members in the sequence
        if(n>=max){
            p*=1;
            n=max;
        }
        else{
            p*=0;//we must have an increasing sequence!!!
        }
    }
    string result;
    (p==1)?result="true":result="false";
    cout<<result;

}
int Fibonacci(int n){
    if (n==0) return 0;
    else if(n==1) return 1;
    else return (Fibonacci(n-1)+Fibonacci(n-2));
}
bool inSequence(int n){
    for(int i=0;i<=20;i++){
        if(Fibonacci(i)==n) return true;
    }
    return false;
}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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){
	int a=0;
	int b=1;
	int c;
	if(n>=2){
	repeat(n-1){
		c=a+b;
		a=b;
		b=c;
	}
}
	if(n==1){
		c=1;
	}
	if(n==0){
		c=0;
	}
	return c;
}
bool check(int n){
	int j=0;
	bool v;
	while(Fib(j)<=n){
		if(Fib(j)==n){
			v=true;
			break;
		}
		else{
			v=false;
		}
		j+=1;
	}
	return v;
}
main_program{
	int M;
	cin>>M;
	int i=1;
	int x;
    int y;
	while(i<=M){
		cin>>x;
        y=x;
		i+=1;
		if(check(x) && y>=x){
			continue;
		}
		else{
			i=0;
			break;
		}
	}
	if(i==M+1 && x!=1){
		cout<<"true";
	}
	else{
		cout<<"false";
	}
}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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) {
    if(n==0) return 0;
    if(n==1) return 1;
    if(n>=2) return f(n-1)+f(n-2);
}

main_program {
    int m=0,n=0,r=0,k=0,input=0;
    bool sub=true, sub2=true,sub3=false;
    cin>>m;
    while(sub2==true) {
    for(int i=0;i<m;i++) {
        cin>>input;
        for(;k>=0;k++) {
            if(f(k)==input) {break;}
            else {sub=false;sub2=false;break;}
        }
        r=k-r;
        sub3=true;
        if(r<0&&sub3==true) {sub=false; r=k;k=0;sub2=false;break;}
        else if(sub3==true){sub=true;r=k;k=0;}
}
    }
if(sub==false) cout<<"false";
if(sub==true) cout<<"true";
}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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>
void fibonacci(int n){
    if(n==1|| n==2) return 1;
    else return 1+fibonacci(n-1);
}
main_program{
    int m; 
    cin>>m;
    
}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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;
repeat(M){
    cin>>n;
}}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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=1,j=1,k,tmp=0;
    int x=0,y=1;
    bool tf=true;
    cin>>M;
    for(;i<=M;){
        cin>>k;
        if(k==0&&i==1){
            ++i;
            cin>>k;
            if(k==1){
            ++i;
            cin>>k;
            }
        }
        for(;j<=5000;++j){
                tmp=x+y;
            if(k==tmp){
                ++i;
                tmp=x+y;
                x=y;
                y=tmp;
                break;
            }
            
            x=y;
            y=tmp;
        }
        if(j==5001){
            tf=false;
            break;
        }
    }
    if(tf)
    cout<<"true"<<endl;
    else
    cout<<"false"<<endl;
}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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 nfib(int n){
    if (n==1){
        return 0;
    }
    else if(n==2){
        return 1;
    }
    else
    return nfib(n-1)+nfib(n-2);

}
main_program{
    int M;
    cin>>M;
    int i=1;
    repeat(M){
    int a;
    cin>>a;
    while(i<=30){
        if(a==nfib(i)){
            i++;
            break;
        }
        i++;
        

    }}
    if(i==31)
    cout<<"false";
    else
    cout<<"true";
}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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>

int nthFibo(int n){
    int i = 0, j = 1; int k = 1;
    for(int l = 0; l < n; l++){
        k = k + j;
        j = i + j;
        i = j - i;  
    }
    return i;
}

int main(){
    bool boo = 1;
    int M, u; std::cin >> M;
    int i = 0;
    for(int p = 0; p < M; p++){
        std::cin >> u;
        while(1){
            if(nthFibo(i) == u){
                i++; break;
            }
            else if(u < nthFibo(i)){
                boo = 0; i++; break;
            }
            else{ 
                i++;
            }
        }
    }
    std::cout <<( boo ? "true" : "false" );
}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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 std::cin;using std::cout;
struct fibn{int i,n;};
int fibgen(int n){int a=0,b=1,c;
    if (n==2){return 1;}
    else if (n==1){return 0;}
    else{
        for(int i=2; i<n;i++){c=a;a=b;b=c;b+=a;}
        return b;
    }

}
bool fibcheck(int n){
    for(int i=1; n>=fibgen(i);i++){if (n==fibgen(i)){return 1;}}
    return 0;
}
int main(){
    int n,a,b=-1;bool t=true,c1=0;
    cin >> n;
   for (int i=0; i<n;i++){cin >> a;
    if(fibcheck(a) && (a>b || (a==b && b==1))){if (b==a && !c1){c1=1;b=a;t=true;} else if (b==a && c1){t=false;break;}else{ b=a;t=true;}}
    else{t=false;break;}
    }

if (t){cout << "true";}
else {cout << "false";}
}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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:
int fibonaccisequence(int& x,int& y)
 {int z=x+y;
      x=y;
      y=z;
      return z;}
 #include<simplecpp>
 main_program
 {int x=0,y=1,m,n1,n2,n,a,count=0;
 cin>>m;
  cin>>n1>>n2;
  if(n1==0 && n2==1){count=2;}
  if(n1!=0){while(a<50)
 {if(n1==fibonaccisequence(x,y))
 { count++;
 break;}
 a++;}}
 if(n2!=1)while(a<50)
 {if(n2==fibonaccisequence(x,y))
 { count++;
 break;}
 a++;}

 repeat(m-2)
 {cin>>n;
 while(a<50)
 {if(n==fibonaccisequence(x,y))
 { count++;
 break;}
 a++;}}
 
 if(count==m)
 {cout<<"true";}
 else{cout<<"false";}}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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;
    int a=0,b=1;
    bool t=true;
    cin>>M;
    int x;
    repeat(M){
        if(t){
            t=false;
            cin>>x;
            while(a<=x){
                if (a==x){t=true;}
                b+=a;
                a=b-a;
            }
        }
    }
    cout<<(t?"true":"false");
}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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;
    bool re;
    cin>>n;
    int k[n],a;
    int x[20];
    x[0]=0;
    x[1]=1;
    for(int i=2;i<20;++i){x[i]=x[i-1]+x[i-2];}
    for(int i=0;i<n;++i){cin>>k[i];}
    int p=0;
    for(int i=0;i<n;++i){
        for(int s=p;s<20;++s){
            if(x[s]==k[i]){re=1;}
            if(x[s]==k[i])break;
            if(s==19){re=0;}

        }if(re==0)break;p=p+1;
    }if(re==0){cout<<"false";}
    else cout<<"true";
    }

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
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[30];
    a[0]=0;
    a[1]=1;
    for(int i=2;i<=30;i++)
    a[i]=a[i-1]+a[i-2];
    for(int i=0;i<=30;i++)
    {
        if(a[i]==n)
        return true;
    }
    return false;
}
main_program
{
    int m,r=0,last=0,s=0;
    cin>>m;
    bool flag;
    for(int i=1;i<=m;i++)
    {
        s=last;
        last=r;
        cin>>r;
        flag=check(r);
        if(last>=r&&(last!=1&&r!=1&&m<3))
        flag=false;
        if(s==r&&last==r&&last!=0)
        flag=false;
    if(!flag)
    break;}
if(flag)cout<<"true";
else cout<<"false";}

Grading criterion: Declaration of variable and taking input
Rating A: correctly declares the variable M and followed by another variable to input the subsequence
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A