Submission #488568

#TimeUsernameProblemLanguageResultExecution timeMemory
488568AmirElarbiPacking Biscuits (IOI20_biscuits)C++14
0 / 100
2 ms332 KiB
#include <bits/stdc++.h> #include "biscuits.h" #define vi vector<int> #define ve vector #define ll long long #define vf vector<float> #define vll vector<pair<ll,ll>> #define ii pair<int,int> #define vvi vector<vi> #define vii vector<ii> #define gii greater<ii> #define pb push_back #define fi first #define se second #define INF 1e8 #define eps 1e-7 #define eps1 1e-25 #define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define MAX_A 1e5+5 #define V 450 using namespace std; const int MOD = 1e9+7; const int nax = 100005; int s[64]; ll count_tastiness(ll x, ve<ll> a){ for (int i = 0; i < a.size(); ++i) { s[i] = a[i]; } for (int i = 0; i < 64; ++i) { if(s[i] >= 3){ if(s[i]%2 == 1){ s[i+1] += s[i]/2; s[i] = 1; } else { s[i+1] += (s[i]-1)/2; s[i] = 2; } } } int res = 1, cur = 0; for (int i = 0; i < 64; ++i) { if(a[i] == 0 && cur!=0){ res *= cur; cur = 0; } else { cur += a[i]*pow(2,i); } } return res+1; }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:26:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |     for (int i = 0; i < a.size(); ++i)
      |                     ~~^~~~~~~~~~
#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...