제출 #638892

#제출 시각아이디문제언어결과실행 시간메모리
638892teeslaFinancial Report (JOI21_financial)C++14
14 / 100
4078 ms48536 KiB
#include <bits/stdc++.h> using namespace std; int n,d; vector<int> v; int res=0; void build(vector<int> a, int x){ if(x!=-1){ build(a,x-1); a.push_back(x); build(a,x-1); } else{ for(int i=1; i<a.size(); i++){ if(a[i-1]-a[i]> d){ return; } } int aux=0, maior=-1; for(int i=a.size()-1; i>=0; i--){ if(v[a[i]]>maior){ aux++; maior=v[a[i]]; } } res=max(res,aux); } return; } int main(){ cin >> n >> d; for(int i=0; i<n; i++){ int a; cin >> a; v.push_back(a); } vector<int> a; a.push_back(n-1); build(a,n-2); cout << res<<endl; }

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

Main.cpp: In function 'void build(std::vector<int>, int)':
Main.cpp:17:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |   for(int i=1; i<a.size(); 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...