Pagini recente » Borderou de evaluare (job #28677) | Borderou de evaluare (job #307449) | Borderou de evaluare (job #2646778) | Borderou de evaluare (job #55086) | Borderou de evaluare (job #2312149)
Borderou de evaluare (job #2312149)
Raport evaluator
Compilare:
main.cpp:3:73: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
using namespace std;ifstream f("vila2.in");ofstream g("vila2.out");main(){int N,K;f>>N>>K;K++;vector<int>V(N);for(auto &i:V)f>>i;deque<int>P(1,0),Q(1,0);int R=0;for(int i=1;i<N;i++){if(i>=K){U(P)U(Q)}while(!P.empty()&&V[i]>V[P.back()])P.pop_back();P.push_back(i);while(!Q.empty()&&V[i]<V[Q.back()])Q.pop_back();Q.push_back(i);R=max(R,V[P.front()]-V[Q.front()]);}g<<R;}
^
Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
1 | 2ms | 131kb | OK | 10 |
2 | 3ms | 131kb | OK | 10 |
3 | 5ms | 131kb | OK | 10 |
4 | 9ms | 262kb | OK | 10 |
5 | 10ms | 262kb | OK | 10 |
6 | 16ms | 393kb | OK | 10 |
7 | 21ms | 393kb | OK | 10 |
8 | 19ms | 393kb | OK | 10 |
9 | 30ms | 524kb | OK | 10 |
10 | 31ms | 524kb | OK | 10 |
Punctaj total | 100 |