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;cin>>M;int input; int n=0;
           
           for(int i=0;i<M;i++){ cin>>input;  int x=0,y=1,z;      
                  while(true){ 
                                  if(input==x){ n++;break;}
                                  
                                  z=x+y;x=y;y=z;
                                                 }    cout<<n<<endl;                    }
                                                 
                              if(n==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; cin>>M;
    int N=0, prevN=1;
    bool fibo=true;
    for(int j=0; j<M; j++){
        int a; cin>>a;
        while(a!=N){
            if(N>5000){
                fibo=false; break;
            }
            int temp=N;
            N=N+prevN;
            prevN=temp;
        }
        if(!fibo){
            cout<<"false"; break;
        }
        int temp=N; N=N+prevN; prevN=temp;
    }
    if(fibo){
        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>
main_program {
    int n, a, b, c;
    cin >> n >> a >> b;
    bool y=true;
    if (n>2) {
        repeat (n-2) {
        cin >> c;
        if (c==a+b) { y=true; }
        else if (c!=a+b) { y=false; break; }
        a=b;
        b=c;
        }
    }
    if (n==2) {
        int p=0, q=1, r=0;
        while (r<=b) {
            r=p+q;
            if (a==q && b==r) { y=true; }
            else { y=false; }
            p=q;
            q=r;
        }
    }
    if (y==true) { cout << "true"; }
    else if (y==false) { 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>
bool fibonacci (int a) {
    int x=0, y=1, z=1;
    if (a==x || a==y) return true;
    while (true) {
        if (a>y) {
            x=y;
            y=z;
            z=(x+y);
        }
        else if (a==y) {
            return true;
            break;
        }
        else {
            break;
            return false;
        }
    }
}
main_program {
    int n;
    cin >> n;
    bool t = false;
    for (int a, i=0, x=0, y=1, z=1, temp=0;i<n;++i) {
        cin >> a;
        if (!fibonacci(a) || a<temp) {
            t = false;
            break;
        }
        while (fibonacci(a) && a>y) {
                x=y;
                y=z;
                z=(x+y);
            } 
        if (a==1 && temp==1) t = false;
        else if (a == y) {t = true;
        temp = a;
        }
    }
    if (t==true) 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<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 Fibonacci_index(int n){
    int i=0;
    while(1){
        if(n==F(i)) return i;
        if(n<F(i)) break;
        i++;
    }
    return -1;
}
int main(){
    int M;cin>>M;
     int x,i,y=-2;int temp,d=-2;
     for(i=1; i<=M;i++){
        cin>>x;
        
        
        temp= Fibonacci_index(x);
        if(x==y && x==1) temp =2;
        
        if(temp==-1) {
            cout<<"false";break;
     }
     if(d>=temp){
            cout<<"false";break;
     }
        d=temp;
        y=x;
     
     }
     if(i==M+1) 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>
int main (){
    int M ; cin >> M;
    bool test = true;
    int n = 0, pren = 0;
    for ( int count = 1; test && count <= M; count++){ 
        pren = n;
        cin >> n;
        if ( n < pren ) test = false;
        else { if ( n == 0 );
            else{
            int fa  = 0, fb = 1; int fc; 
            for(; true ;fa = fb, fb = fc){
                fc = fa + fb;
                if (n>fc) continue;
                if ( n == fc ) break;
                else {
                    test = false; break;

                }

            }
        }
        }
        
    }
    if (test == true){cout << "true";}
    else cout << "false";
    return 0;
}

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 a,b,p=0,M,n,n1,count;bool ans;
    cin>>M;
    for(count=1,cin>>n;count<=M; count++){
       for(a=0,b=1;p<n;){
        p=a+b;a=b;b=p;
        }
        if(p==n){
            ans=true;
        }else if(p!=n){
            ans=false;
            cout<<"false";
            break;
        }
        cin>>n1;
        if(n1<n){
            cout<<"false"; break;
            }else {n=n1;}
       }
       if(ans==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>
bool fibonacci(int a,int& b,int& c) {
        if(a==b) {int r=b+c;b=c;c=r;return true;}
        if(a==c) {int r=b+c,m=r+c;
                b=r;c=m;return true;}
        for(int r=b+c;r<=a;b=c,c=r,r=b+c) {
                if(r==a) {int d=r+c,e=r+d;
                b=d;c=e;return true; break;}
        }
        return false;
}
main_program {
        int M,count=0;bool q;int a,b=0,c=1;
        cin >> M;
        for(int i=0;i<M;++i) {
                cin >> a;
                if(a==1) ++count;
                q=fibonacci(a,b,c);
               if(q==0 || count>2) {
        cout << "false"; break;}
        } if(q==1 && count<=2) 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>
main_program {
    
    int M;
    cin >> M;
    int a = 0, b = 1, tmp, n, i = 0;

    for (; M >= 1 && M <= 19, i <= M, a <= 5000, b <= 5000;) {
        cin >> n;
        if(n == a) {
            i++;
        }
        tmp = b;
        b = a + b;
        a = tmp;
        if (i == M) break;
    }
    
    if (i == 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>
bool check(int x){
    int a=0,b=1,p=a,q=b;
    while (b<x){
        b=a+b; a=q; p=a; q=b;
    }
    if (b==x) return true;
    else return false;
}
main_program{
    int n; cin>>n; int e=1; int x, prevx=-1, prev2x=-2;
    for (int i=0; i<n; i++){
        cin>>x;
        if (!(check(x) && (prevx<x || (prevx==x && x==1 && prev2x!=x)))) e=0;
        prevx=x;
        prev2x=prevx;
    }
    if (e) 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 a=0;
	int b=1;
	int m;
	int x=0;
	cin>>m;
	for (int i=0;i<m;++i){
		int j;
		cin>>j;
		if (i==0 && j==0){
			x+=1;
		    continue;
		}
		while (true){
			int tmp=b;
			b=b+a;
            a=tmp;
			if (b==j){ x=x+1; break;}
			
			if (b>j) break;
		}
	}
	if (x==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>

bool isFibonacci(int a){
	int n1 = 0;
	int n2 = 1;
	int n3;
	while(true){
		n3 = n1+n2;
		if(a==n1 || a==n2 || a==n3) return true;
		n1=n2;
		n2=n3;
		if(a<n3) return false;
	}
}

main_program{
	int M;
	cin >> M;
	int a, b=-1, n;
	bool c = true;
	for(int i = 1;i<=M;i++){
		
		cin >> a;
		if(i==1) n=a;
		if(n==0){
			if(a<b || (i>3 && a==1)){
				c = false;
				break;
			}
		}else{
		       	if(a<b || (i>2 && a==1)){
				c = false;
				break;
			}
		}
		b = a;
		if(!isFibonacci(a)){
			c = false;
			break;
		}
	}
	if(c) 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 n, num, count=0, seq, prev_seq, next_seq, check=true;
	cin >> n;
	seq=1;
	prev_seq=0;
	for(int i=0; i<n; i++){
		cin >> num;
		while(prev_seq<=num){
			if (prev_seq==num){check=true;
			}
			else {check=false;}
			next_seq=seq+prev_seq;
			prev_seq=seq;
			seq=next_seq;
		}

		if(!check){break;}
	}
	if(check){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