# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
996353 | Essa2006 | 비스킷 담기 (IOI20_biscuits) | C++14 | 45 ms | 432 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define FF first
#define SS second
#define all(a) a.begin(), aa.end()
#define mod (ll)(1000000007)
ll count_tastiness(ll n, vector<ll> Freq) {
if (n == 1) {
ll ans = 1, cur = 1, strt = 0;
while (Freq.size() < 61) {
Freq.push_back(0);
}
for (int j = 0; j < 61; j++) {
if (Freq[j] & 1) {
cur += (1LL << (j - strt));
}
ll move = Freq[j] / 2;
if (move == 0) {
ans *= cur;
cur = 1;
strt = j + 1;
}
if (j != Freq.size() - 1)
Freq[j + 1] += move;
}
ans *= cur;
return ans;
}
int sum = 100000 / n;
int ans = 0;
for (int i = 0; i <= sum; i++) {
vector<ll> Freq2 = Freq;
while(Freq2.size() < 18) {
Freq2.push_back(0);
}
int j = 0;
bool cant = 0;
while (j < 18) {
if ((1 << j) & i) {
if (Freq2[j] < n) {
cant = 1;
break;
}
Freq2[j] -= n;
}
if (j != Freq2.size() - 1) {
Freq2[j + 1] += Freq2[j] / 2;
}
j++;
}
ans += !cant;
}
return ans;
}
컴파일 시 표준 에러 (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... |