Submission #171026

# Submission time Handle Problem Language Result Execution time Memory
171026 2019-12-27T05:38:05 Z beksultan04 Money (IZhO17_money) C++14
0 / 100
2 ms 376 KB
#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define OK puts("OK");
#define sz(s) (int)s.size()
#define pii pair<int,int>
#define all(s) s.begin(), s.end()
#define allr(s) s.rbegin(), s.rend()
#define rep(i,n) for (i=0;i<(n);++i)
#define rep1(i,n) for (i=1;i<=(n);++i)
#define ret return
#define nemeshay ios::sync_with_stdio(0),cin.tie(0);
const int N=1e6+12,INF=1e9+7;
int q[N];
main(){
    int i,ans=0,j,n;
    cin>>n;
    for (i=0;i<n;++i)
        cin>>q[i];
    i=0;
    while (i<n){
        int p=i;
        while (q[i]<q[i+1])i++;
        ans++;
        i++;
    }
    cout <<ans;
}

Compilation message

money.cpp:18:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
money.cpp: In function 'int main()':
money.cpp:25:13: warning: unused variable 'p' [-Wunused-variable]
         int p=i;
             ^
money.cpp:19:17: warning: unused variable 'j' [-Wunused-variable]
     int i,ans=0,j,n;
                 ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -