Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7510 - Өмнөхөөсөө их

Өгөгдсөн массив дахь өмнөх гишүүнээсээ их утгатай элементүүдийн тоог ол.

Input

Эхний мөрөнд натурал тоо n өгөгдөнө. n<=100.

Дараагийн мөрөнд n ширхэг бүхэл тоо зайгаар тусгаарлагдан өгөгдөнө. Int төрөл.

Output

Өмнөхөөсөө их элементийн тоо.

Example

Input:
4
1 2 5 3
Output: 2

Нэмсэн:Bataa
Огноо:2013-02-21
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2023-12-04 11:04:57
#include <iostream>
using namespace std;
int main(){
long long n,a[100],b[100],i,j,k=0,s=0;
cin>>n;
for(i=1; i<=n; i++){
cin>>a[i];
}
for(j=2; j<=n; j++){
if(a[j-1]<a[j]){
k++;
}
}
cout<<k;
return 0;
}
//Saihna bloa
2023-09-05 08:26:07
#include <iostream>

using namespace std;

int main()
{
int a[100], n, x=0, i, j;
cin >> n;

for (j = 1; j <= n; j++) {
cin >> a[j];
}

for (i = 2; i <= n; i++) {

if (a[i-1] < a[i]) {
x++;
}
}

cout << x;
return 0;
}

2021-11-19 11:28:31
hard2
2019-11-29 12:02:54
#include<stdio.h>
#include<stdlib.h>
main()
{
int a[100],n,i,s;
scanf("%d",&n);
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
s=0;
for(i=1; i<=n; i++)
{if(a[i]>a[i-1])

s=s+1;
else s=s+0;
}
printf("%d\n",s);
system("pause");
}
2015-03-22 13:40:43 VisuaL
#include<stdio.h>
#include<stdlib.h>
main()
{
int a[100],n,i,s;
scanf("%d",&n);
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
s=0;
for(i=1; i<=n; i++)
{if(a[i]>a[i-1])

s=s+1;
else s=s+0;
}
printf("%d\n",s);
system("pause");
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.