Submission #418975

# Submission time Handle Problem Language Result Execution time Memory
418975 2021-06-06T09:32:00 Z VladM Sequence (BOI14_sequence) C++14
0 / 100
3 ms 332 KB
#include <bits/stdc++.h>

using namespace std;

long long n, k, b[100007], flag, totflag, c, it;

vector<long long> vec;

void get_char(long long a)
{
    vec.clear();
    while(a>0)
    {
        vec.push_back(a%10);
        a/=10;
    }
    return;
}

int main()
{
    cin>>k;
    for(int i=1; i<=k; i++) cin>>b[i];
    //for(int i=1; i<=k; i++) b[i]=c;
    /*for(int n=1; n<=1000; n++)
    {
        totflag=0;
        for(int i=1; i<=k; i++)
        {
            c=n+i-1;
            get_char(c);
            flag=0;
            for(int j=0; j<vec.size(); j++)
            {
                if(vec[j]==b[i]) flag=1;
            }
            if(flag==0)
            {
                totflag=1;
                break;
            }
        }
        if(totflag==0)
        {
            cout<<n<<endl;
            break;
        }
    }*/
    it=b[1];
    if(it==0) it=10;
    for(int s=1; s<=15; s++)
    {
        //cout<<it<<endl;
        totflag=0;
        for(int i=1; i<=k; i++)
        {
            c=it+i-1;
            get_char(c);
            flag=0;
            for(int j=0; j<vec.size(); j++)
            {
                if(vec[j]==b[i]) flag=1;
            }
            if(flag==0)
            {
                totflag=1;
                break;
            }
        }
        if(totflag==0)
        {
            cout<<it<<endl;
            return 0;
        }
        it*=10;
    }
    return 0;
}

Compilation message

sequence.cpp: In function 'int main()':
sequence.cpp:60:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   60 |             for(int j=0; j<vec.size(); j++)
      |                          ~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 3 ms 332 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -