답안 #43317

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
43317 2018-03-13T13:48:46 Z shihabsarar29 수열 (BOI14_sequence) C++14
0 / 100
4 ms 612 KB
#include<bits/stdc++.h>
using namespace std;

int A[200000];

int main()
{
   int K,i,res;
   scanf("%d",&K);
   for(i=0;i<K;i++)
      scanf("%d",&A[i]);
   i=0;
   if(A[i]==0)
      A[i]=10;
   if(K==1)
      res=A[i];
   else if(K<=10)
      res=A[i]*10;
   else if(K<=100)
      res=A[i]*100;
   else if(K<=1000)
      res=A[i]*1000;
   else if(K<=10000)
      res=A[i]*10000;
   else if(K<=100000)
      res=A[i]*100000;
   if(A[i]==9)
      res--;
   printf("%d\n",res);
}

Compilation message

sequence.cpp: In function 'int main()':
sequence.cpp:9:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&K);
                  ^
sequence.cpp:11:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
       scanf("%d",&A[i]);
                        ^
sequence.cpp:28:12: warning: 'res' may be used uninitialized in this function [-Wmaybe-uninitialized]
       res--;
            ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 480 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 480 KB Output is correct
2 Incorrect 4 ms 480 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 612 KB Output isn't correct
2 Halted 0 ms 0 KB -