Aizu 2309 Sleeping Time DFS】的更多相关文章

Sleeping Time Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93265#problem/B Description Miki is a high school student. She has a part time job, so she cannot take enough sleep on weekdays. She wants…
Rabbit Party Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93265#problem/G Description A rabbit Taro decided to hold a party and invite some friends as guests. He has n rabbit friends, and m pairs o…
根据概率公式dfs即可,判断和区间[T-E,T+E]是否有交,控制层数. #include<bits/stdc++.h> using namespace std; int K,R,L; double P,E,T; double Lt,Rt; ) { ; ; ; .:.; -P:P; )*p + dfs(H,R,k+)*(.-p); } //#define LOCAL int main() { #ifdef LOCAL freopen("in.txt","r&quo…
原题链接:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2300 题意: 给你一个图,让你生成一个完全子图.使得这个子图中每个点的最小边的和最大..好拗口,但是就是这么回事.. 题解: 就直接dfs就好,搜啊搜啊,就做出来了. 代码: #include<iostream> #include<cstring> #include<algorithm> #include<cstdio> #defi…
G. Rabbit Party Time Limit: 5000ms Case Time Limit: 5000ms Memory Limit: 65536KB 64-bit integer IO format: %lld      Java class name: Main Submit Status pid=39423" class="goprob button ui-button ui-widget ui-state-default ui-corner-all ui-button…
On or Off Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93265#problem/C Description Saving electricity is very important! You are in the office represented as R \times C grid that consists of walls…
日文题面...题意:是把一连串的有编号的球往左或者往右边放.问能不能两边都升序. 记录左边和右边最上面的球编号大小,没有就-1,dfs往能放的上面放. #include<bits/stdc++.h> using namespace std; inline int read() { '); ret = c-'; + c-'; return ret; } int reads() { '); bool Sign = c == '-'; ret = Sign?:c-'; + c-'; return S…
F. Beautiful Currency Time Limit: 5000ms Case Time Limit: 5000ms Memory Limit: 65536KB 64-bit integer IO format: %lld      Java class name: Main cid=6641#" class="submitprob button ui-button ui-widget ui-state-default ui-corner-all ui-button-tex…
-->Osenbei 直接写中文了 Descriptions: 给出n行m列的0.1矩阵,每次操作可以将任意一行或一列反转,即这一行或一列中0变为1,1变为0.问通过任意多次这样的变换,最多可以使矩阵中有多少个1. Sample Input 2 5 0 1 0 1 0 1 0 0 0 1 3 6 1 0 0 0 1 0 1 1 1 0 1 0 1 0 1 1 0 1 0 0 Sample Output 9 15   题目链接: https://vjudge.net/problem/Aizu-05…
传送门 题目描述: 为了宣传信息竞赛,要在长方形的三合板上喷油漆来制作招牌. 三合板上不需要涂色的部分预先贴好了护板. 被护板隔开的区域要涂上不同的颜色,比如上图就应该涂上5种颜色. 请编写一个程序计算涂色数量,输入数据中,保证看板不会被护板全部遮住,并且护板的边一定是水平或垂直的. Input 第一个数是宽w( ≤ w ≤ ): 第二个数是高h( ≤ h ≤ ). 第二行是护板的数量n( ≤ n ≤ ): 接着n行是每个护板的左下角坐标 (x1 , y1 )和右上角坐标 (x2 , y2 ),…