Submission #107656

# Submission time Handle Problem Language Result Execution time Memory
107656 2019-04-25T12:01:22 Z dfistric Sequence (BOI14_sequence) C++14
0 / 100
4 ms 768 KB
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a); i >= (b); i--)
#define REP(i, n) FOR(i, 0, n)
#define ll long long

using namespace std;

const int MAXN = 100100;
ll arr[MAXN];

int main() {
    ios_base::sync_with_stdio(false);
 
    int n;
    cin >> n;
    REP(i, n) cin >> arr[i];

    n--;
    ll t = 1;
    while (t < n) t *= 10;

    if (arr[0] == 0) cout << 10LL * t << "\n";
    else {
        if (arr[0] == 9) {
            assert(0);
            
            if (n == 1) {
                cout << "89\n";
                return 0;
            }

            ll out = 0;
            while (t) {
                out += t * 8;
                t /= 10;
            }
            cout << out + 1 << endl;
        } else {
            cout << arr[0] * t << "\n";
        }
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Runtime error 4 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -