Submission #46897

# Submission time Handle Problem Language Result Execution time Memory
46897 2018-04-24T15:46:03 Z rajarshi_basu Money (IZhO17_money) C++14
0 / 100
2 ms 360 KB
#include <iostream>
#include <algorithm>


#define FOR(i,n) for(int i=0;i<n;i++)
/*#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define ll long long int
#define pb(a) push_back(a)
#define vi vector<int>
#define ii pair<int,int>
#define iii pair<pair<int,int>, int>
#define mp(a,b) make_pair(a,b)
*/

using namespace std;

int main(){
  int n;
  cin >> n;
  int prev = 0;
  int ctr = 1;
  FOR(i,n){
    int a;
    cin >> a;
    if(a<prev) ctr++;
    prev = a;
  }
  cout << ctr <<endl;


  return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Incorrect 2 ms 360 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Incorrect 2 ms 360 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Incorrect 2 ms 360 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Incorrect 2 ms 360 KB Output isn't correct
3 Halted 0 ms 0 KB -