随笔分类 -  模拟退火

摘要:"Gym 215177D 母亲节的礼物" Problem : 给n个点m条边的无向图,每个点的度数小于等于7,要求用4种不同的颜色给每个点染色,使得每个点相邻的点中最多只有一个相同颜色的点。(n include include include include include include incl 阅读全文
posted @ 2017-08-16 19:22 rpSebastian 阅读(134) 评论(0) 推荐(0)
摘要:题目大意 给一张n个点的无向图,要求给每个点染色0或1,使得每个点的相邻相同颜色点的数量小于等于其度数的一半。 解题分析 没想到什么好的算法,就随机乱搞了。 若某个状态时,一个点的度数为cnt,相邻相同颜色点的数量为x。 定义delta = cnt / 2 - x; 若delta>=0,说明这是一个 阅读全文
posted @ 2016-08-25 15:13 rpSebastian 阅读(199) 评论(0) 推荐(0)
摘要:uses math;const maxn=105; INF=2000000000;var n,m,i,x,y,sum,ans,delta:longint; map:array[0..maxn,0..maxn] of longint; flag:array[0..maxn] of... 阅读全文
posted @ 2015-03-30 14:39 rpSebastian 阅读(234) 评论(0) 推荐(0)