Submission #269553

# Submission time Handle Problem Language Result Execution time Memory
269553 2020-08-17T07:47:41 Z Autoratch Dancing Elephants (IOI11_elephants) C++14
26 / 100
26 ms 3328 KB
#include "elephants.h"
#include <bits/stdc++.h>
using namespace std;

int n,l;
set<int> s;
int a[101];

void init(int N, int L, int X[])
{
    n = N;l = L;
    for(int i = 0;i < n;i++) s.insert(X[i]);
    for(int i = 0;i < n;i++) a[i] = X[i];
}

int update(int i, int y)
{
    s.erase(a[i]);
    a[i] = y;
    s.insert(a[i]);
    int now = *(s.begin()),used = 1;
    for(int x : s)
    {
        if(now+l>=x) continue;
        now = x,used++;
    }
    return used;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Runtime error 26 ms 3328 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Runtime error 26 ms 3328 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Runtime error 26 ms 3328 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -