Submission #491900

# Submission time Handle Problem Language Result Execution time Memory
491900 2021-12-04T23:34:50 Z Hegdahl Sequence (BOI14_sequence) C++17
0 / 100
1 ms 332 KB
#include <iostream>
#include <vector>
 
int main() {
  std::cin.tie(0)->sync_with_stdio(0);
 
  int k;
  std::cin >> k;
  std::vector<int> a(k);
  for (int &x : a)
    std::cin >> x;
 
  int x = a[0];
  if (x == 0) x = 10;

  if (x == 9) {
    int v = 9;
    int cnt = 1;
 
    while (cnt < k) {
      v = 10*v - 1;
      cnt = 10*cnt + 1;
    }
 
    std::cout << v << '\n';
  } else {
    int v = x;
    int cnt = 1;
    while (cnt < k) {
      v = 10*v;
      cnt = 10*cnt;
    }
 
    std::cout << v << '\n';
  }
}
# 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 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 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Incorrect 1 ms 332 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -