zoukankan      html  css  js  c++  java
  • mode-c++

    /*感谢机房JYW的友情馈赠*/
    #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <vector>
    #include <set>
    #include <queue> #define Orz __attribute__((optimize("-O2"))) #define lx 2000 using namespace std;  vector<int>::iterator it;  vector<int> a[100010];
    struct edge{ int u,v,next; }eg[maxm]; int f[5][5]={{0,3,2,3,2},{3,2,1,2,3},{2,1,4,3,2},{3,2,3,2,3},{2,3,2,3,4}}; int mm(int a,int b, int &c){ return 0; } int main(){ freopen("stdin.in","r",stdin); freopen("stdout.out","w",stdout); //文件输入输出 int cas,n; scanf("%d",&cas); while (cas--){ } //处理多组数据 char vac[lx][lx]; scanf("%d",&n); scanf("%c",&vac[0][0]); for (int i=1;i<=n;i++) scanf("%s",vac[i] + 1);//读入字符串 int k[lx]; scanf("%d",&n); for (int i=1;i<=n;i++) scanf("%d",k+i); sort(k+1,k+n+1); //从1到n默认从小到大排序 fclose(stdin); fclose(stdout); exit(0); //退出整个程序,fclose可不写 int a=0,b; b=a++; printf("a=%d b=%d ",a,b); b=++a; printf("a=%d b=%d ",a,b); //前者是先赋值后加,后者先加后赋值 int p; scanf("%d",&p); switch (p){ case 0: case 1: case 2:printf("Orz Jry "); break; case 3:printf("Orz Jc "); break; case 4: case 5:printf("Orz Dzy "); break; } //相当于case,但是单独一个case:右边一定要加break,不然会执行其他case   int n;   scanf("%d",&n);   for (int i=1;i<=n;i++)   {     int x;     scanf("%d",&x);     a[0].push_back(x);   }   for (it=a[0].begin();it!=a[0].end();it++)   cout<<*it<<" "; return 0; queue<int> Q; //定义队列Q,定义时会初始化的 while(!Q.empty()) Q.pop(); //清空队列 Q.push(1); //1入队 Q.pop(); //队首元素出队 int v=Q.front(); //赋值Q的队首元素给v int s=Q.size(); //返回队列大小 set<int> S; S.insert(3); //插入3,元素不会重复 S.insert(9); S.insert(10); S.erase(S.find(10)); //删除10 for(set<int>::iterator i=S.begin();i!=S.end();++i) printf("%d ",*i); //从小到大输出 printf(" "); }
  • 相关阅读:
    Kafka 生产者 自定义分区策略
    同步互斥
    poj 1562 Oil Deposits(dfs)
    poj 2386 Lake Counting(dfs)
    poj 1915 KnightMoves(bfs)
    poj 1664 放苹果(dfs)
    poj 1543 Perfect Cubes (暴搜)
    poj 1166 The Clocks (暴搜)
    poj 3126 Prime Path(bfs)
    处理机调度
  • 原文地址:https://www.cnblogs.com/rpSebastian/p/4178874.html
Copyright © 2011-2022 走看看