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 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: 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 fibonacci(int term){
	int a=0;
	int b=1;
	int q=0;
	int final;
	if(term>1){

		while(q<term){
			final=a+b;
			a=b;
			b=final;
			q++;
		}
	}
	if(term==1){
		final=1;}

	if(term==0){
		final=0;}

	return final;}


main_program{
	int M;
	cin>> M;
	int i;
	i=0;
	bool r;
	r=true;
	for(;i<M;i++){
		int y=0;
		int number;
		cin>>number;
		while(r){
			if(number==fibonacci(y)){
				break;
			}
			if(number!=fibonacci(y)){
				y++;
			}
			if(fibonacci(y)>5000){
				r=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>
void fib(int z){
    int x=0;
    int y=1;
    while (x<=z){
        y=x+y;
        x=y-x;
    }
    if(x==z){
        cout<<"true"<<endl;
    }
    else{
        cout<<"false"<<endl;
    }
}
main_program{
    int n;
    cin>>n;
    for (int i=1; i<=n; i++){
        int a;
        cin>>a;
        fib(a);
    }
}

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 inF(int n){
	if(n==0||n==1){return true;}
	int a=0;
	int b=1;
	int c;
	c=a+b;
	while(true){
	a=b;
	b=c;
	c=a+b;
	if (n==c){return true;}
	if (c>n){return false;}}}
int main(){
	int M;
	cin>>M;
	int n;
	int a;
	int b=1;
	bool d=true;
	bool e=true;
		cin>>n;
		if(!inF(n)){d=false;}
		a=n;
		repeat(M-1){
			cin>>n;
			if(!inF(n)){
				d=false;
			}
			if(!d){break;}
			if(inF(n)) {
				if(a>n){e=false;}
				if(b==a&&a==n){e=false;}
			}
			if(!e){break;}
			b=a;
			a=n;
		}
		(d&&e)?cout<<"true"<<endl:cout<<"false"<<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;cin>>n;
                  bool done=false;
                  bool fibo=false;
                  int x=0;
                 for(int i=1 ;i<=n;i++,fibo=false){     int n1;cin>>n1;
                                                    int a=1;int b=1;
                                                     if(!fibo){
                                                           int c;
                                                         if(n1==1 && n1>=x){continue;}
                                                         c=a+b;
                                                   for(;c<=n1 && n1>=x;){if(c==n1){ fibo==true;
                                                                                     x=c;
                                                                                          break;}
                                                              a=b;
                                                              b=c;
                                                              
                                                              c=a+b; }
                                                         done=fibo;
                                                              if( n1>=x){fibo=true;}
                                                     }
                                                                      
                                                           }



                 
               
     if(done){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>
main_program {
    char c;
    int n , i ;
    bool done = false ;
    cin>>c>>n;
    n = c-48 ;
    cin >>c;
   for (i = 0;i<(n+1);cin >> c) {
        int f0 = 0;
        int f1 = 1;
        while(!done) {
            int s = f0;
            f0 = f1;
            f1 = f0 + s;
             if (c-48 ==f1 || c-48 == f0 || c-48 == s){ 
             done = true ;
             i++;}
             if ( i > n )
             break;
        }
    } 
    if (i = n )
    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>
main_program{
    int M;
    cin>>M;
    bool fibo=true;
    int num,n1=0,n2=1,count=0;
    for(int i=1; i<=M; i++){
        cin>>num;
        if(num==0 && count==0){
            cin>>num;
            i++;
            count++;
        }
        else if(num==0 && count>0){
            fibo = false;
            break;
        }
        else if(num<n2){
            fibo=false;
            break;
        }
        else{
            fibo=false;
            while(num>n1){
                if(num==n2) {
                    fibo=true;
                }
                n2+=n1;
                n1=n2-n1;
            }
            if(fibo==false){
                break;
            }
        }
    }
    if(fibo){
        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>

  bool Finder(int n){
    if(n==0 || n==1) return 1;
    else {
        int a0=0,a1=1,an=1;
        for(int i=0;i<=19;i++){
            an=a1+a0;
            a0=a1;
            a1=an;
            if(n==an){
                 return 1;
                 break;
            }
        }
        return 0;
    }
        
  }
  int main(){
    int num,seq;
    int Seq[19];
    cin>>num;
    bool con1,conf=true;
    for(int i=0;i<num;i++){
        cin>>seq;
        Seq[i]=seq;
        con1=Finder(seq);
        if(!con1) break;
    }
    for(int i=1;i<num;i++){
        if(Seq[i]<Seq[i-1]||(Seq[i]==Seq[i-1]&&Seq[i]==Seq[i+1])){
            conf=false;
            break;
        }
    }
    if(!con1|| !conf) cout<<"false";
    else 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>

/*  This functions returns index of fibonacci number
    It returns -1 if number not found 
    It returns 1 when (n = 1) sent for first time
    It returns 2 when (n = 1) sent after first time
*/

bool firstpass  = true;                        
int isFibonacci(int n){
    int f_minus_one = 1 , f_minus_two = 0;                  
    int index  = 1;  
    if (n == 0) return 0; 
    else if (n == 1 ){
        if (firstpass) { firstpass = false; return 1; }
        else return 2; 
    }
    else {
        while (n>f_minus_one){
            int temp = f_minus_one; 
            f_minus_one = f_minus_one+f_minus_two; 
            f_minus_two = temp; 
            index++; 
        }
        if (n==(f_minus_one)) return (index); 
        else return (-1); 
    }
}


main_program{
    int num_testcases;  cin>>num_testcases;   

    int index_of_previous_fibonacci = -1, n; 

    bool br = true; 
    repeat(num_testcases){
        cin>>n; 

        int current_index = isFibonacci(n); 
        
        if (current_index>index_of_previous_fibonacci){
            index_of_previous_fibonacci  = current_index; 
            continue; 
        }
        else{
            br = false; 
            break ; 
        }
        
    }
    if(br) 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(void)
{
    int a = 1;
    int b = 0;
    int m;
    cin >> m;
    bool yes = true;
    for (int i=0; i<m; i++)
    {
        int x;
        cin >> x;
        if (yes)
        {
            while (x>b)
            {
                int temp = b;
                b=a+b;
                a=temp;
            }
            if (x!=b)
            {
                yes=false;
            }
            int temp = b;
            b=a+b;
            a=temp;
        }
    }
    if (yes)
    {
        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 f(int n){
    int a1=0;int a2=1;int temp;
    for(int i=0;i<n;++i){
    temp=a1;
    a1=a2;a2+=temp;
    }
    return temp;
}
int main(){
    int M,a;
    cin >> M;
    bool valid=true;
    bool fib=true;
    for(int i=0;i<M;++i){
        cin >> a;
        if(valid){  
            for(int k=1;k<200;++k){
                if(f(k)==a){
                    valid=true;
                    break;
                    }
                else{
                    valid=false;
                }
            }
        }
        else{fib=false;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 <simplecpp>
bool F(int a) {int k=0;
            int l=1;
            repeat (100) {int m = k+l;
            k=l;
            l=m;
            if (a==k) {F=true;} else {F=false;}}}
int main() {
    int n;
    int a, b, c;
    cin >> n;
    cin >> a >> b;
    bool F = false;
    for (int i=0; i<n-2; i++) {
        cin >> c;   
        if (a < b < c) {
            F = true;
        } else {
            F = false;
        }
        if (!F(a) && !F(b) && !F(c)) {F=false;}
        a = b;
        b = c;
    }
}
if (F) {
    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 F(int k){
    int a=1,b=1,c;
    if( (k==0) || (k==1) ) { c=1;} // c is kth term,
    else{
    for( int x=1,a=1,b=1 ; x<=(k-1) ; x++){
        c = a+b;
        a=b;
        b=c;
        }
    }
}

int pos(int i){
    int n=0;
    while(1){
        if (i==F(n)) { return n;}
        else n+=1;
    }
}

bool inFibo(int i, int k){
    for( int t=F(k) ; ; k++){
        if( i==F(k) ){ return true;}
    }
    
}


main_program{
    int m,i,k=0;
    cin >> m;
    
    while(m>0){
        cin>>i;

        if(inFibo(i,k)==false){ cout<<"false"; break;}
        else (inFibo(i,k)==true){ k = pos(i)+1 ;}

        m -= 1;
    }
    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