Submission #1020094

#TimeUsernameProblemLanguageResultExecution timeMemory
1020094BoasPacking Biscuits (IOI20_biscuits)C++17
12 / 100
2 ms604 KiB
#include <bits/stdc++.h> using namespace std; #include "biscuits.h" #define int long long #define loop(x, i) for (int i = 0; i < x; i++) #define pb push_back #define ALL(x) (x).begin(), (x).end() typedef vector<int> vi; typedef pair<int, int> ii; typedef set<int> si; typedef vector<vi> vvi; int count_tastiness(int x, vi a) { if (x != 1) throw; int res = 1, cur = 0; int pow = 1; a.pb(0); loop(a.size(), i) { if (a[i] > 0) { cur += a[i] * pow; pow *= 2; } else { res *= (cur + 1); cur = 0; pow = 1; } } return res; }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, vi)':
biscuits.cpp:6:38: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 | #define loop(x, i) for (int i = 0; i < x; i++)
......
   21 |  loop(a.size(), i)
      |                                       
biscuits.cpp:21:2: note: in expansion of macro 'loop'
   21 |  loop(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...