답안 #491902

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
491902 2021-12-04T23:39:20 Z Hegdahl 수열 (BOI14_sequence) C++17
25 / 100
5 ms 844 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];
 
  int v;
  if (x == 0) {
    v = 10;
    int cnt = 1;

    while (cnt < k) {
      v = 10*v;
      cnt = 10*cnt + 1;
    }
  } else if (x == 9) {
    v = 9;
    int cnt = 1;
 
    while (cnt < k) {
      v = 10*v - 1;
      cnt = 10*cnt + 1;
    }
  } else {
    v = x;
    int cnt = 1;

    while (cnt < k) {
      v = 10*v;
      cnt = 10*cnt;
    }
  }

  std::cout << v << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 3 ms 712 KB Output is correct
8 Correct 2 ms 588 KB Output is correct
9 Correct 5 ms 844 KB Output is correct
10 Correct 5 ms 844 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -