# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
457917 | rainboy | 비스킷 담기 (IOI20_biscuits) | C++17 | 37 ms | 332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
using namespace std;
typedef vector<long long> vll;
const int N = 60, Z = 100000;
long long max(long long a, long long b) { return a > b ? a : b; }
long long count_tastiness(long long x, vll aa) {
int n = aa.size(), i;
long long y, cnt;
if (x != 1) {
cnt = 0;
for (y = 0; x * y <= Z; y++) {
long long a = 0;
for (i = N - 1; i >= 0; i--) {
if ((y & 1LL << i) != 0)
a += x;
a = max(a - (i < n ? aa[i] : 0), 0) * 2;
}
if (a == 0)
cnt++;
}
} else {
long long a;
int i, j;
cnt = 1, a = 0;
for (i = 0, j = 0; j <= N; j++) {
if (j < n)
a += aa[j] << j - i;
if (a < 1LL << j - i + 1)
cnt *= (a + 1), a = 0, i = j + 1;
}
}
return cnt;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |