#define HAVE_STRUCT_TIMESPEC
#include<bits/stdc++.h>
using namespace std;
int a[27],b[27];
int vis[9][9];
int dis[9];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n,m;
cin>>n>>m;
for(int i=1;i<=m;++i)
cin>>a[i]>>b[i];
if(!m)//点数不为7时,可以建立一张完全图
cout<<0;
else if(n<7)//点数不为7时,可以建立一张完全图
cout<<m;
else{//对于点数为7的情况,可以两个点共用一种点数的牌,所以导致不能猜结论
int ans=0;
for(dis[1]=1;dis[1]<=6;++dis[1])
for(dis[2]=1;dis[2]<=6;++dis[2])
for(dis[3]=1;dis[3]<=6;++dis[3])
for(dis[4]=1;dis[4]<=6;++dis[4])
for(dis[5]=1;dis[5]<=6;++dis[5])
for(dis[6]=1;dis[6]<=6;++dis[6])
for(dis[7]=1;dis[7]<=6;++dis[7]){
memset(vis,0,sizeof(vis));
int cnt=0;
for(int k=1;k<=m;++k){
if(!vis[dis[a[k]]][dis[b[k]]]){//直接暴力,把所有边上能放牌就放牌,记录各种不同的情况
vis[dis[a[k]]][dis[b[k]]]=1;
vis[dis[b[k]]][dis[a[k]]]=1;
++cnt;//记录牌的数量
}
}
ans=max(cnt,ans);//取所能放牌的最大值
}
cout<<ans;
}
return 0;
}

Codeforces Round #588 (Div. 2)C(思维,暴力)的更多相关文章

  1. Codeforces Round #588 (Div. 2)-E. Kamil and Making a Stream-求树上同一直径上两两节点之间gcd的和

    Codeforces Round #588 (Div. 2)-E. Kamil and Making a Stream-求树上同一直径上两两节点之间gcd的和 [Problem Description ...

  2. Codeforces Round #588 (Div. 2) C. Anadi and Domino(思维)

    链接: https://codeforces.com/contest/1230/problem/C 题意: Anadi has a set of dominoes. Every domino has ...

  3. Codeforces Round #416 (Div. 2)(A,思维题,暴力,B,思维题,暴力)

    A. Vladik and Courtesy time limit per test:2 seconds memory limit per test:256 megabytes input:stand ...

  4. Codeforces Round #588 (Div. 2) D. Marcin and Training Camp(思维)

    链接: https://codeforces.com/contest/1230/problem/D 题意: Marcin is a coach in his university. There are ...

  5. Codeforces Round #588 (Div. 2)E(DFS,思维,__gcd,树)

    #define HAVE_STRUCT_TIMESPEC#include<bits/stdc++.h>using namespace std;long long a[100007];vec ...

  6. Codeforces Round #588 (Div. 2)D(思维,多重集)

    #define HAVE_STRUCT_TIMESPEC#include<bits/stdc++.h>using namespace std;long long a[7007],b[700 ...

  7. Codeforces Round #307 (Div. 2) B. ZgukistringZ 暴力

    B. ZgukistringZ Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/551/probl ...

  8. Codeforces Round #328 (Div. 2) A. PawnChess 暴力

    A. PawnChess Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/592/problem/ ...

  9. Codeforces Round #404 (Div. 2)(A.水,暴力,B,排序,贪心)

    A. Anton and Polyhedrons time limit per test:2 seconds memory limit per test:256 megabytes input:sta ...

随机推荐

  1. winform BackgroundWorker 的用法 - 异步执行

    1.设置 backgroundWorker1.WorkerReportsProgress = true; backgroundWorker1.WorkerSupportsCancellation = ...

  2. Vue-路由跳转的几种方式和路由重定向

    一.标签路由 router-link 注意:router-link中链接如果是'/'开始就是从根路由开始,如果开始不带'/',则从当前路由开始. 1.不传参 <router-link :to=& ...

  3. vtk学习记录(一)——vtk工程配置与生成

    前言 图形图像这块儿,最近因为工作需要接触的相对多了点儿,精力基本上也都投入了这块儿,搞的天天要死要活,毕竟我一个.net的突然来到cxx的世界,也是很苦恼的,也是头一次见到新建工程就需要配置并且解决 ...

  4. Vue - 如何使用npm run build后的dist文件夹

    脚手架vue cli生成项目后,使用 npm run build 生成了一个dist文件夹(应该是distribution的缩写) 只要放在http服务器上就可以运行. 使用一句python命令可以搭 ...

  5. django urls.py 中的name 使用方法

    使用场景: 当我们在url的时候,一般情况下都是使用很明确的url地址.如在网页里面使用<a href="/login">登录</a>.像这样的链接有很 多 ...

  6. JAVA 爬虫框架webmagic 初步使用Demo

    一想到做爬虫大家第一个想到的语言一定是python,毕竟python比方便,而且最近也非常的火爆,但是python有一个全局锁的概念新能有瓶颈,所以用java还是比较牛逼的, webmagic 官网 ...

  7. Bugku-CTF加密篇之这不是md5(666c61677b616537333538376261353662616566357d)

    这不是md5 666c61677b616537333538376261353662616566357d  

  8. [C/C++] 只允许程序运行一个实例

    原理是创建一个内核对象之后 如果再创建一个同名的对象 就会给代码中的GetLastError函数对应的变量修改为 ERROR_ALREADY_EXISTS (但是不影响"创建"对象 ...

  9. Android9 http网络请求的问题

    Google表示,为保证用户数据和设备的安全,针对下一代 Android 系统(Android P) 的应用程序,将要求默认使用加密连接,这意味着 Android P 将禁止 App 使用所有未加密的 ...

  10. 安卓开发:初步了解布局文件layout

    了解完项目的目录结构,主要文件的作用之后. 了解完各常量文件的定义和使用之后,接下来的重头戏肯定是布局文件layout. 果然,网上关于“安卓布局文件layout”的各种介绍.解析.深入分析,等等资料 ...