提交时间:2023-11-18 09:05:20
运行 ID: 111002
# include <bits/stdc++.h> using namespace std ; int s [114514] ; bool chk ( int l , int r ) { for ( int i = l ; i < r ; i ++ ) { if ( s [i] > s [i + 1] ) { return false ; } } return true ; } int main ( ) { int n ; cin >> n ; for ( int i = 1 ; i <= n ; i ++ ) { cin >> s [i] ; } for ( int i = 1 ; i < n ; i ++ ) { for ( int j = i + 1 ; j <= n ; j ++ ) { if ( chk ( i , j ) ) { for ( int k = i ; k <= j ; k ++ ) { cout << s [k] << ' ' ; } cout << endl ; } } } return 0 ; }