제출 #549899

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5498992022-04-16 19:28:08neki코끼리 (Dancing Elephants) (IOI11_elephants)C++14
26 / 100
17 ms2812 KiB
#include <bits/stdc++.h>
using namespace std;
#define vc vector
#define ps push_back
const int mm=350;
int n, l;
struct e{
int i, pos, val, odsek, kok;
e(int i_, int pos_): i(i_), pos(pos_){}
bool operator<(const e& oth){return pos < oth.pos;}
};
vc<e> es;
vc<vc<e*>> dp;
void calcdp(vc<e*>& arr){
int siz=arr.size(), nas=siz;
if(siz==0) return;
for(int i=siz-1;i>=0;--i){
while((*arr[i]).pos+l<= (*arr[nas-1]).pos) --nas;
if(nas<siz) (*arr[i]).val=(*arr[nas]).val, (*arr[i]).kok=(*arr[nas]).kok + 1;
else (*arr[i]).val=(*arr[i]).pos+l, (*arr[i]).kok=1;
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

elephants.cpp: In function 'void printdp()':
elephants.cpp:56:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   56 |         for(auto&& v : u) cout << (*v).pos<<" "<<(*v).val<<" "<<(*v).kok<<" | "; cout << endl;
      |         ^~~
elephants.cpp:56:82: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   56 |         for(auto&& v : u) cout << (*v).pos<<" "<<(*v).val<<" "<<(*v).kok<<" | "; cout << endl;
      |                                                                                  ^~~~
elephants.cpp: In function 'int update(int, int)':
elephants.cpp:62:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<e*> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   62 |     int nov=dp.size()-1; for(int i=0;i<dp.size();++i) if(y<(*(dp[i].back())).pos){nov=i;break;}
      |                                      ~^~~~~~~~~~
#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...