Submission #418933

# Submission time Handle Problem Language Result Execution time Memory
418933 2021-06-06T08:52:55 Z VladM Sequence (BOI14_sequence) C++14
9 / 100
1 ms 332 KB
#include <bits/stdc++.h>

using namespace std;

long long n, k, b[1007], flag, totflag, c;

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 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;
        }
    }
    return 0;
}

Compilation message

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