Submission #224615

# Submission time Handle Problem Language Result Execution time Memory
224615 2020-04-18T13:52:31 Z AASG Rice Hub (IOI11_ricehub) C++11
0 / 100
1000 ms 7680 KB
#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;
int besthub(int R, int L, int X[], long long B){
    long adr[L+10];
    memset(adr,0,sizeof(adr));
    for(long i=0;i<R;i++)adr[X[i]]=1;
    long mx=0;
  for(long i=1;i<=L;i++){
        long au=0;
        long long ab=B;
    for(long l=i;l<=L;l++){
        if(adr[l]>0 && ab-abs(i-l)>=0){au++;ab=ab-abs(i-l);}
    }
    for(long l=i-1;l>0;l--){
        if(adr[l]>0 && ab-abs(i-l)>=0){au++;ab=ab-abs(i-l);}
    }
    mx=max(mx,au);
  }
  R=mx;
  return R;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Incorrect 5 ms 256 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 6 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 6 ms 384 KB Output is correct
6 Correct 6 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 7 ms 384 KB Output is correct
9 Incorrect 5 ms 256 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 124 ms 384 KB Output is correct
2 Correct 128 ms 472 KB Output is correct
3 Execution timed out 1071 ms 7680 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1079 ms 1152 KB Time limit exceeded
2 Halted 0 ms 0 KB -