Submission #119994

# Submission time Handle Problem Language Result Execution time Memory
119994 2019-06-22T22:57:25 Z Osama_Alkhodairy Dancing Elephants (IOI11_elephants) C++17
0 / 100
2 ms 384 KB
#include <bits/stdc++.h>
#include "elephants.h"
//~ #include "grader.cpp"
using namespace std;

int n, l;
vector <int> a;

void init(int N, int L, int X[]){
    n = N;
    l = L;
    for(int i = 0 ; i < n ; i++){
        a.push_back(X[i]);
    }
}
int update(int i, int y){
    a.erase(a.begin() + i);
    for(int i = 0 ; i < (int)a.size() ; i++){
        if(a[i] > y){
            a.insert(a.begin() + i, y);
            break;
        }
    }
    if((int)a.size() != n) a.push_back(y);
    int cur = a[0];
    int ans = 1;
    for(auto &i : a){
        if(cur + l < i){
            cur = i;
            ans++;
        }
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -