# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
959594 | 2024-04-08T13:31:07 Z | 12345678 | Packing Biscuits (IOI20_biscuits) | C++17 | 1000 ms | 432 KB |
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; #define ll long long const int kx=30, nx=1e5+5; long long count_tastiness(long long x, std::vector<long long> a) { ll res=0; vector<ll> c(kx); for (int i=0; i<a.size(); i++) c[i]=a[i]; for (ll i=0; i<nx; i++) { if (i*x>nx) break; bool f=0; vector<ll> tmp(kx); for (int j=0; j<20; j++) tmp[j]=c[j]; for (int j=0; j<x; j++) { ll cur=i, idx=20; while (idx>=0&&cur>0) { if (!tmp[idx]||(1<<idx)>cur) --idx; else if ((tmp[idx]*(1<<idx))<cur) cur-= tmp[idx]*(1<<idx), tmp[idx]=0; else tmp[idx]-=(cur/(1<<idx)), cur=cur%(1<<idx); //if (i==7) cout<<"here "<<idx<<' '<<cur<<'\n'; } /* if (i==7) { cout<<"cur "<<cur<<'\n'; cout<<"debug : "; for (int k=0; k<4; k++) cout<<tmp[k]<<' '; cout<<'\n'; }*/ if (cur!=0) { f=1; break; } } if (!f) res++; } return res; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 34 ms | 348 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 32 ms | 428 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 10 ms | 432 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1053 ms | 348 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 34 ms | 348 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |