Submission #684845

# Submission time Handle Problem Language Result Execution time Memory
684845 2023-01-22T16:26:26 Z sharaelong Sequence (BOI14_sequence) C++17
25 / 100
1 ms 340 KB
#include <bits/stdc++.h>
#ifdef SHARAELONG
#include "../../cpp-header/debug.hpp"
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

void solve() {
    int k;
    cin >> k;
    int sz = 1;
    while (k > sz) sz *= 10;

    int d;
    cin >> d;
    if (d == 0) {
        if (k == 1) cout << 10;
        if (2 <= k && k <= 11) cout << 100;
        if (12 <= k && k <= 111) cout << 1000;
        if (112 <= k && k <= 1111) cout << 10000;
        if (1112 <= k && k <= 11111) cout << 100000;
        if (11112 <= k) cout << 1000000;
    } else if (d == 9) {
        if (k == 1) cout << 9;
        if (2 <= k && k <= 11) cout << 89;
        if (12 <= k && k <= 111) cout << 889;
        if (112 <= k && k <= 1111) cout << 8889;
        if (1112 <= k && k <= 11111) cout << 88889;
        if (11112 <= k) cout << 888889;
    } else {
        cout << d * sz;
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    solve();
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 328 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -