제출 #433018

#제출 시각아이디문제언어결과실행 시간메모리
433018lior5654비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1 ms332 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pl; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<pl> vpl; typedef vector<vpl> vvpl; typedef pair<int, int> pi; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pi> vpi; typedef vector<vpi> vvpi; #define rep(i, n) for(int i = 0; i < n; ++i) #define all(c) (c.begin()), (c.end()) #define pb push_back #define eb emplace_back #define fi first #define se second const int maxk = 61; ll x; int k; ll a[maxk] = { 0 }; void init_input(ll X, const vl& A) { x = X; k = A.size(); rep(i, k) {a[i] = A[i];} } ll count_tastiness(ll X, vl A) { init_input(X, A); ll res = 1; ll num_blocks = a[0] + 1; ll block_val = 1; ll dist = 1; ll mx = num_blocks - 1; for(int i = 1; i < k; ++i) { //if(!a[i]) continue; if(mx < (1<<i)) { block_val = num_blocks * block_val; num_blocks = a[i]+1; dist = 1<<i; } else { num_blocks += (a[i] * ((1<<i) / dist)); } mx += a[i] * (1<<i); } return num_blocks * block_val; }

컴파일 시 표준 에러 (stderr) 메시지

biscuits.cpp: In function 'll count_tastiness(ll, vl)':
biscuits.cpp:37:8: warning: unused variable 'res' [-Wunused-variable]
   37 |     ll res = 1;
      |        ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...