#include "validation.h" using std::vector; using std::pair; using std::abs; // Output: a list of `n` page flips from `i` to `j`. int main(int argc, char **argv) { // Set up the input and answer streams. std::ifstream in(argv[1]); std::ifstream ans(argv[2]); // Only for custom checker. OutputValidator v(argc, argv); int n; in >> n; vector a(n); vector b(n, false); for (int i=0;i> a[i]; int upper_bound = std::ceil(2*n*std::sqrt(n)); int flips = 0; int x=0, y=1; for (int t=0;t