- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
1、可否简单图画的判定(1, can a simple picture of the decision)
1、可否简单图画的判定(1, can a simple picture of the decision)
I wipe it... Finally, AC, has been stuck in the last two test cases, but also can not think of what can be used to test examples, it is not reported, hoping to find an example from the book, the results... 443322 is the simple graph, and my output is no, then by hand, suddenly feel that it is not a cycle to re sort, it really is.... To be crazy, I think so many special use cases, the teachers use case is really weak burst!!!
#include stdlib.h
#include stdio.h
Int comp (const, void, *a, const, void, *b)
{
Return * (int *) a * (int *) b;
}
Int, main ()
{
Int, N, d[3000], I, J, end = 0, total = 0, max = 0;
Scanf (%d, N);
For (I = 0; I N; i++)
{
Scanf (%d, d[i]);
Total = total + d[i];
If (d[i] max)
Max = d[i];
}
If (N = 1 and d[0] = = 0)
Printf (yes\n);
Else if (N = = 1 d[0]! = 0)
Printf (no\n);
Else if (total = 0 ||% 2! Max N - 1) / / without this step before judgment, all kinds of WA and RE
Printf (no\n);
Else
{
For (I = N - 1; I 0; i--)
{
Qsort (D, i+1, sizeof (d[0]), COMP); / / is here!!! Damn it!
For (J = I - 1; J i-1-d[i]; j--)
{
If (J 0)
{
End = 1;
Break;
}
D[j]--;
If (d[j] 0)
{
End = 1;
Break;
}
}
If (end = 1)
Break;
}
If (end = 1)
Printf (no\n);
Else if (end = = 0 d[0]! = 0)
Printf (no\n);
Else
Printf (yes\n);
}
Return 0;
}
#include stdlib.h
#include stdio.h
Int comp (const, void, *a, const, void, *b)
{
Return * (int *) a * (int *) b;
}
Int, main ()
{
Int, N, d[3000], I, J, end = 0, total = 0, max = 0;
Scanf (%d, N);
For (I = 0; I N; i++)
{
Scanf (%d, d[i]);
Total = total + d[i];
If (d[i] max)
Max = d[i];
}
If (N = 1 and d[0] = = 0) / / before, here is a bug, but the teachers case is really suck, after two or anyway but actually have nothing to do with this.
Printf (yes\n);
Else if (N = = 1 d[0]! = 0)
Printf (no\n);
Else if (! (total% 2 = = 0 Max = N - 1)) / / without this step before judgment, all kinds of WA and RE
Printf (no\n);
Else
{
Qsort (D, N, sizeof (d[0]), comp);
For (I = N - 1; I
您可能关注的文档
- 12星座的绝配与惨配(The 12 constellations of the match and match.).doc
- 12星座绝配与惨配(12 constellations and match with.).doc
- 12秋远程方法导论作业一(12 autumn remote method introduction homework one).doc
- 12条标准判定穷富 整天工作的人当不了富翁(The 12 criterion is that poor people who work all day long can't be millionaires).doc
- 13-新课标七年级历史上期末试卷(13- new curriculum, grade seven, history, final exam).doc
- 13春《中外文化交流史》作业3(13 spring history of cultural exchanges between China and foreign countries homework 3).doc
- 13春福师《物流管理概论》在线作业一答案(13 spring Fu division Introduction to logistics management online homework an answer).doc
- 15应付职工薪酬(15 salary payable).doc
- 15分钟,2010年考研英语新题型(阅读b)速战速决(15 minutes, 2010 English (reading b) a new type).doc
- 17《木天禁语》(元)范德机著(17 days wood Taboo (yuan) with Deji fan).doc
- 1艺术摄影的发展(1 the development of art photography).doc
- 200-分会场展示活动安排表(200- venue exhibition schedule).doc
- 2001年10月自考经济法概论试题(含有答案)(An introduction to the economic law in October 2001 (containing answers)).doc
- 2001年(下)电子商务概论试题(2001 (next issue) introduction to e-commerce).doc
- 2001年国际大专辩论会半决赛辩论词(Debate at the 2001 International Collegiate debate).doc
- 2005-2007年江苏高考生物试卷分析(Biological examination paper analysis of Jiangsu college entrance examination for 2005-2007 years).doc
- 2003年10月自考全国卷《民事诉讼法》试题及答案(In October 2003, from the national volume Civil Procedure Law questions and answers).doc
- 2005年元月四川省青神县八年级历史期末试卷(2005 January Qingshen County of Sichuan Province eight grade history final papers).doc
- 2006企业年度检验办法(2006 annual inspection methods for enterprises).doc
- 2004年度北京高新技术产业重点发展领域人才开发目录(Catalogue of talent development in key development areas of Beijing hi tech industry in 2004).doc
文档评论(0)