#include <algorithm>
#define SIZE (1000)
struct S {
int *vect;
};
int main() {
struct S* s = static_cast<struct S*>(malloc(sizeof(struct S)));
s->vect = static_cast<int*>(malloc(sizeof(int) * SIZE));
for(int i = 0; i < SIZE; i++) {
s->vect[i] = i;
}
std::sort(s->vect, s->vect + SIZE);
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2RlZmluZSBTSVpFICgxMDAwKQoKc3RydWN0IFMgewogICBpbnQgKnZlY3Q7Cn07CgppbnQgbWFpbigpIHsKCiAgICBzdHJ1Y3QgUyogcyA9IHN0YXRpY19jYXN0PHN0cnVjdCBTKj4obWFsbG9jKHNpemVvZihzdHJ1Y3QgUykpKTsKCiAgICBzLT52ZWN0ID0gc3RhdGljX2Nhc3Q8aW50Kj4obWFsbG9jKHNpemVvZihpbnQpICogU0laRSkpOwoKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBTSVpFOyBpKyspIHsKICAgICAgIHMtPnZlY3RbaV0gPSBpOwogICAgfQoKICAgIHN0ZDo6c29ydChzLT52ZWN0LCBzLT52ZWN0ICsgU0laRSk7Cgp9