| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 304802 | junseo | 비스킷 담기 (IOI20_biscuits) | C++17 | 3 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define rmin(r, x) r = min(r, x)
#define rmax(r, x) r = max(r, x)
#define ends ' '
#define endl '\n'
#define fastio ios_base::sync_with_stdio(0), cin.tie(0)
#pragma GCC optimize("O3")
#pragma GCC target("avx,avx2")
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxk = 65;
const int maxa = 2e5 + 10;
ll r[maxk], c[maxk];
ll get_r(ll T) {
if(!T) return 0;
if(T == 1) return r[0];
int i = 63 - __builtin_clzll(T);
return c[i - 1] + get_r(T - (1LL << i));
}
long long count_tastiness(long long x, vector<ll> s) {
int k = s.size();
s.resize(maxk);
for(int i = 1; i <= 60; ++i) s[i] = s[i - 1] + (1LL << i) * s[i];
r[0] = (s[0] >= x) - 1;
c[0] = r[0] + 1;
for(int i = 1; i <= 60; ++i) {
ll T = s[i] / x - (1LL << i);;
if(T < 0) {
r[i] = -1;
}
else {
int j = 63 - __builtin_clzll(T);
if(i <= j) r[i] = c[i - 1] - 1;
else r[i] = get_r(T);
}
c[i] = c[i - 1] + r[i] + 1;
}
return c[60];
}컴파일 시 표준 에러 (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... | ||||
