This commit is contained in:
Zengtudor 2024-10-05 08:06:26 +08:00
parent 1768e7d6ef
commit b8cf1ab56d
3 changed files with 9 additions and 7 deletions

View File

@ -37,4 +37,6 @@ add_executable(P2782 ${CMAKE_CURRENT_LIST_DIR}/P2782/P2782.cpp)
add_executable(P1091 ${CMAKE_CURRENT_LIST_DIR}/P1091/P1091.cpp)
add_executable(P1020 ${CMAKE_CURRENT_LIST_DIR}/P1020/P1020.cpp)
add_executable(P1020 ${CMAKE_CURRENT_LIST_DIR}/P1020/P1020.cpp)
add_executable(U206625 ${CMAKE_CURRENT_LIST_DIR}/U206625/U206625.cpp)

View File

@ -21,12 +21,12 @@ int main(){
for_each_n(len,n,[](decltype(*len) e){
ans1 = std::max(ans1,e);
});
last_max = arr[0];
for_each_n(arr+1,n,[](decltype(*arr) e){
if(last_max < e){
for(int i=1;i<n;i++){
if(arr[i]>arr[i-1]){
ans2++;
}
last_max = e;
});
}
cout<<ans1<<'\n'<<ans2<<'\n';
}
}
// 40 PT

0
U206625/U206625.cpp Normal file
View File