Submission #412176

# Submission time Handle Problem Language Result Execution time Memory
412176 2021-05-26T15:13:41 Z A_D Dancing Elephants (IOI11_elephants) C++14
26 / 100
9000 ms 2096 KB
#include "elephants.h"
#include <bits/stdc++.h>
#define LL long long
using namespace std;
LL n,l;
vector<LL> vec;
vector<LL> vec2;
void init(int N, int L, int X[])
{
    n=N;
    l=L;
    for(int i=0;i<N;i++){
        vec.push_back(X[i]);
    }
}

int update(int i, int y)
{
    vec2.clear();
    vec[i]=y;
    for(auto x:vec)vec2.push_back(x);
    sort(vec2.begin(),vec2.end());
    LL ans=0,r=-1;
    for(auto x:vec2){
        if(r<x){
            r=x+l;
            ans++;
        }
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Execution timed out 9060 ms 2096 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Execution timed out 9060 ms 2096 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Execution timed out 9060 ms 2096 KB Time limit exceeded
8 Halted 0 ms 0 KB -