답안 #540949

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
540949 2022-03-22T04:46:53 Z Kiarat Money (IZhO17_money) C++17
0 / 100
0 ms 212 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;


int main(){
    ll n;
    cin >> n;

    ll a[n+1];

    for(int i=1;i<=n;i++)
    {
      cin >> a[i];
    }
    a[n+1] = -10;
    ll ans=0;
    ll sum=0;
    for(int i=2;i<=n+1;i++){
      if(a[i-1] > a[i]){
        sum++;
    }
}
    cout << sum;

}

Compilation message

money.cpp: In function 'int main()':
money.cpp:18:8: warning: unused variable 'ans' [-Wunused-variable]
   18 |     ll ans=0;
      |        ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -