codeforces 534 A. Exam

A. Exam time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output An exam for n students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that students with adjacent numbers (i and i + 1) always studied side by side and became friends and if they take

codeforces 482 A. Diverse Permutation(构造)

C - C **Time Limit:**1000MS **Memory Limit:**262144KB 64bit IO Format:%I64d & %I64u Submit Status Description Permutation_p_ is an ordered set of integers _p_1, _p_2, …, _p__n_, consisting of _n_ distinct positive integers not larger than _n_. We’ll denote as_n_ the length of permutation _p_1, _p_2, …, _p__n_. Your task is to find such permutation p of length n, that the group of numbers |_p_1 - _p_2|, |_p_2 - p_3|, …,