제출 #602832

#제출 시각아이디문제언어결과실행 시간메모리
602832MohamedFaresNebili비스킷 담기 (IOI20_biscuits)C++14
0 / 100
1081 ms348 KiB
#include <bits/stdc++.h>
/// #pragma GCC optimize ("Ofast")
/// #pragma GCC target ("avx2")
/// #pragma GCC optimize("unroll-loops")
 
            using namespace std;
 
            using ll = long long;
            using ii = pair<ll, ll>;
            using vi = vector<int>;
 
            #define ff first
            #define ss second
            #define pb push_back
            #define all(x) (x).begin(), (x).end()
            #define lb lower_bound
 
            const int oo = 1000 * 1000 * 1000 + 7;
 
            ll count_tastiness(ll X, vector<ll> A) {
                int K = A.size(); ll res = 0;
                ll C = 0, pw[60]; pw[0] = 1;
                for(int l = 1; l < 60; l++)
                    pw[l] = pw[l - 1] * 2;
                for(int l = 0; l < K; l++)
                    C += pw[l] * A[l];
                int Y = C / X;
                for(int l = 0; l * X <= C; l++) {
                    int T = 0; bool O = 1;
                    for(int i = 0; i < K && O; i++) {
                        if(!(l & (1 << i))) {
                            T += A[i]; T /= 2;
                            continue;
                        }
                        T += A[i];
                        if(T < X) O = 0;
                        T -= X; T /= 2;
                    }
                    res += O;
                }
                return res;
            }

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

biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:27:21: warning: unused variable 'Y' [-Wunused-variable]
   27 |                 int Y = C / X;
      |                     ^
#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...