(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #1082793

#TimeUsernameProblemLanguageResultExecution timeMemory
1082793beaconmcPacking Biscuits (IOI20_biscuits)C++14
0 / 100
1 ms348 KiB
#include "biscuits.h" #include <bits/stdc++.h> typedef long long ll; #define FOR(i,x,y) for(ll i=x; i<y; i++) #define FORNEG(i,x,y) for(ll i=x; i>y; i--) using namespace std; long long count_tastiness(long long x, std::vector<long long> a) { vector<ll> temp = a; if (x>100005) return 1; FOR(i,0,30) a.push_back(0); FOR(i,0,a.size()-1){ if (a[i] > 2) a[i+1] += 1, a[i] -= 2; } ll ans = 1; ll prev = -1; FOR(i,0,a.size()-1){ ans *= a[i]+1; if (i>0 && a[i-1] == 2) ans -= prev * a[i]; prev = ans; } return ans; }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:5:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define FOR(i,x,y) for(ll i=x; i<y; i++)
......
   18 |  FOR(i,0,a.size()-1){
      |      ~~~~~~~~~~~~~~              
biscuits.cpp:18:2: note: in expansion of macro 'FOR'
   18 |  FOR(i,0,a.size()-1){
      |  ^~~
biscuits.cpp:5:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define FOR(i,x,y) for(ll i=x; i<y; i++)
......
   25 |  FOR(i,0,a.size()-1){
      |      ~~~~~~~~~~~~~~              
biscuits.cpp:25:2: note: in expansion of macro 'FOR'
   25 |  FOR(i,0,a.size()-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...