Submission #750961

# Submission time Handle Problem Language Result Execution time Memory
750961 2023-05-30T16:44:54 Z mohav48173 Packing Biscuits (IOI20_biscuits) C++14
9 / 100
1000 ms 340 KB
#include "biscuits.h"
#include<bits/stdc++.h>
using namespace std;
long long count_tastiness(long long x, vector<long long> a) {
    while(a.size()<20)a.push_back(0);
    int ans=0;
    for(int i=0;i<=100000;i++) {
        vector<int>corr;
        int copyi=i;
        while(copyi>0) {
            corr.push_back(copyi&1);
            copyi>>=1;
        }
        vector<long long>copya=a;
        bool isgood=1;
        for(int j=0;j<corr.size();j++) {
            if(corr[j]==1 && copya[j]<x){isgood=0;break;}
            if(corr[j]==1)copya[j]-=x;
            copya[j+1]+=copya[j]/2;
        }
        ans+=isgood;
    }
    return ans;
}

Compilation message

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:16:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         for(int j=0;j<corr.size();j++) {
      |                     ~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 232 ms 276 KB Output is correct
2 Correct 206 ms 280 KB Output is correct
3 Correct 225 ms 280 KB Output is correct
4 Correct 232 ms 280 KB Output is correct
5 Correct 238 ms 284 KB Output is correct
6 Correct 304 ms 280 KB Output is correct
7 Correct 228 ms 280 KB Output is correct
8 Correct 254 ms 284 KB Output is correct
9 Correct 254 ms 276 KB Output is correct
10 Correct 224 ms 280 KB Output is correct
11 Correct 219 ms 280 KB Output is correct
12 Correct 262 ms 300 KB Output is correct
13 Correct 240 ms 284 KB Output is correct
14 Correct 333 ms 284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 228 ms 276 KB Output is correct
2 Incorrect 146 ms 276 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 209 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1051 ms 340 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 232 ms 276 KB Output is correct
2 Correct 206 ms 280 KB Output is correct
3 Correct 225 ms 280 KB Output is correct
4 Correct 232 ms 280 KB Output is correct
5 Correct 238 ms 284 KB Output is correct
6 Correct 304 ms 280 KB Output is correct
7 Correct 228 ms 280 KB Output is correct
8 Correct 254 ms 284 KB Output is correct
9 Correct 254 ms 276 KB Output is correct
10 Correct 224 ms 280 KB Output is correct
11 Correct 219 ms 280 KB Output is correct
12 Correct 262 ms 300 KB Output is correct
13 Correct 240 ms 284 KB Output is correct
14 Correct 333 ms 284 KB Output is correct
15 Correct 228 ms 276 KB Output is correct
16 Incorrect 146 ms 276 KB Output isn't correct
17 Halted 0 ms 0 KB -