Submission #491738

# Submission time Handle Problem Language Result Execution time Memory
491738 2021-12-04T08:10:35 Z reni Money (IZhO17_money) C++14
0 / 100
1 ms 204 KB
#include<iostream>
using namespace std;
int main()
{
    long long br=0,n,i,j,a,pr=-1;

    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a;

        if(a==pr+1 || a==pr)continue;
        br++;

        pr=a;
    }
    cout<<br-1<<endl;
}

Compilation message

money.cpp: In function 'int main()':
money.cpp:5:24: warning: unused variable 'j' [-Wunused-variable]
    5 |     long long br=0,n,i,j,a,pr=-1;
      |                        ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -