Submission #379545

# Submission time Handle Problem Language Result Execution time Memory
379545 2021-03-18T13:58:58 Z grt Packing Biscuits (IOI20_biscuits) C++17
0 / 100
1000 ms 492 KB
#include <bits/stdc++.h>
#define PB push_back
#define ST first
#define ND second

//#pragma GCC optimize ("O3")
//#pragma GCC target("tune=native")

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

using namespace std;
using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;

ll count_tastiness(ll x, vector<ll>a) {
	while((int)a.size() < 60) a.PB(0);
	for(int i = 1; i < 60; ++i) {
		a[i] = a[i - 1] + (a[i] * (1LL << i));
	}
	ll cnt = 0;
	for(int i = 1; i <= 100 * 1000; ++i) {
		ll c = 0;
		bool ok = true;
		for(int j = 0; j < 60; ++j) {
			if((1LL << j) & i) {
				c += (1LL << j) * x;
			}
			if(c > a[j]) ok = false;
		}
		cnt += ok;
	}
	return cnt+1;
}


//int main() {
	//ios_base::sync_with_stdio(0);
	//cin.tie(0);
	//cout << count_tastiness(2, {2, 1, 2}) << "\n";
	//cout << count_tastiness(3, {5, 2, 1}) << "\n";
//}
# Verdict Execution time Memory Grader output
1 Correct 80 ms 364 KB Output is correct
2 Incorrect 88 ms 492 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 81 ms 364 KB Output is correct
2 Incorrect 50 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 492 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1094 ms 364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 80 ms 364 KB Output is correct
2 Incorrect 88 ms 492 KB Output isn't correct
3 Halted 0 ms 0 KB -