diff --git a/day4/T435167/fixed.cpp b/day4/T435167/fixed.cpp new file mode 100644 index 0000000..c1611a0 --- /dev/null +++ b/day4/T435167/fixed.cpp @@ -0,0 +1,73 @@ +//TODO +#include +using namespace std; + +const int MAX_N=1e3+5; +int t,n; +int a[MAX_N],b[MAX_N]; + +bool is_all_go_up(int a[],int size){ + for (int i=2; i<=size; i++) { + if (a[i-1]>a[i]) { + return false; + } + } + return true; +} + +bool is_all_same(int a[],int size){ + for(int i=2;i<=size;i++){ + if (a[i]!=a[1]) { + return false; + } + } + return true; +} + +void sort_fix(int arr[],int b[],int size){ + vector> hist; + for (int i=1; i<=size; i++) { + int p_max=-1; + int max_num=arr[i]; + for (int j=i; j<=size; j++) { + if (max_num>t; + for (int i=1; i<=t; i++) { + cin>>n; + for (int j=1; j<=n; j++) { + cin>>a[j]; + } + for (int j=1; j<=n; j++) { + cin>>b[j]; + } + if (is_all_go_up(a, n)) { + cout<<0<