Codeforces Round #134 (Div. 2)A. Mountain Scenery
2012-08-18 20:19
573 查看
暴力。
#include <iostream> #include <string> #include <algorithm> #include <cmath> #include <map> #include <set> using namespace std; const int N = 1000; int main() { int n,k; int a ; cin>>n>>k; for(int i=0;i<=2*n;i++) { cin>>a[i]; } for(int i=0;i<=2*n;i++) { if(k && i%2==1 && a[i]-a[i-1]>1 && a[i]-a[i+1]>1) { a[i]--; k--; } cout<<a[i]<<' '; } return 0; }
相关文章推荐
- Codeforces Round #134 (Div. 2) A. Mountain Scenery
- Codeforces Round #134 (Div. 2) B. Airport
- Codeforces Round #134 (Div. 2)
- Codeforces Round #134 (Div. 2) A_B_C_D题
- Codeforces Round #134 (Div. 2)——B
- Codeforces Round #134 (Div. 2) C. Ice Skating
- Codeforces Round 134 div 2 C题
- Codeforces Round #134 (Div. 2)
- Codeforces Round #134 (Div. 2)
- Codeforces Round #134 (Div. 2)
- 并查集Codeforces Round #134 (Div. 1), problem: (A) Ice Skating
- Codeforces Round #134 (Div. 2)B. Airport
- Codeforces Round #134 (Div. 2)C. Ice Skating
- Codeforces Round #134 (Div. 2)A. Mountain Scenery(简单)
- Codeforces Round #134 (Div. 2)A. Mountain Scenery(简单)
- Codeforces Round #134 (Div. 2) 并查集
- Codeforces Round #134 (Div. 2)
- Codeforces Round #254 (Div. 2) DZY Loves Chemistry【并查集基础】
- Educational Codeforces Round 40 (Rated for Div. 2) B. String Typing
- Codeforces Round #383 (Div. 2) B. Arpa’s obvious problem and Mehrdad’s terrible solution(STL乱搞)