제출 #200610

#제출 시각아이디문제언어결과실행 시간메모리
200610TadijaSebezEditor (BOI15_edi)C++11
35 / 100
3038 ms5056 KiB
#include <bits/stdc++.h> using namespace std; const int N=300050; int a[N]; int main(){ int n; scanf("%i",&n); for(int i=1;i<=n;i++)scanf("%i",&a[i]); for(int i=1;i<=n;i++){ stack<int> stk; int ans=0; 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:28: 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]);
                       ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...