제출 #747783

#제출 시각아이디문제언어결과실행 시간메모리
747783Rafi22비스킷 담기 (IOI20_biscuits)C++14
0 / 100
1115 ms591560 KiB
#include <bits/stdc++.h>

using namespace std;

//#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define ll long long
ll mod=1000000007;
int inf=1000000007;
ll infl=1000000000000000007;

ll ile[67][67];

ll count_tastiness(ll x, vector<ll>w)
{
    int k=sz(w);
    for(int i=0;i<60;i++)
    {
        ll c=0;
        for(int j=i;j<60;j++)
        {
            c/=2;
            if(j<k) c+=w[j];
            ile[i][j]=c;
        }
    }
    vector<pair<ll,pair<ll,int>>>V;
    V.pb({0,{0,-1}});
    for(int i=0;i<60;i++)
    {
        vector<pair<ll,pair<ll,int>>>nV;
        for(auto [p,z]:V)
        {
            ll a=z.st;
            int j=z.nd;
            ll q=p/(1LL<<(i-j))+ile[j+1][i];
            if(q<x) break;
            if(q>=x) nV.pb({q-x,{a+(1LL<<i),i}});
        }
        for(auto z:nV) V.pb(z);
    }
    return sz(V);
}

/*int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
   /* cout<<count_tastiness(1, {1})<<endl;
    cout<<count_tastiness(1, {5})<<endl;
    cout<<count_tastiness(1, {18})<<endl;
   // cout<<count_tastiness(1, {2664})<<endl;
    cout<<count_tastiness(1, {97853})<<endl;

    cout<<count_tastiness(1, {0,4663})<<endl;
    cout<<count_tastiness(1, {0,0,1567})<<endl;
    cout<<count_tastiness(1, {0,0,0,0,0,0,0,0,0,97})<<endl;
    cout<<count_tastiness(1, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1})<<endl;

    return 0;
}*/

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

biscuits.cpp:54:4: warning: "/*" within comment [-Wcomment]
   54 |    /* cout<<count_tastiness(1, {1})<<endl;
      |     
biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:36:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   36 |         for(auto [p,z]:V)
      |                  ^
#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...