http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2110 //2110 #include<stdio.h> #include<string.h> #include<math.h> #include<iostream> #include<cstdlib> using namespace std; int n, m, t, di, dj, flag; char map[10][…
狗要出门,且正好在T秒 就是DFS + 剪枝, 联系一下剪枝技巧 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef long long ll; ] = {,,,-,,,-,}; + ; char Map[maxn][maxn]; int m,n,t; int aimx,aimy; int bex,bey;…
Tempter of the Bone Time Limit: 2 Seconds Memory Limit: 65536 KB The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He rea…
Tempter of the Bone Time Limit: 2 Seconds Memory Limit: 65536 KB The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He rea…
这道题困扰我的不是算法问题.而是细节问题.不优化一直搜到底 时间是690ms左右 没有优化的dfs #include<stdio.h> #include<string.h> #include<stdlib.h> ][]; ][]; ][]={ ,,,-,,,-, }; typedef struct { int x,y; } point; point sta; int n,m; int t; int dfs( int s,int x,int y ) { int i,xx,…
https://vjudge.net/contest/67836#problem/C The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone was a t…
题目链接: 题目 Escape Time II Time Limit: 20 Sec Memory Limit: 256 MB 问题描述 There is a fire in LTR ' s home again. The fire can destroy all the things in t seconds, so LTR has to escape in t seconds. But there are some jewels in LTR ' s rooms, LTR love jewe…
Sum It Up Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 4 Accepted Submission(s) : 1 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description Given a specified total t and…
Prime Ring Problem Time Limit: 10 Seconds Memory Limit: 32768 KB A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime…
B - Benny's Compiler Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Submit Status Practice ZOJ 2475 Description These days Benny has designed a new compiler for C programming language. His compilation system provides a com…
J - Watashi's BG Time Limit:3000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3631 Appoint description: Description Watashi is the couch of ZJU-ICPC Team and he is very kind hearted. In ZJU-ICPC summer train…
题意 把一个数替换为这个数相邻数字差组成的数 知道这个数仅仅剩一位数 若最后的一位数是7 则称原来的数为 July Number 给你一个区间 求这个区间中July Number的个数 从7開始DFS 位数多的数总能由位数小的数推出 #include <bits/stdc++.h> using namespace std; const int N = 1e6; int july[N], n; set<int> ans; int pw[] = {1, 10, 100,…
ZOJ Problem Set - 1609 Equivalence Time Limit: 5 Seconds Memory Limit: 32768 KB When learning mathamatics, sometimes one may come to an theorem which goes like this: The following statements are equivalent: a)......b)......c)...... For example,…
题目传送门 题意:从炮台射出一个球,三个及以上颜色相同的会掉落,问最后会掉落多少个球 分析:先从炮台找一个连通块,然后与顶部连接的连通块都不会掉落,剩下的就是炮台射出后跟随掉落的. #include <bits/stdc++.h> const int N = 100 + 5; char str[N][N]; int H, W, h, w; int ans; bool check(int x, int y) { if (x < 1 || x > H || y < 1 || y…