zoukankan      html  css  js  c++  java
  • 【CF1068C】Colored Rooks(构造)

    题意:

    思路:

     1 #include<cstdio>
     2 #include<cstring>
     3 #include<string>
     4 #include<cmath>
     5 #include<iostream>
     6 #include<algorithm>
     7 #include<map>
     8 #include<set>
     9 #include<queue>
    10 #include<vector>
    11 using namespace std;
    12 typedef long long ll;
    13 typedef unsigned int uint;
    14 typedef unsigned long long ull;
    15 typedef pair<int,int> PII;
    16 typedef vector<int> VI;
    17 #define fi first
    18 #define se second 
    19 #define MP make_pair
    20 #define N  1100
    21 #define M  1100
    22 #define MOD 2147493647
    23 #define eps 1e-8 
    24 #define pi acos(-1)
    25 
    26 int c[N][N];
    27 
    28 int main()
    29 {
    30 //    freopen("C.in","r",stdin);
    31 //    freopen("C.out","w",stdout); 
    32     int n,m;
    33     scanf("%d%d",&n,&m);
    34       for(int i=1;i<=n;i++) c[i][++c[i][0]]=i;
    35       for(int i=1;i<=m;i++)
    36       {
    37           int x,y;
    38           scanf("%d%d",&x,&y);
    39           c[x][++c[x][0]]=x*1000+y;
    40           c[y][++c[y][0]]=x*1000+y;
    41     }
    42     for(int i=1;i<=n;i++)
    43     {
    44         printf("%d
    ",c[i][0]);
    45         for(int j=1;j<=c[i][0];j++) printf("%d %d
    ",i,c[i][j]);
    46     }
    47     return 0;
    48 }
  • 相关阅读:
    Light OJ 1067 Combinations (乘法逆元)
    hdu1172猜数字(暴力枚举)
    hdu 2266 How Many Equations Can You Find(DFS)
    项目之问卷调查问题
    Django之Modelform组件
    GIT
    form组件的总结
    总结django知识点
    djang-分页
    Django-Ajax
  • 原文地址:https://www.cnblogs.com/myx12345/p/9850705.html
Copyright © 2011-2022 走看看