Submission #1022075

#TimeUsernameProblemLanguageResultExecution timeMemory
1022075JakobZorzPacking Biscuits (IOI20_biscuits)C++17
9 / 100
1062 ms604 KiB
#include"biscuits.h" typedef long long ll; using namespace std; ll x; ll coins[120]; ll count(int i,ll num){ if(i==120) return 1; ll res=0; if(num>=x){ res+=count(i+1,coins[i+1]+(num-x)/2); } res+=count(i+1,coins[i+1]+num/2); return res; } ll count_tastiness(ll X,vector<ll>a){ x=X; for(int i=0;i<120;i++) coins[i]=0; for(int i=0;i<(int)a.size();i++) coins[i]=a[i]; return count(0,coins[0]); }

Compilation message (stderr)

biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:23:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   23 |     for(int i=0;i<(int)a.size();i++)
      |     ^~~
biscuits.cpp:25:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   25 |  return count(0,coins[0]);
      |  ^~~~~~
biscuits.cpp:15:29: warning: iteration 119 invokes undefined behavior [-Waggressive-loop-optimizations]
   15 |     res+=count(i+1,coins[i+1]+num/2);
      |                    ~~~~~~~~~^
biscuits.cpp:9:5: note: within this loop
    9 |     if(i==120)
      |     ^~
#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...