Pagini recente » Borderou de evaluare (job #63279) | Borderou de evaluare (job #66515) | Borderou de evaluare (job #2312145)
Borderou de evaluare (job #2312145)
Raport evaluator
Compilare:
main.cpp:2: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>Dmx(1,0),Dmn(1,0);int dfmx=0;for(int i=1;i<N;i++){if(i>=K){while(!Dmx.empty() && Dmx.front()<=i-K)Dmx.pop_front();while(!Dmn.empty() && Dmn.front()<=i-K)Dmn.pop_front();}while(!Dmx.empty()&&V[i]>V[Dmx.back()])Dmx.pop_back();Dmx.push_back(i);while(!Dmn.empty()&&V[i]<V[Dmn.back()])Dmn.pop_back();Dmn.push_back(i);dfmx=max(dfmx,V[Dmx.front()]-V[Dmn.front()]);}g<<dfmx;}
^
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 | 18ms | 393kb | OK | 10 |
9 | 30ms | 524kb | OK | 10 |
10 | 30ms | 524kb | OK | 10 |
Punctaj total | 100 |