ACM 的一道题提交总是Time Limit Exceeded,求救
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/09/21 20:33:48
ACM 的一道题提交总是Time Limit Exceeded,求救
我搞了一个下午,得出的结论是本人的确是菜鸟,请各位大虾帮下忙!!!
题目:
Escape
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 15 Accepted Submission(s) : 0
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
2012 If this is the end of the world how to do? I do not know how. But now scientists have found that some stars, who can live, but some people do not fit to live some of the planet. Now scientists want your help, is to determine what all of people can live in these planets.
Input
More set of test data, the beginning of each data is n (1 <= n <= 100000), m (1 <= m <= 10) n indicate there n people on the earth, m representatives m planet, planet and people labels are from 0. Here are n lines, each line represents a suitable living conditions of people, each row has m digits, the ith digits is 1, said that a person is fit to live in the ith-planet, or is 0 for this person is not suitable for living in the ith planet.
The last line has m digits, the ith digit ai indicates the ith planet can contain ai people most..
0 <= ai <= 100000
Output
Determine whether all people can live up to these stars
If you can output YES, otherwise output NO.
Sample Input
1 1
1
1
2 2
1 0
1 0
1 1
Sample Output
YES
NO
我搞了一个下午,得出的结论是本人的确是菜鸟,请各位大虾帮下忙!!!
题目:
Escape
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 15 Accepted Submission(s) : 0
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
2012 If this is the end of the world how to do? I do not know how. But now scientists have found that some stars, who can live, but some people do not fit to live some of the planet. Now scientists want your help, is to determine what all of people can live in these planets.
Input
More set of test data, the beginning of each data is n (1 <= n <= 100000), m (1 <= m <= 10) n indicate there n people on the earth, m representatives m planet, planet and people labels are from 0. Here are n lines, each line represents a suitable living conditions of people, each row has m digits, the ith digits is 1, said that a person is fit to live in the ith-planet, or is 0 for this person is not suitable for living in the ith planet.
The last line has m digits, the ith digit ai indicates the ith planet can contain ai people most..
0 <= ai <= 100000
Output
Determine whether all people can live up to these stars
If you can output YES, otherwise output NO.
Sample Input
1 1
1
1
2 2
1 0
1 0
1 1
Sample Output
YES
NO
你是怎么做的? 二分图的多重匹配这题,如果暴力做的话会T的
代码附一个吧:
#include
#include
#include
using namespace std;
const int N=100010;
int n,m;
int cap[11],map[N][11];
int val[11],mat[11][N];
int mark[11];
bool dfs(int x)
{
for(int i=0;im)
{
memset(map,0,sizeof(map));
for(int i=0;i
代码附一个吧:
#include
#include
#include
using namespace std;
const int N=100010;
int n,m;
int cap[11],map[N][11];
int val[11],mat[11][N];
int mark[11];
bool dfs(int x)
{
for(int i=0;im)
{
memset(map,0,sizeof(map));
for(int i=0;i
ACM 的一道题提交总是Time Limit Exceeded,求救
一个很简单的ACM题,这个提交后怎么会“Time Limit Exceed”?
Time Limit Exceeded和Output Limit Exceeded有什么不同,还是一样的?
一道acm题,Problem H:Groups (I)Time Limit:1000MS Memory Limit:65
问一道acm的题,提交时老实说超时.
ACM的一道题,看着很简单,提交却WA了,
一道数学的ACM题.1514:x + 2y + 3z = nTime Limit:1000MS Memory Limit
杭电里面的Output Limit Exceeded
一道杭电ACM的测试题,我运行的没问题,但是提交却是WA,
ACM的 “顺”序列 Time Limit:1000MS Memory Limit:32768K
hdoj1032 3n+1问题 time limit exceeded
一道acm题,Delete NumberTime Limit:1000MS Memory Limit:65536KTot