题目链接:

B. Little Robber Girl's Zoo

  1. //#include <bits/stdc++.h>
  2. #include <vector>
  3. #include <iostream>
  4. #include <queue>
  5. #include <cmath>
  6. #include <map>
  7. #include <cstring>
  8. #include <algorithm>
  9. #include <cstdio>
  10.  
  11. using namespace std;
  12. #define Riep(n) for(int i=1;i<=n;i++)
  13. #define Riop(n) for(int i=0;i<n;i++)
  14. #define Rjep(n) for(int j=1;j<=n;j++)
  15. #define Rjop(n) for(int j=0;j<n;j++)
  16. #define mst(ss,b) memset(ss,b,sizeof(ss));
  17. typedef long long LL;
  18. template<class T> void read(T&num) {
  19. char CH; bool F=false;
  20. for(CH=getchar();CH<''||CH>'';F= CH=='-',CH=getchar());
  21. for(num=;CH>=''&&CH<='';num=num*+CH-'',CH=getchar());
  22. F && (num=-num);
  23. }
  24. int stk[], tp;
  25. template<class T> inline void print(T p) {
  26. if(!p) { puts(""); return; }
  27. while(p) stk[++ tp] = p%, p/=;
  28. while(tp) putchar(stk[tp--] + '');
  29. putchar('\n');
  30. }
  31.  
  32. const LL mod=1e9+;
  33. const double PI=acos(-1.0);
  34. const LL inf=1e18;
  35. const int N=(<<)+;
  36. const int maxn=;
  37.  
  38. int n,x;
  39. int a[];
  40. int main()
  41. {
  42. read(n);
  43. for(int i=;i<=n;i++)
  44. {
  45. read(a[i]);
  46. }
  47. x=;
  48. while(x--)
  49. {
  50. for(int i=;i<n;i++)
  51. {
  52. if(a[i]>a[i+]){swap(a[i],a[i+]);cout<<i<<" "<<i+<<"\n";}
  53. }
  54. }
  55.  
  56. return ;
  57. }

codeforces 686B B. Little Robber Girl's Zoo(水题)的更多相关文章

  1. Codeforces Round #359 (Div. 2) B. Little Robber Girl's Zoo 水题

    B. Little Robber Girl's Zoo 题目连接: http://www.codeforces.com/contest/686/problem/B Description Little ...

  2. Codeforces Round #334 (Div. 2) A. Uncowed Forces 水题

    A. Uncowed Forces Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/604/pro ...

  3. Codeforces Round #115 B. Plane of Tanks: Pro 水题

    B. Plane of Tanks: Pro Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/17 ...

  4. Codeforces Beta Round #14 (Div. 2) A. Letter 水题

    A. Letter 题目连接: http://www.codeforces.com/contest/14/problem/A Description A boy Bob likes to draw. ...

  5. codeforces 14A - Letter & codeforces 859B - Lazy Security Guard - [周赛水题]

    就像title说的,是昨天(2017/9/17)周赛的两道水题…… 题目链接:http://codeforces.com/problemset/problem/14/A time limit per ...

  6. Codeforces Round #353 (Div. 2) A. Infinite Sequence 水题

    A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/675/problem/A Description Vasya likes e ...

  7. Codeforces Round #367 (Div. 2) A. Beru-taxi (水题)

    Beru-taxi 题目链接: http://codeforces.com/contest/706/problem/A Description Vasiliy lives at point (a, b ...

  8. Codeforces Round #146 (Div. 1) A. LCM Challenge 水题

    A. LCM Challenge 题目连接: http://www.codeforces.com/contest/235/problem/A Description Some days ago, I ...

  9. Codeforces Round #335 (Div. 2) B. Testing Robots 水题

    B. Testing Robots Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://www.codeforces.com/contest/606 ...

随机推荐

  1. Python 双向队列Deque、单向队列Queue 模块使用详解

    Python 双向队列Deque 模块使用详解 创建双向队列Deque序列 双向队列Deque提供了类似list的操作方法: #!/usr/bin/python3 import collections ...

  2. HTTP API 自动化测试从手工测试到平台的演变

    不管是 Web 系统,还是移动 APP,前后端逻辑的分离设计已经是常态化,相互之间通过 API 调用进行数据交互.在基于 API 约定的开发模式下,如何加速请求 / 响应的 API 测试,让研发人员及 ...

  3. Vim command handbook

    /* 本篇文章已经默认你通过了vimtuor训练并能熟练使用大部分命令.此篇文章主要是对于tutor命令的总结和梳理.适合边学习边记忆 tutor那个完全是在学习中记忆 符合认知规律但是练习有限.所以 ...

  4. 弹飞绵羊(bzoj 2002)

    Description 某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏.游戏一开始,Lostmonkey在地上沿着一条直线摆上n个装置,每个装置 ...

  5. make only output error/warning message( 编译时,只输出错误信息和警告信息)

    make > /dev/null 这样,正常的信息被重定向输出到/dev/null,错误和警告信息会输出到标准错误设备(standard error,相对于标准输入/输出设备来说).

  6. Codeforces 549C The Game Of Parity【博弈】

    C语言纠错大赛的一道题,正好拿来补博弈~~ 给的代码写的略奇葩..不过还是直接在上面改了.. 题目链接: http://codeforces.com/problemset/problem/549/C ...

  7. HashMap排序的问题

    那么已知一个HashMap<Integer,User>集合, User有name(String)和 age(int)属性.请写一个方法实现对HashMap 的排序功能,该方法接收 Hash ...

  8. Spring Data JPA 进阶

    Java持久化查询语言概述 Java持久化查询语言(JPQL)是一种可移植的查询语言,旨在以面向对象表达式语言的表达式,将SQL语法和简单查询语义绑定在一起,使用这种语言编写的查询是可移植的,可以被编 ...

  9. Spring中使用Log4j记录日志

    以下内容引用自http://wiki.jikexueyuan.com/project/spring/logging-with-log4j.html: 例子: pom.xml: <project ...

  10. mysql资料整理

    ###SQL的语言分类 1.DQL(Data Query Language):数据查询语言 select 2.DML(Data Manipulate Language):数据操作语言 insert . ...