Submission #418454

# Submission time Handle Problem Language Result Execution time Memory
418454 2021-06-05T11:33:18 Z DJeniUp Sequence (BOI14_sequence) C++17
0 / 100
3 ms 204 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll>pairll;
typedef pair<ll,pairll>pairlll;
typedef pair<pairll,ll>pairllL;
typedef pair<pairll,pairll>pairllll;
typedef pair<ll,pairllll>pairlllll;
typedef long double ld;
typedef pair<ll,string>pairls;

#define endl '\n'
#define INF 100000000007
#define M 1000000000
#define P 316
#define MOD 998244353
#define pb push_back
#define fr first
#define sc second

ll k,d,res,r;

int main()
{
    cin>>k;
    for(int i=1;i<=k;i++){
        cin>>d;
    }
    k--;
    if(d==9){
        res=9;
        r=10;
        while(res+k>=r){
            res+=8*r;
            r*=10;
        }
        cout<<res<<endl;
        return 0;
    }
    if(d==0){
        d=10;
    }
    res=d;
    r=0;
    while(res+k>=(res/d)*(d+1)){
        res*=10;
    }
    cout<<res<<endl;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 2 ms 204 KB Output is correct
3 Correct 3 ms 204 KB Output is correct
4 Incorrect 2 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -