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>

int not_fib_check(int n, int prevt){
    int a = 0, b = 1, turns = prevt+1; 
    prevt++;
    while(prevt--){
        b += a; a = b-a;
    }
    while(a<n){
        b += a;
        a = b - a;
        turns++;
    }
    if(a==n) return turns;
    return -1;
}

main_program{
    int m; cin>>m;
    bool pass = true;
    int x, prev_turns = -1;
    for(int i=0;i<m;i++){
        cin>>x;
        if(not_fib_check(x, prev_turns) == -1){
            pass = false;
            break;
        } 
        else{
            prev_turns = not_fib_check(x, prev_turns);
        }
    }
    cout<<(pass ? "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 main() {
    int n;
    cin >> n;
    int a = 1, b = 0; // after one fibonacci move it becomes (0, 1) as im using do-while loop
    bool is_subseq = true;
    while (n-- != 0) {
        int x;
        cin >> x;
        do {
            int tmp = b;
            b = a + b;
            a = tmp;
        } while (a < x);
        if (a != x) is_subseq = false;
    }
    cout << (is_subseq ? "true\n" : "false\n");
}

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 Fibo(int n){
    int a0 = 0;
    int a1 = 1;
    int a2 = 1;
    int a3;
    for(int i=3 ; i <=n ; i++){
        a3 = a1 + a2;
        a1 = a2;
        a2 = a3;
    }
    return a3;
}

bool checkFibo (int n){
    for(int i = 0; i <= 5000 ; i++){
            if(n == Fibo(i)) return true;
        }
    if( n == 0 || n == 1) return true;
    else return false;
}
bool subSeq3(int a1, int a2, int a3){
    if(a1 > a2 || a2 > a3 || a1 > a3) return false;
    if(checkFibo(a1) == 0 || checkFibo(a2) == 0 || checkFibo(a3) == 0) return false;
    if (a1 == a2 && a2 == a3 )return false;
    if(a1!=1 && (a1==a2 || a2==a3)) return false;
    else return true;
}
bool subSeq2(int a1, int a2){
    if(a1 > a2 ) return false;
    if(checkFibo(a1) == 0 || checkFibo(a2) == 0 ) return false;
    if(a1!=1 && a1==a2) return false;
    else return true;
}
bool subSeq4(int a1, int a2, int a3, int a4){
    if(a1 > a2 || a2 > a3 || a3 > a4 || a1 >a3 || a1>a4 || a2>a4 ) return false;
    if(checkFibo(a1) == 0 || checkFibo(a2) == 0 || checkFibo(a3) == 0 || checkFibo(a4) == 0) return false;
    if ((a1 == a2 && a2 == a3) || (a1 == a2 && a2 == a4) || (a1 == a3 && a4 == a3) || (a4 == a2 && a2 == a3))return false;
    if((a1 !=1 )&&(a2!=1)&&(a3!=1)&&(a4!=1)&& (a1==a2 || a2==a3 || a3 == a4 || a1 == a3 || a1 == a4 || a2 == a4)) return false;
    else return true;
}

main_program{
    int M;
    cin >> M;
    if(M == 2){
        int a1, a2;
        cin >> a1 >> a2;
        bool ans = subSeq2(a1,a2);
        if (ans == 0) cout << "false";
        else cout << "true";
    }
    if(M == 3){
        int a1, a2, a3;
        cin >> a1 >> a2 >> a3;
        bool ans = subSeq3(a1,a2, a3);
        if (ans == 0) cout << "false";
        else cout << "true";
    }
    if(M == 4){
        int a1, a2, a3, a4;
        cin >> a1 >> a2 >> a3>> a4;
        bool ans = subSeq4(a1,a2, a3, a4);
        if (ans == 0) 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: 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>

int f0=0;
int f1=1;

int f2=1;
int f3=2;
int f4=3;
int f5=5;
int f6=8;
int f7=13;
int f9=21;
int f10=34;
int f11=55;
int f12=89;
int f13=144;
int f14=233;
int f15=377;
int f16=610;
int f17=987;
int f18=1597;
int f19=2584;
int f20=4181;

main_program{
        int m;
        cin>>m;
        int b;
        cin>>b;
        if (b==f1||b==f2||b==f3||b==f4||b==f5||b==f6||b==f7||b==f8||b==f9||b==f10||b==f11||b==f12||b==f13||b==f14||b==f15||b==f16||b==f17||b==f18||b==f19||b==f20){

        }
}

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: 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,n1,n2,n3;
    bool got_fibonacci = true;
    if(M<3) got_fibonacci=false;
    for(int i=3;i<=M && !got_fibonacci;++i,n1=n2,n2=n3){
       cin >> n3;
       if(n3!=n1+n2) got_fibonacci=false;
       }
    
    if (got_fibonacci) {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 fib(int n){
    int a1 =1,curr=1,next;
    while(curr< n){
        next = curr + a1;
        a1 = curr;
        curr = next;
    }
    if(n==0){return true;}
    else if(curr == n){return true;}
    else if(curr>n){return false;}
}

main_program{
    bool val;
    int m,a,b,c=0;
    cin>>m;
    cin>>a;
    b=a;
    for(int i=0;i<(m-1);++i){
        if(c>1){
                val = false;
                break;
            }
        if(!fib(b)){
            val = false;
            break;       
        }
        cin>>a;
        if(!fib(a)){
            val = false;
            break;
        }
        if(a>b){
            val = true;
            b=a;
            continue;
        }
        else if(a==1 && b==1){
            c+=1;
        }
        b =a;
    }
    cout<< (val?"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>

main_program{
    int M, a=0, b=1;
    bool p=true;
    cin>>M;
    for(int i=0; i<M; i++){
        int x; cin>>x;
        while(true){
            if(a==x){
                b+=a;
                a=b-a;
                break;
            }
            if(a>x){p=false; break;}
            if(a<x){
                b+=a;
                a=b-a;
            }
        }
        if(p==false){cout<<"false"; break;}
    }
    if(p==true) 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>
main_program{
int M,k=0;
int r,r1=-1,count=0;
bool condition=true;
cin>>M;
while(k<M){cin>>r;k++;
if (r==1)count++;
if(count >2){condition=false;cout<<"false"; break;}
if(r==0||r==1||r==2||r==3 ||r==5||r==8||r==13||r==21||r==34||r==55||r==89||r==144||r==233||r==377||r==610||r==987||r==1597||r==2584){condition=true;}
else {condition=false;cout<<"false ";break; }
if (r<r1){condition=false;cout<<"false";break;}
r1=r;
}
if (k==M&& condition==true)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>

main_program {
    int M;
    cin>>M;
    int c,co=-1,co2=-1;
    bool fib=true;

    for (int i=1;i<=M;i++) {
        cin>>c;
        if (c==1 && co==1 && co2==1) {cout<<"false"; fib=false; break;}
        else if (c==1 && co==1 && co2!=1) {continue;}
        else {
            if (c<=co) {
            cout<<"false";
            fib=false;
            break;
            }
            else {
                bool match=false;
                int n0=0;
                int n1=1;

                int n=n1+n0;
                if (c==0) {match=true;}
                while (n<=c) {
                    if (c==n) {match=true;}
                    n0=n1;
                    n1=n;
                    n=n1+n0;
                }
                if (!match) {cout<<"false"; fib=false; break;}
            }
            co2=co;
            co=c;
        }
    }
    if (fib) {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 fibonacci(int n){
    int f0=0;
    int f1=1;
    if (n==0){
        return 0;
    }
    int i=1;
    while(n>f1){
        int a=f0;
        f0=f1;
        f1=f1+a;
        i+=1;
    }
    if (n==f1){
        return i;
    }
    return -1;
}
int main(){
    int n; cin>>n;
    int v=-1;
    int c1=0;
    for(int i=1; i<=n; i+=1){
        int x; cin>>x;
        if (x==1){ //dealing with 1 separately as it is the only number that repeats twice in the sequence
            c1+=1;
        }
        if (c1>2){
            cout<<"false";
            break;
        }
        if (fibonacci(x)==(-1)){
            cout<<"false";
            break;
        }
        else{
            int v1=fibonacci(x);
            if(v1<v||(v1==v && x!=1)){
                cout<<"false";
                break;
            }
            v=v1;
            if (i==n){
                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>
main_program{
    int n,i,j=0,k=0;
    cin>>n;
    bool fibo = false;
    repeat(n){
        fibo = false;
        cin>>i;
        for(int a=0,b=1,c=0;a<=5000&&b<=5000&&fibo==false;b=c){
                if(i==a||i==b) fibo = true;
                c=a+b;
                a=b;
        }
        while(fibo){
            if(i>=j) {fibo=true;break;}
            else {fibo=false;break;}
        }
        k=j;
        j=i;
        if(i==j&&j==k) fibo = false;
        if(fibo==false) break;
    }
    if(fibo==false) cout<<"false";
    if(fibo==true) 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>
main_program{
    int n,k;
    cin >>k>>n;
    int i;
    int f1=0,f2=1,f3;
    for(i=1;i<=k;){
            if(n==f1||n==f2){
                cin >>n;
                i=i+1;}
        f3=f1+f2;
        f1=f2;
        f2=f3;
        if(n==f2){
            cin >>n;
            i++;}
        else if(n<f2){
            cout <<"false";
            break;}
        else 
            continue;
        }
    if(i=k){
        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 previ=-1;
bool fib(int x,int z)
{int a=0;
int b=1;
int index;
for(int i=0;i>=0;i++)
{//a is ith fib
if(x==a){if(previ<i){previ=i;return true;}}
if(a>x){return false;}

int c=a;
a=b;
b=a+c;
}

}
int main()
{bool check,ans=true;
int n;cin>>n;
for(int i=1;i<=n;i++)
{int x;cin>>x;
check=fib(x,previ);
if(!check){ans=check;}
}
if(ans)
{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