Submission #836355

# Submission time Handle Problem Language Result Execution time Memory
836355 2023-08-24T10:30:32 Z NeroZein Packing Biscuits (IOI20_biscuits) C++17
0 / 100
1000 ms 340 KB
#include "biscuits.h"
#include "bits/stdc++.h"
using namespace std; 

long long count_tastiness(long long x, std::vector<long long> a) {
  long long ret = 1;
  int k = (int) a.size(); 
  for (int i = 1; i <= 1e5; ++i) {
    vector<long long> b = a; 
    bool ok = true; 
    for (int rep = 0; rep < x; ++rep) {
      int rem = i;
      for (int j = k - 1; j >= 0; --j) {
        int take = rem / (1LL << j); 
        int can_take = min((long long) take, b[j]); 
        b[j] -= can_take;
        rem -= can_take * (1LL << j); 
      }
      ok &= rem == 0;       
    }
    ret += ok; 
  }
  return ret;
}

# Verdict Execution time Memory Grader output
1 Correct 59 ms 212 KB Output is correct
2 Execution timed out 1049 ms 212 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 59 ms 336 KB Output is correct
2 Incorrect 69 ms 280 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1046 ms 212 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1037 ms 340 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 59 ms 212 KB Output is correct
2 Execution timed out 1049 ms 212 KB Time limit exceeded
3 Halted 0 ms 0 KB -