A - War
来源:互联网 发布:js格式视频 编辑:程序博客网 时间:2024/04/30 18:57
A - War
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uAppoint description:
Description
War is the reciprical and violent application of force between hostile political entities aimed at bringing about a desired political end-state via armed conflict. War is an interaction in which two or more militaries have a “struggle of wills”. When qualified as a civil war, it is a dispute inherent to a given society, and its nature is in the conflict over modes of governance rather than sovereignty. War is not considered to be the same as mere occupation,murder or genocide because of the reciprical nature of the violent struggle, and the organized nature of the units involved.
War is also a cultural entity, and its practice is not linked to any single type of political organisation or society. Rather, as discussed by John Keegan in his “History Of Warfare”, war is a universal phenomenon whose form and scope is defined by the society that wages it.
Today we don't want to talk about war, rather than , I want you to tell me which year there was no war.
War is also a cultural entity, and its practice is not linked to any single type of political organisation or society. Rather, as discussed by John Keegan in his “History Of Warfare”, war is a universal phenomenon whose form and scope is defined by the society that wages it.
Today we don't want to talk about war, rather than , I want you to tell me which year there was no war.
Input
For each test case, first input one integer N(1<= N <= 100), then two integers p and q (-6000000 <= p <= q <= 6000000) represent the starting year and the ending year in this case. Followed by N wars.
Each war described as follows:
Ai Bi Ni (A,B is integer, p <= A, B <= q, Ni is a String which is the ith war's name )
Represent that the ith War took place between year A and year B.
Each war described as follows:
Ai Bi Ni (A,B is integer, p <= A, B <= q, Ni is a String which is the ith war's name )
Represent that the ith War took place between year A and year B.
Output
Output one number represent which year there was no war in the range p and q, if there are not only one year, output the maximum year which there was no war. If all the year had war, just output "Badly!".
Sample Input
3100 200100 120 RtWar110 140 WeWar141 199 QqWar 1-600 600-600 600 Cool War解答:1int q[1001],w[1001];#include<stdio.h>#include<string.h>int main(){int i,j,t,a,c,b,x;char d[1001];while(scanf("%d",&a)!=EOF){scanf("%d%d",&b,&c);for(i=0;i<a;i++){scanf("%d%d",&q[i],&w[i]);gets(d);}for(i=0;i<a;i++){for(j=0;j<i;j++)if(w[i]>w[j]){t=w[i];w[i]=w[j];w[j]=t;t=q[i];q[i]=q[j];q[j]=t;}}x=c; while(x>=c) { if(x>w[j]) {printf("%d\n",x);break;} else x=q[j]-1; } if(x<c) printf("Badly!\n"); } return 0;}
0 0
- A - War
- A War of Scheme Selection
- HDU 2435 There is a war
- Sicily 1906. There is a war
- HDU 2435 - There is a war
- War
- .war
- .war
- War
- war
- hdu 2435 There is a war 最小割-带加边条件
- HDOJ 2435 - There is a war 枚举+最小割
- hdu 2435 There is a war 最小割
- There is a war (hdu 2435 最小割+枚举)
- HDU 2435 There is a war Dinic 最小割
- war exploded' because it is included into a circular dependency
- exploded war VS war
- Allow a different JSF implementation to be packaged in the WAR
- Sikuli和Robot framework的结合
- solr的安装与配置
- 第五章 习题(一)
- 深入理解JVM—性能调优
- Socket通讯工具类【SocketTools】
- A - War
- 获取相机、麦克风、通讯录权限,确认是否拥有这些权限
- android canvas drawText 使用说明
- Xdebug 配置 php 调试器
- stringstream的用法
- Windows Server 2003 共享文件夹权限设置
- App Icons on iPad and iPhone
- ListView中的手势问题
- JSONObject与JSONArray的使用