# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1114861 | epicci23 | 카니발 티켓 (IOI20_tickets) | C++17 | 27 ms | 37968 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
#include "tickets.h"
#define ll long long
#define all(v) v.begin() , v.end()
#define sz(a) (ll)a.size()
using namespace std;
const ll N = 3e6 + 5;
const ll LOG = 21;
ll fw[N],fw2[N];
inline void add(ll c,ll u,ll u2){
for(;c<N;c+=c&-c){
fw[c]+=u;
fw2[c]+=u2;
}
}
inline ll query(ll k,ll res=0,ll p=0){
for(ll i=LOG-1;i>=0;i--){
if(fw2[p+(1LL<<i)]<=k){
p+=(1LL<<i);
k-=fw2[p+(1LL<<i)];
res+=fw[p];
}
}
return res;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |