You are viewing a single comment's thread. Return to all comments →
C++ case0 correct, case1-10 timeout.🤔
int main() { vector<vector<int>> result; int T, N, K; cin>>T; for(int i=0; i<T; i++) { cin>>N>>K; vector<int> b, temp; for(int x = 0; x<N; x++) { int num; cin>>num; b.push_back(num); } for(int y = 0;y<b.size()-K+1;y++) { temp.push_back(*max_element(&b[y],&b[y+K])); } result.push_back(temp); } for( auto x: result) { for (auto y: x) printf("%d ",y); printf("\n"); } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Deque-STL
You are viewing a single comment's thread. Return to all comments →
C++ case0 correct, case1-10 timeout.🤔