Submission #938229

# Submission time Handle Problem Language Result Execution time Memory
938229 2024-03-05T03:16:05 Z Faisal_Saqib Sequence (BOI14_sequence) C++17
9 / 100
1000 ms 600 KB
#include <iostream>
#include <string>
using namespace std;
bool is_in(int x,int y)
{
    string s=to_string(x);
    string yp="";
    yp+=char(y+'0');
    return s.find(yp)!=string::npos;
}
int main()
{
    int n;
    cin>>n;
    int b[n];
    for(int i=0;i<n;i++)
        cin>>b[i];
    for(int ans=1;ans<=1e6;ans++)
    {
        bool pos=1;
        for(int j=0;j<n;j++)
        {
            if(!is_in(ans+j,b[j]))
                {
                    pos=0;
                    break;
                }   
        }
        if(pos)
        {
            cout<<ans<<endl;
            break;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 600 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 600 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Execution timed out 1018 ms 344 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 120 ms 468 KB Output is correct
3 Execution timed out 1050 ms 344 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 62 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -