#ifndef POINTER05_H_
#define POINTER05_H_
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
int find_length (int *head, int *tail);
int main ()
{
int n;
scanf("%d", &n);
int *arr = (int *) malloc(sizeof(int[200'000]));
for (int i = 0, l, r; i < n; i++)
{
scanf("%d", &l);
r = find_length(&arr[0], &arr[l - 1]);
if (l != r)
{
printf("peach found bug at #%d: expect %d but get %d\n", i, l, r);
return 0;
}
}
printf("peach check: ok\n");
}
#endif // POINTER05_H_
I2lmbmRlZiBQT0lOVEVSMDVfSF8KI2RlZmluZSBQT0lOVEVSMDVfSF8KCiNpbmNsdWRlIDxjc3RkaW8+CiNpbmNsdWRlIDxjc3RkbGliPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPGNhc3NlcnQ+CgppbnQgZmluZF9sZW5ndGggKGludCAqaGVhZCwgaW50ICp0YWlsKTsKCmludCBtYWluICgpCnsKICAgIGludCBuOwogICAgc2NhbmYoIiVkIiwgJm4pOwoKICAgIGludCAqYXJyID0gKGludCAqKSBtYWxsb2Moc2l6ZW9mKGludFsyMDAnMDAwXSkpOwogICAgZm9yIChpbnQgaSA9IDAsIGwsIHI7IGkgPCBuOyBpKyspCiAgICB7CiAgICAgICAgc2NhbmYoIiVkIiwgJmwpOwogICAgICAgIHIgPSBmaW5kX2xlbmd0aCgmYXJyWzBdLCAmYXJyW2wgLSAxXSk7CiAgICAgICAgaWYgKGwgIT0gcikKICAgICAgICB7CiAgICAgICAgICAgIHByaW50ZigicGVhY2ggZm91bmQgYnVnIGF0ICMlZDogZXhwZWN0ICVkIGJ1dCBnZXQgJWRcbiIsIGksIGwsIHIpOwogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9CiAgICB9CgogICAgcHJpbnRmKCJwZWFjaCBjaGVjazogb2tcbiIpOwp9CiNlbmRpZiAvLyBQT0lOVEVSMDVfSF8K