随笔分类 - Codeforces
摘要:知识点 最大独立集(set) = 补图的最大团(clique ) 最小顶点覆盖 + 最大独立集 = V E. Helping Hiasat time limit per test 2 seconds memory limit per test 256 megabytes input standard
阅读全文
摘要:http://codeforces.com/gym/102058/problem/F 题意:平面上n个点 两个人轮流在任意两个点之间连一条线但是不能和已有的线相交,先围成一个凸多边形的获胜,先手赢还是后手赢。 解析: 当一个顶点连了两条边,那么就可以再画一笔组成三角形, 三个点 先手胜 四个点 先手
阅读全文
摘要:G. List Of Integers time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output G. List Of Integers
阅读全文
摘要:D. Valid BFS? time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D. Valid BFS? time limit p
阅读全文
摘要:B. Nastya Studies Informatics time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. Nastya S
阅读全文
摘要:C. Bracket Sequences Concatenation Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outp
阅读全文
摘要:C. Useful Decomposition time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Useful Decompo
阅读全文
摘要:C. Kuro and Walking Route time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Kuro and Wa
阅读全文
摘要:http://codeforces.com/gym/100801 题目大意:有从左到右有n个车站,有n-1种车票,第i种车票一次最多可以坐 i 站(1<=i<=n) 每种票有固定的价钱p[i],下车后可以继续上车,但每次下车都要再上车都要花费一定时间v[i],第1和n站上车不花费时间,车从一站到相邻
阅读全文
摘要:http://codeforces.com/gym/100495 K题 草地的面积减去相交的面积,计算几何,垃圾题,避免不必要的计算损失精度(能约分的约分) 卡了老子一个星期了 再加前几天的一道题 这一星期真的是难受 什么都没干 AC代码 1 #include <stdio.h> 2 #includ
阅读全文
摘要:C. Journey time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output C. Journey time limit per tes
阅读全文
摘要:L. Knights without Fear and Reproach time limit per test 2.0 s memory limit per test 256 MB input standard input output standard output L. Knights wit
阅读全文
摘要:B. Jamie and Binary Sequence (changed after round) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output stand
阅读全文
摘要:D. Timetable time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D. Timetable time limit per
阅读全文
摘要:题目链接 http://codeforces.com/gym/101572 题意 一共n个文件 存在依赖关系 根据给出的依赖关系 判断是否存在循环依赖 ,不存在的话输出SHIP IT,存在的话,打印最小的环,若有多个,输出其中任何一个。 解析 这道题其实很简单,最小的环无非就是自己到自己的最短路,直
阅读全文
摘要:A题 直接把问号全部变为陆地如果所有陆地连通 那么再逐个把刚才变成陆地的问号变为水如果依旧连通有多种解 为什么我的代码跑不过去,和网上的题解思路一模一样!!?? #include<cstdio> #include<algorithm> #include<cstring> #include<iostr
阅读全文
摘要:A题 先求出来这个数是第几大 阶乘求概率p 然后计算获得胜率的概率 常规解法把所有情况考虑一遍(跳1次,2次,3次……)要用到组合数 数可能太大了会爆的行不通 我们观察发现它有递推性质,从第二大开始获胜概率为Q1=p(直接跳到第一大)从第三大开始获胜概率为Q2=p*Q1(先跳到第二大)+p(直接跳到
阅读全文
摘要:http://codeforces.com/gym/100735 D题 直接暴力枚举 感觉这道题数据有点问题 为什么要先排下序才能过?不懂。。 #include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #
阅读全文
摘要:二进制转十进制 然后按位比较 传送门 http://codeforces.com/gym/101063
阅读全文
摘要:1.每一个合数都可以由若干个素数相乘而得到 2.质因数知识 :求一个数因数的个数等于它的每个质因数的次数加一的和相乘的积因为质因数可以不用,所以要加一.例如6=2x3,两个质因数都是一次,如果两个质因数都不用,它的一个因数是1;只用因数2,它的第二个因数就是2;只用因数3,它的第三个因数就是3;两个
阅读全文

浙公网安备 33010602011771号