Submission #743440

# Submission time Handle Problem Language Result Execution time Memory
743440 2023-05-17T11:43:13 Z irmuun Sequence (BOI14_sequence) C++17
9 / 100
382 ms 592 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<=1000;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 320 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 316 KB Output is correct
7 Correct 1 ms 320 KB Output is correct
8 Correct 5 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 2 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 320 KB Output is correct
14 Correct 7 ms 320 KB Output is correct
15 Correct 8 ms 212 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 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 316 KB Output is correct
7 Incorrect 4 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 44 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 2 ms 212 KB Output is correct
3 Correct 1 ms 324 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Incorrect 382 ms 592 KB Output isn't correct
6 Halted 0 ms 0 KB -