Submission #707130

# Submission time Handle Problem Language Result Execution time Memory
707130 2023-03-08T13:41:36 Z 3omda_Fake Rabbit Carrot (LMIO19_triusis) C++17
0 / 100
0 ms 212 KB
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
#define ll long long
namespace __gnu_pbds{
          typedef tree<ll,
                       null_type,
                       less_equal<ll>,
                       rb_tree_tag,
                       tree_order_statistics_node_update> ordered_set;
}
using namespace __gnu_pbds;
#define ld long double
double eps=1e-9;
#define all(v) v.begin(),v.end()
#define fast cin.tie(0);cin.sync_with_stdio(0);
#define fs(n) fixed<<setprecision(n)
#define PI acos(-1.0)
#define inp(i,n,arr) for(int i=0;i<n;i++)cin>>arr[i];
#define clr(x,val) memset((x),(val),sizeof(x))
#define sz(x) (ll)x.size()
#define mp make_pair
#define debug(x) cout<<"[ "<<x<<" ]"<<endl;
#define debug2(x,y) cout<<"[ "<<x<<" ] "<<", [ "<<y<<" ]"<<endl;
#define debug3(x,y,z) cout<<"[ "<<x<<" ] "<<" , [ "<<y<<" ] "<<" , [ "<<z<<" ] "<<"\n";

int dx[] = {-1,0,1 ,0};
int dy[] = {0,-1,0 , 1};    
const ll oo=(ll)8e18;   
const ll mod=(ll)998244353;
//====================

void solution(){
   int n,m;cin>>n>>m;
   int cnt=0;
   int height=0;
   for(int i=0;i<n;i++){
        int num;cin>>num;
        if(num>height+m){
            cnt++;
            if(!i)
                height+=m;
            else
                height=num;
        }
        else
            height=num;
   } 
   cout<<cnt;
}




int main(){
   int t=1,cnt=1;
  // cin>>t;
    while(t--){
        
        solution();
        cnt++;
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Incorrect 0 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Incorrect 0 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Incorrect 0 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Incorrect 0 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -