Submission #107661

#TimeUsernameProblemLanguageResultExecution timeMemory
107661dfistricSequence (BOI14_sequence)C++14
0 / 100
2 ms384 KiB
#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) { 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...