Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n;
- int k[1000000];
- int cnt = 0, d, cnt2 = 1;
- int main() {
- cin >> n;
- for(int i = 0; i < n; i++){
- cin >> k[i];
- }
- for(int i = 0; i < n - 1; i++){
- for(int j = i + 1; j < n; j++){
- if(k[i] < k[j]){
- cnt2++;
- }
- }
- if(cnt2 > cnt){
- cnt = cnt2;
- }
- cnt2 = 1;
- }
- cout << cnt;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement