답안 #105643

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
105643 2019-04-13T18:56:21 Z Leonardo_Paes 수열 (BOI14_sequence) C++11
25 / 100
17 ms 640 KB
#include <bits/stdc++.h>

using namespace std;

int vet[100100];

int main(){
	
	int k;

	cin >> k;

  int x;

  bool ok=true;

	for(int i=1; i<=k; i++){
		cin >> vet[i];
    x=vet[1];
    if(x!=vet[i]){
      ok=0;
    }
	}

  if(ok==true){
        if(x==0){
      if(k==1){
        cout << 10 << endl;
      }
      else if(k>=2 and k<=11){
        cout << 100 << endl;
      }
        else if(k>=12 and k<=111){
      cout << 1000 << endl;
    }
    else if(k>=112 and k<=1111){
      cout << 10000 << endl;
    }
    else if(k>=1112 and k<=11111){
      cout << 100000 << endl;
    }
    else{
      cout << 1000000 << endl;
    }
    return 0;
    }
    else if(x==9){
      if(k==1){
        cout << 9 << endl;
      }
      else if(k>=2 and k<=11){
        cout << 89 << endl;
      }
      else if(k>=12 and k<=111){
        cout << 889 << endl;
      }
        else if(k>=112 and k<=1111){
      cout << 8889 << endl;
    }
    else if(k>=1112 and k<=11111){
      cout << 88889 << endl;
    }
    else if(k>=11112 and k<=111111){
      cout << 888889 << endl;
    }
    return 0;
    }
    

    if(k==1){
      cout << x << endl;
    }
    else if(k>=2 and k<=10){
      cout << x*10 << endl;
    }
    else if(k>=11 and k<=100){
      cout << x*100 << endl;
    }
    else if(k>=101 and k<=1000){
      cout << x*1000 << endl;
    }
    else if(k>=1001 and k<=10000){
      cout << x*10000 << endl;
    }
    else if(k>=10001 and k<=100000){
      cout << x*100000 << endl;
    }
    return 0;
  }
  
}

Compilation message

sequence.cpp: In function 'int main()':
sequence.cpp:86:17: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
       cout << x*100000 << endl;
                 ^~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
6 Correct 4 ms 384 KB Output is correct
7 Correct 13 ms 640 KB Output is correct
8 Correct 10 ms 512 KB Output is correct
9 Correct 17 ms 640 KB Output is correct
10 Correct 16 ms 640 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -