제출 #200614

#제출 시각아이디문제언어결과실행 시간메모리
200614TadijaSebezEditor (BOI15_edi)C++11
48 / 100
128 ms2168 KiB
#include <bits/stdc++.h> using namespace std; const int N=300050; int a[N]; int main(){ int n,mn=0; scanf("%i",&n); for(int i=1;i<=n;i++)scanf("%i",&a[i]),mn=min(mn,a[i]); for(int i=1;i<=n;i++){ stack<int> stk; int ans=0; if(i==n||n<=5000){ for(int j=i;j>=1;j--){ if(stk.size()&&a[j]>stk.top()){ stk.pop(); }else{ if(a[j]>0){ans=a[j];break;} stk.push(a[j]); } } } printf("%i\n",ans); } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

edi.cpp: In function 'int main()':
edi.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%i",&n);
  ~~~~~^~~~~~~~~
edi.cpp:8:40: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=1;i<=n;i++)scanf("%i",&a[i]),mn=min(mn,a[i]);
                       ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...