Submission #755180

# Submission time Handle Problem Language Result Execution time Memory
755180 2023-06-09T13:49:32 Z AliHasanli Sequence (BOI14_sequence) C++17
9 / 100
6 ms 440 KB
#include<bits/stdc++.h>
using namespace std;
bool check_is_number_has(int n,int a)
{
    while(n>0)
    {
        if(n%10==a)return true;
        n/=10;
    }
    return false;
}
bool check(int a,int k,int numberarray[])
{
    for(int i=a;i<=k+a-1;i++)
        if(!check_is_number_has(i,numberarray[i-a]))
            return false;
    return true;
}
void print(int n,int k)
{
    cout<<n;
    exit(0);
}
int main (){
    int k;
    cin>>k;
    int a[k];
    for(int i=0;i<k;i++)
    cin>>a[i];
    for(int i=a[0];i<=1000;i++)
    {
        bool flag=check(i,k,a);
        if(flag)print(i,k);
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 300 KB Output is correct
5 Correct 1 ms 280 KB Output is correct
6 Correct 1 ms 300 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 300 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 300 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 292 KB Output is correct
13 Correct 1 ms 296 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 304 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 304 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Incorrect 1 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 2 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Incorrect 6 ms 440 KB Output isn't correct
6 Halted 0 ms 0 KB -