Submission #743453

# Submission time Handle Problem Language Result Execution time Memory
743453 2023-05-17T11:51:25 Z irmuun Sequence (BOI14_sequence) C++17
9 / 100
1000 ms 468 KB
#include<bits/stdc++.h>
 
using namespace std;
 
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define all(s) s.begin(),s.end()

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int k;
    cin>>k;
    vector<int>b(k);
    for(int i=0;i<k;i++){
        cin>>b[i];
    }
    for(int i=1;i<=1000000;i++){
        int cnt=0;
        for(int j=0;j<k;j++){
            int n=i+j;
            bool ok=false;
            while(n>0){
                if(n%10==b[j]){
                    ok=true;
                    break;
                }
                n/=10;
            }
            cnt+=(ok==true);
        }
        if(cnt==k){
            cout<<i;
            return 0;
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 2 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 4 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 2 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 8 ms 212 KB Output is correct
15 Correct 8 ms 320 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 2 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 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 36 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 4 ms 320 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Execution timed out 1084 ms 212 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 1074 ms 340 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 3 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Execution timed out 1083 ms 468 KB Time limit exceeded
6 Halted 0 ms 0 KB -