{"problem":{"name":"[信息与未来 2014] 取数","description":{"content":"有 $n$ 个数排成一排，从 $n$ 个数中任取若干个数，取数规则为每次取相邻的 $2$ 个数，不能取 $1$ 个，也不能取多于 $2$ 个连续的数，找一种取法，使取到数的和为最大。","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":524288},"difficulty":{"LuoguStyle":"P3"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGB4135"},"statements":[{"statement_type":"Markdown","content":"有 $n$ 个数排成一排，从 $n$ 个数中任取若干个数，取数规则为每次取相邻的 $2$ 个数，不能取 $1$ 个，也不能取多于 $2$ 个连续的数，找一种取法，使取到数的和为最大。\n\n## Input\n\n第一行一个整数，表示 $n$；\n第二行有 $n$ 个整数，表示 $x_1,x_2,\\cdots,x_n$。\n\n## Output\n\n一个整数，即合理取法中最大的和。\n\n[samples]\n\n## Note\n\n$2\\le n\\le 10^5,1\\le x_i\\le 10^9$。","is_translate":false,"language":"English"}],"meta":{"iden":"LGB4135","tags":["动态规划 DP","2014","江苏","信息与未来"],"sample_group":[["6\n13 2 17 14 8 16","43"]],"created_at":"2026-03-03 11:09:25"}}