Submission #684845

#TimeUsernameProblemLanguageResultExecution timeMemory
684845sharaelongSequence (BOI14_sequence)C++17
25 / 100
1 ms340 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...