#include <iostream>
#include <cstring>
using namespace std;
int main() {
size_t Count = 1024*1024*1024; // 1 Gb
Count *= 5; // 5 Gb
std::cout << Count << std::endl;
char *array = new char[Count];
memset(array, 0, Count);
int32_t index = 0;
for (size_t i = 0; i != Count; i++)
array[index++] = char(i) | 1;
if (array[Count - 1] == 0)
std::cout << "The last array element contains 0.n";
delete [] array;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewogICAgc2l6ZV90IENvdW50ID0gMTAyNCoxMDI0KjEwMjQ7IC8vIDEgR2IKICAgIENvdW50ICo9IDU7IC8vIDUgR2IKICAgIAogICAgc3RkOjpjb3V0IDw8IENvdW50IDw8IHN0ZDo6ZW5kbDsKICAgIAogICAgY2hhciAqYXJyYXkgPSBuZXcgY2hhcltDb3VudF07IAogICAgbWVtc2V0KGFycmF5LCAwLCBDb3VudCk7CgogICAgaW50MzJfdCBpbmRleCA9IDA7CiAgICBmb3IgKHNpemVfdCBpID0gMDsgaSAhPSBDb3VudDsgaSsrKQogICAgICAgYXJyYXlbaW5kZXgrK10gPSBjaGFyKGkpIHwgMTsKCglpZiAoYXJyYXlbQ291bnQgLSAxXSA9PSAwKQoJCXN0ZDo6Y291dCA8PCAiVGhlIGxhc3QgYXJyYXkgZWxlbWVudCBjb250YWlucyAwLm4iOwoKCWRlbGV0ZSBbXSBhcnJheTsKCXJldHVybiAwOwp9