Submission #1052259

#TimeUsernameProblemLanguageResultExecution timeMemory
1052259mychecksedadPacking Biscuits (IOI20_biscuits)C++17
0 / 100
0 ms348 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; #define pb push_back #define ll long long int #define all(x) x.begin(),x.end() #define vi vector<int> #define pii pair<int,int> #define ff first #define ss second long long count_tastiness(long long x, std::vector<long long> a) { ll ans = 1; for(int i = 0; i + 1 < a.size(); ++i){ if(a[i] > x) a[i + 1] += a[i]-x>>1; a[i] = min(a[i], x); if(a[i]>0) ans *= 2; } if(a.back() > 0) ans *= 2; return ans; }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:14:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |  for(int i = 0; i + 1 < a.size(); ++i){
      |                 ~~~~~~^~~~~~~~~~
biscuits.cpp:15:32: warning: suggest parentheses around '-' inside '>>' [-Wparentheses]
   15 |   if(a[i] > x) a[i + 1] += a[i]-x>>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...