| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1203832 | LucaLucaM | 비스킷 담기 (IOI20_biscuits) | C++20 | 1095 ms | 328 KiB |
#include "biscuits.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#define debug(x) #x << " = " << x << '\n'
using ll = long long;
ll count_tastiness(ll X, std::vector<ll> a) {
while ((int) a.size() < 60) {
a.push_back(0);
}
ll S = 0;
for (int i = 0; i < 60; i++) {
S += (ll) (1LL << i) * a[i];
}
int ret = 0;
for (ll y = 0; y <= S; y++) {
ll sum = 0;
bool ok = true;
for (int bit = 0; bit < 60 && ok; bit++) {
sum /= 2;
sum += a[bit];
if (y >> bit & 1LL) {
if (sum >= X) {
sum -= X;
} else {
ok = false;
}
}
}
if (ok) {
ret++;
}
}
return ret;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
