有的https traffic为什么没有client key exchange 10C

我有一个HTTPS的server,但是不知道为什么有的时候TLS握手能成功,有的不行。
对成功和失败的情况我分别抓了包:
1. yahoo_failed.pcap
这个是访问yahoo失败的情况,客户端在收到**server hello**之后就把socket关掉了。起初我以为是client和server的加密方式不匹配,但是看了一下server端提供了**TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384(0xc030) **加密方式,client端也支持,这下就不知道是怎么回事了。
还有一点比较奇怪的地方是,在client hello里面,外层显示的TLS版本号是1.0,内层却写的是1.2。但是这个应该不是原因,因为成功的包里面也是这样的。

  1. bing_success.pcap 这个是访问bing成功的情况,可以看到客户端收到server hello之后发出了client key exchange,然后tls握手成功了。

两个pcap文件是用google drive共享的,如果你能回答这个问题,相信获得这两个文件难不倒你。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
OPENSSL研究,Client Key Exchange的疑问
按照原理是:客户端生成随机 pre master secret,用服务器送过来的公钥加密,然后rn用 Client Key Exchange发给服务器。rnrn跟踪openssl,过程发现一个问题:rnrn下面是ssl的ssl3_send_client_key_exchange函数的一个节选:rnrn /* Fix buf for TLS and beyond */rn if (s->version > SSL3_VERSION)rn p+=2;rn //pre master cecret 存在变量tmp_buf里rn //把pre master secret 加密结果,存在缓冲区p里rn //问题:这个p再也没有用过,并且网络抓包发现的数据和这个p里的数据完全无关rn //而理论上应该把p里的数据发出去的rn n=RSA_public_encrypt(sizeof tmp_buf, tmp_buf,p,rsa,RSA_PKCS1_PADDING);rn#ifdef PKCS1_CHECKrn if (s->options & SSL_OP_PKCS1_CHECK_1) p[1]++;rn if (s->options & SSL_OP_PKCS1_CHECK_2) tmp_buf[0]=0x70;rn#endifrn if (n <= 0)rn rn SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,SSL_R_BAD_RSA_ENCRYPT);rn goto err;rn rnrn /* Fix buf for TLS and beyond */rn if (s->version > SSL3_VERSION)rn rn s2n(n,q);rn n+=2;rn rnrn s->session->master_key_length=rn s->method->ssl3_enc->generate_master_secret(s,rn s->session->master_key,rn tmp_buf,sizeof tmp_buf);rn OPENSSL_cleanse(tmp_buf,sizeof tmp_buf);rn
simple exchange platform client
a simple exchange platform client, not used. experimental product
https client demo
vc 实现的 https 的client 样例代码,里面已经带了一份open ssl 库,可直接编译运行
dbchart为什么有的有数标有的没有?
dbchart为什么有的有数标有的没有?rncxgrid 的dbchart为什么有的有数标有的没有? line diagam有的线上没有标,但鼠标放上去后会有的,而且时间段短后也会有。这是怎么回事呢?rn换成column这样式后也会有。
为什么有的打印了,有的没有打印?
我有个程序,在某个端口接受tcp请求。rnrn我用 test 2>temp.txt 执行我的程序,在程序 中,rn。。。。rnfprintf(stderr, "aaaaa");rn。。。。rnfprintf(stderr, "bbbbb");rnrn发现 "aaaaa" 打印到了temp.txt中,但是"bbbbb" 却没有打印出来,我可以肯定执行了fprintf(stderr, "bbbbb"),但为什么没有打印出来呢,这中间发生了什么?怎么去定位呢?rnrn急等!谢谢!
函数为什么有的有类型,有的没有?
函数为什么有的有类型,有的没有?rn比如:rnpublic Class1()rn rn //rn // TODO: 在此处添加构造函数逻辑rn //rn rn这个函数直接写函数名称,而下面这个则有函数类型,好像一般的变量一样,有函数类型?rnpublic SqlConnection GetConnection()//检查连接的属性rn if(SqlS.State.ToString()=="Closed")//若尚未打开rn SqlS=new SqlConnection();rn SqlS.ConnectionString="data source=Localhost;" + rn "initial catalog=SampleDataBible;user id=sa;pwd=7758521";rn SqlS.Open();rn rn return SqlS;//返回rn rn请问,这两种函数都是函数吗?除了第二个有返回值外,是否第一个就像VB中的过程,而第二个像VB中的函数一样呢?rn另外,函数和方法有和区别?
为什么有的数据库有代码提示,有的没有?
我用本地的sql server management studio连接一个数据库时,写代码有提示,能把表名,字段名自动带出来rn连接另一个数据库时,没有提示。rn请问这个是在哪里设置的?rn谢谢
Vsphere Client 5.1 key
ESXi 5 Desktop Host(12 core) key,在Vsphere Client 5.1中文版里亲测可用,在5.0的版本中好像也可以用,但我没有测试。如果真需要使用Vmware产品的话,还是购买正版吧,只供学习一下用用。 注册方法: 主页-清单-清单 做左侧选择ESXi主机,右侧“配置”,点击“已获许可的功能” 然后编辑即可
https协议key
https协议key,java免费生成的https协议key 可直接使用
https三个key的作用
  正规的做法是:到国际知名的证书颁发机构,如GlobalSign申请一本服务器证书,比如百度的首页,点击小锁的图标,可以看到百度是通过GlobalSign认证颁发的服务器证书:   我们用的操作系统(windows, linux, unix ,android, ios等)都预置了很多信任的根证书,比如我的windows中就包含GlobalSign的根证书,那么浏览器访问服务器比如www...
为什么有的网站没有后缀?
例如:https://forum.csdn.net/[color=#FF0000]PointForum/Forum[/color]/PostTopic.aspx?rn为什么PointForum/Forum没有后缀,如:forum.aspxrnrn
为什么有的activity标题栏有的默认有icon,有的没有?
下图,一个是AS下的,一个是Eclipse下的。rnEclipse有iconrn public class MainActivity extends Activity rnAS下没有iconrn public class MainActivity extends AppCompatActivityrn[color=#FF0000]难不成是AppCompatActivity导致的?[/color]rn[img=https://img-bbs.csdn.net/upload/201602/22/1456113116_431306.png][/img]
Client使用https访问CAS
单点登录系统是互联网企业常见的session共享方案,主流的方案有两种:同域名基于cookie的实现以及架设CAS服务器,这两种方案都会在视频中分享给大家。
为什么没有"Press any key to continue"的提示?
我做完了一个C++的工程,可以正常运行.但运行完后没有"Press any key to continue"的提示,而且每次运行完后都要重新输入法名称才可以运行.这是为什么呢?
为什么Request.ServerVariables key中没有["HTTP_X_FORWARDED_FOR"]
我想获取客户端代理ip,网上说用Request.ServerVariables["HTTP_X_FORWARDED_FOR"]rn但是我始终返回null,我跟进去一看Request.ServerVariables key中"HTTP_X_FORWARDED_FOR",为什么?
为什么TreeView 在。net中没有Key关键字。
为什么TreeView 在。net中没有Key关键字。rn我想定位某个node真的不容易rn
为什么有的表在sysobjects中没有
有的表的信息在sysobjects中没有,这是为什么?rn有知道的帮帮忙。多谢。rn[img=https://img-bbs.csdn.net/upload/201311/29/1385694812_497967.png][/img]
为什么有的站点越来越没有人气?
&amp;#13; 偶尔去 Linuxforum 看了看,一片荒凉。想想前几年,Linuxforum 可以说是一些 Linux 爱好者相当喜欢的站点阿。可是几年过去了,不进则退。作为早期的论坛+门户齐全的技术站,在Linux刚在中国引起人注意的时候,的确引起很多人的注意。但是眼看着别的技术站点都在做着“丰富门户,加强论坛功能”这样的动作的时候,Linuxforum 居然无动于衷。看看...
为什么有的工程没有MainFrm.h 和 MainFrm.cpp文件?
我从网上下了一些别人的代码,看到有的工程没有MainFrm.h 和 MainFrm.cpp文件,而我从vc里创建的工程总是有MainFrm文件,请问这是怎么回事?
为什么有的符号用css没有效果?
为什么有的符号用css没有效果?rnrn比如竖线“|”,我对其用fontfont-size:12px;color:#000000;line-height:140%;,什么变化都没有,而对文字使用就有效果。
为什么有的类没有增加虚函数的选项
如题,为什么有的类右键的时候没有增加虚函数的选项,什么样的能增加 什么样的不能呢
为什么有的控件没有控件ID
用SPY++查看,有的控件ID为0rn这是怎么回事?rn是如何实现的?
为什么有的时候session会没有呢
session.asp ——rn<%rnuid=session("uid")rnusername=session("username")rnpagesize=session("pagesize")rnpopedom=session("popedom")rnidiograph=session("idiograph")rnby1=session("by1")rnbbscss=session("bbscss")rnif uid="" or username="" thenrn Response.redirect "index.asp"rnend ifrn%>rnrn然后在其他网页调用rnrnrn可是有的时候明明登陆了,却uid="" or username="" rn有的时候却是好的rn怎么回事啊
JQuery中 属性选择器为什么有的有@有的没有呢?
我在网上看到有的属性选择器有@的有的没有?rnrn$('div[@id^="ABC"]');rnrn$('div[class*="ABC"]').css("border-top","3px solid red");
Opengl 光照 为什么有的物体有光照,有的没有呢?
[img=http://hi.csdn.net/attachment/200911/10/25622_1257823598vd57.jpg][/img]rnrn为什么我的光照效果是这样的呀。rn rn绘制函数如下:rnvoid CScan3DDoc::Draw()rnrn glPushMatrix();rn glTranslatef(m_pView->light_position[0],m_pView->light_position[1],m_pView->light_position[2] );rn glutSolidTeapot(5);rn rn glutSolidTorus(10.0,15.0,50,50);rn glutSolidTeapot(5);rn glTranslatef(0.0,15.0,25.0);rn glutSolidTeapot(8); rn glutSolidSphere(20.0,50,50);rn glPopMatrix();rnrnrn glutSolidTeapot(30.0);rnrnrnrn//---------光照---------------rnrnvoid CScan3DView::glEnableLight()rnrn/**/rn GLfloat global_ambient[]=1.0f,1.0f,1.0f,1.0f;rn GLfloat light0_position[]=0.0f,10.0f,-50.0f,1.0f;rn GLfloat white_light[]=1.0,0.5,0.3,1.0;rn GLfloat lmodel_ambient[]=0.1,0.1,0.1,1.0;rn GLfloat spot_direction[]=0.0,0.0,50.0,1.0;rnrnrn light_position[0]=light0_position[0];rn light_position[1]=light0_position[1];rn light_position[2]=light0_position[2];rnrnrn glLightfv(GL_LIGHT0,GL_AMBIENT,global_ambient);rn glLightfv(GL_LIGHT0,GL_DIFFUSE,white_light);rn glLightfv(GL_LIGHT0,GL_SPECULAR,white_light);rnrnrn glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,GL_FALSE);rn glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER,GL_TRUE);rn glLightModelfv(GL_LIGHT_MODEL_AMBIENT,lmodel_ambient);rnrn glEnable(GL_LIGHTING);rn glEnable(GL_LIGHT0);rn glDepthFunc(GL_LESS);rn glEnable(GL_DEPTH_TEST);rn rn m_bLightEnabled=TRUE;rnrn glSetMaterial();rnrnrn//--------------------------------------rnrnvoid CScan3DView::glSetMaterial()rnrn GLfloat amb_[4], dif_[4], spe_[4], shin_;rn GLfloat memi[4] = 0, 0, 0, 0;rn rn amb_[0]=0.105882f, amb_[1]=0.058824f, amb_[2]=0.113725f, amb_[3]=1.0f;rn dif_[0]=0.427451f, dif_[1]=0.470588f, dif_[2]=0.541176f, dif_[3]=1.0f;rn spe_[0]=0.333333f, spe_[1]=0.333333f, spe_[2]=0.521569f, spe_[3]=1.0f;rn shin_ =9.846150f;rn rn glMaterialfv(GL_FRONT, GL_AMBIENT, amb_); rn glMaterialfv(GL_FRONT, GL_DIFFUSE, dif_); rn glMaterialfv(GL_FRONT, GL_SPECULAR, spe_);rn glMaterialfv(GL_FRONT, GL_EMISSION, memi);rn glMaterialf(GL_FRONT, GL_SHININESS, shin_);rnrn rnrnrn同样的光照设置,同样的材质,在一个函数中绘制,为什么只有glutsolidTeapot,有光照效果呢?rnrn有没有朋友遇到过同样的情况?实在是很郁闷,期待大家的解答,不胜感激!
请问一下,为什么有的数据库有_Data,而有的没有?
请问一下,为什么有的数据库有_Data,而有的没有?rnrn我用"create database SheetMetalManagement";建立的数据库,有的生成SheetMetalManagement_Data和SheetMetalManagement_log两个文件,而有的会生成SheetMetalManagement和SheetMetalManagement_log两个文件,怎么会这样?怎么样加入参数使他们生成一样的??rn我恢复文件时"RESTORE DATABASE SheetMetalManagement from disk='D:\SheetMetalManagement.bak' WITH REPLACE, move 'SheetMetalManagement_Data' to 'D:\Program Files\Microsoft SQL Server\MSSQL\Data\SheetMetalManagement_Data.MDF', move 'SheetMetalManagement_Log' to 'D:\Program Files\Microsoft SQL Server\MSSQL\Data\SheetMetalManagement_Data.LDF';rn这时候会不产生问题?因为我不知道是写'SheetMetalManagement_Data' ,还是写'SheetMetalManagement'呢?是写 'D:\Program Files\Microsoft SQL Server\MSSQL\Data\SheetMetalManagement_Data.MDF',还是写'D:\Program Files\Microsoft SQL Server\MSSQL\Data\SheetMetalManagement.MDF'?谢谢大家了!!
为什么有的com项目有类厂,有的没有呢?
我初学com,在网上下了一些源码,可是这些源吗有的有类厂,有的没有,这是什么原因呢?rn望高手执教?rn还有是不是com提供的类不能有自己的返回值?必须是STDMETHODIMP类型?如果我想返回rn一个int可以吗?rn还有namespace 是什么意思?
为什么有的网址中有www,有的网址中就没有www?
为什么有的网址中有www,有的网址中就没有www?rn有的网址是这样的,如:rnhttp://www.csdn.netrn可是有的网址,在http://后面,没有www,如rnhttp://hao.360.cn/rnrn我不理解,为何有的网址可以没有3个w呢?rn我以前一直认为,只要是网址,一定要有www的。rn
https没有异常信息的问题
//创建http资源rn if( m_HttpConnection== NULL)rn tryrn m_InternetSession = new CInternetSession(rn (LPCTSTR)"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)", 1, rn INTERNET_OPEN_TYPE_PRECONFIG,rn //INTERNET_OPEN_TYPE_PROXY,rn NULL, /*"127.0.0.1:8080",*/ rn //"182.1.1.211:4444",rn NULL, 0);rn rn rn m_HttpConnection = m_InternetSession->GetHttpConnection(rn (LPCTSTR)setting->ServerName, rn (INTERNET_PORT )setting->ServerPort, rn NULL, rn NULL);rn //m_HttpConnection->rn catch(CInternetException *e)rn rn e->GetErrorMessage(lastErr, 256);rn e->Delete();rn return -1;rn rn rn rnrn m_httpFile = NULL;rn tryrnrn if(Verb.Compare("GET") == 0)rn rnrn m_httpFile = m_HttpConnection->OpenRequest( Verb, request,rn NULL,rn 1, NULL,rn NULL, m_Flag);rnrn int retCode ;rn retCode = m_httpFile->AddRequestHeaders("Proxy-Connection: Keep-Alive\r\n");rn retCode = m_httpFile->AddRequestHeaders("User-Agent: Mozilla/MSIE\r\n");//retCode = m_httpFile->AddRequestHeaders(_T("Host: ") + setting->ServerName + _T("\r\n"), HTTP_ADDREQ_FLAG_REPLACE);rn // CString headers = _T("Proxy-Connection"); //: Keep-Alive\r\nHost: ");rn // headers = headers; // + BOCOMServer;rnrn m_httpFile->SendRequest(); //headers, headers.GetLength());rnrn rn else //POSTrn rn //设置http参数rn char *reqData = strstr(request, "?");rn if( reqData != NULL)rn rn *reqData = 0;rn reqData++;rn rn rn m_httpFile = m_HttpConnection->OpenRequest( Verb, request,rn NULL,rn 1, NULL,rn NULL, m_Flag);rnrn int retCode;rn retCode = m_httpFile->AddRequestHeaders("Proxy-Connection: Keep-Alive\r\n");rnrn // m_httpFile->AddRequestHeaders("Content-Type: application/x-www-form-urlencoded\r\n");rn // retCode = m_httpFile->AddRequestHeaders("Accept: */*");rn rn m_httpFile->AddRequestHeaders("Content-Type: html/text\r\n");rn CString s;rn s += _T("Host: ") + setting->ServerName + _T("\r\n");rn Log("https发送数据:", "s:", (LPSTR)(LPCTSTR)s);rn retCode = m_httpFile->AddRequestHeaders(s, HTTP_ADDREQ_FLAG_REPLACE);rn rn m_httpFile->SendRequestEx(strlen(reqData));rn Log("https发送数据:", "通讯1:", "通讯1:");rn m_httpFile->Write(reqData, strlen(reqData)); //发送数据rn Log("https发送数据:", "通讯3:", "通讯3:");rn m_httpFile->EndRequest(); //通讯结束rn Log("https发送数据:", "通讯4:", "通讯4:");rnrn rnrn代码如上报异常了我用rn catch(CInternetException *e)rn rn if(m_httpFile != NULL) rn m_httpFile->Close();rn char errors[2048];rn memset(errors, 0, sizeof(errors));rn e->GetErrorMessage(errors, 4086);rnrn Log("https错误:", "通讯返回2:", errors);rn throw e;rn rn捕获异常但是 没有任何日异常信息, 代码是在这里异常的retCode = m_httpFile->AddRequestHeaders(s, HTTP_ADDREQ_FLAG_REPLACE);rnm_httpFile->SendRequestEx(strlen(reqData));rn为什么没有异常信息,怎么拿到异常信息啊,在WIN8 IIS7.5运行的
获取JSON中所有的KEY
采用递归的方式,遍历JSON中所有的KEY。JSON格式如下:{&quot;username&quot;:&quot;tom&quot;,&quot;age&quot;:18,&quot;address&quot;:[{&quot;province&quot;:&quot;上海市&quot;},{&quot;city&quot;:&quot;上海市&quot;},{&quot;disrtict&quot;:&quot;静安区&quot;}]}处理后,得到的结果如下:address|province|city
图说Kepserver_Data Exchange Client配置说明
通过Kepserver Data Exchange Client实现OPC连接设备的多连接的交互通信。数据读写,真正实现无缝链接。
Redis - 查看所有的key
Redis 查看所有的key
json解析没有key
    @Nullable    protected JSONArray parseJSONArray(JSONObject jsonObject, String key) {        JSONArray result = null;        if (jsonObject != null) {            if (jsonObject.has(key)) {         ...
这里没有key
这里用到了名为vbscript encode的加密技术 这个技术最早是用来防止网站源码被他人获取的 知道这是vb加密直接复制再解码得到FLAG
Jammed Traffic
Problem DescriptionnFinally, YY graduated from a little known university and got employed by a small company, with great effort. The job is interesting, well paid and nice in many naspects, except for the company is a little far from home. So YY has to take bus to work every day early in the morning, and prays for no traffic jams along the road.nnThe route of the bus is fixed. It goes past N+1 landmarks one by one, the first of which is the bus-stop where YY gets on the bus, and the last is the companynwhere he should get off. If traffic jams do not occur, the time consumed to go between landmarks is also fixed — Ti minutes from ith landmark to (i+1)th nlandmark (1≤i≤N). However, if a traffic jam is encountered, things are different. After having been late for many times (and luckily enough not been fired by hisnboss & girlfriend LMY), YY has discovered that the road between two consecutive landmarks will be jammed only in a fixed time period in a day. If the bus is nbetween ith landmark and (i+1)th landmark (excluding at the two landmarks themselves) and encounters a traffic jam, additional Di minutes are needed tonget to (i+1)th landmark.nnGiven the time YY gets on the bus and the time his company start to work, could he reach the company in time?n nnInputnFor each test case, the first line contains only one integer N. (1≤N≤100)nThen N lines follow. The ith line of which describes the road between ith landmark and (i+1)th landmark. Two integers comes first, Ti and Di (1≤Ti , Di≤60), indicating nthe basic time consumption and additional time consumption with traffic jam for the bus to go between the two landmarks, in minutes. A pair of time Si and Ei follows, nin HH:MM format (24 hours), indicating the starting and ending time of traffic jam between the two landmarks. Si is always strictly earlier than Ei, and they are alwaysnin the same day.nnThe last line contains the time when YY gets on the bus and the time when the company starts to work, in HH:MM format (24 hours). He must arrive at the companynstrictly before it starts to work, or he is late.nnAll times are in the same day.nInput end with N=0.n nnOutputnFor each test case, output one line with string “Poor YY!” if he will definitely be late or output “Lucky YY!” if he will not. Quotes for clarity, do not output them.n nnSample Inputn1n10 20 07:30 08:00n07:20 07:35n1n10 20 07:30 08:00n07:21 07:51n1n1 1 12:00 12:30n23:59 00:01n0n nnSample OutputnLucky YY!nPoor YY!nPoor YY!
利用RPC Over HTTPS发布Exchange服务器
ISA 利用RPC Over HTTPS发布Exchange服务器
traffic load
研究网络的流量问题,现在大规模网络中,流量的预测是个困难的问题,如何准确预测网络中的流量,将是非常困难的
TRAFFIC LIGHTS
DescriptionnnIn the city of Dingilville the traffic is arranged in an unusual way. There are junctions and roads connecting the junctions. There is at most one road between any two different junctions. There is no road connecting a junction to itself. Travel time for a road is the same for both directions. At every junction there is a single traffic light that is either blue or purple at any moment. The color of each light alternates periodically: blue for certain duration and then purple for another duration. Traffic is permitted to travel down the road between any two junctions, if and only if the lights at both junctions are the same color at the moment of departing from one junction for the other. If a vehicle arrives at a junction just at the moment the lights switch it must consider the new colors of lights. Vehicles are allowed to wait at the junctions. You are given the city map which shows nnthe travel times for all roads (integers), nthe durations of the two colors at each junction (integers) nand the initial color of the light and the remaining time (integer) for this color to change at each junction. nYour task is to find a path which takes the minimum time from a given source junction to a given destination junction for a vehicle when the traffic starts. In case more than one such path exists you are required to report only one of them. nInputnnThe first line contains two numbers: The id-number of the source junction and the id-number of the destination junction. nThe second line contains two numbers: N, M. nThe following N lines contain information on N junctions. The (i+2)’th line of the input file holds information about the junction i : Ci, ric, tiB, tiP where Ci is either ‘B’ or ‘P’, indicating the initial color of the light at the junction i. nFinally, the next M lines contain information on M roads. Each line is of the form: i, j, lij where i and j are the id-numbers of the junctions which are connected by this road . nn2 <= N <=300 where N is the number of junctions. The junctions are identified by integers 1 through N. These numbers are called id-numbers. n1 <=M <=14,000 where M is the number of roads. n1 <= lij <= 100 where lij is the time required to move from junction i to j using the road that connects i and j. n1 <= tic <= 100 where tic is the duration of the color c for the light at the junction i. The index c is either B for blue or P for purple. n1 <= ric <= tic where ric is the remaining time for the initial color c at junction i. nThe first line contains two numbers: The id-number of the source junction and the id-number of the destination junction. nThe second line contains two numbers: N, M. nThe following N lines contain information on N junctions. The (i+2)’th line of the input file holds information about the junction i : Ci, ric, tiB, tiP where Ci is either ‘B’ or ‘P’, indicating the initial color of the light at the junction i. nFinally, the next M lines contain information on M roads. Each line is of the form: i, j, lij where i and j are the id-numbers of the junctions which are connected by this road .nOutputnnIf a path exists: nnThe first line will contain the time taken by a minimum-time path from the source junction to the destination junction. nnIf a path does not exist: nnA single line containing only the integer 0.nSample Inputnn1 4n4 5nB 2 16 99nP 6 32 13nP 2 87 4nP 38 96 49n1 2 4n1 3 40n2 3 75n2 4 76n3 4 77nSample Outputnn127
Colliding Traffic
Problem DescriptionnFor a boat on a small, constrained body of water, other traffic can be a major hazard. The more traffic there is in the same area, the higher the risk of a collision.nnYour job is to monitor traffic and help detect likely collisions before they occur. You have sensors to detect the position, direction, and speed of each boat. Assuming the direction and speed remain constant, your task is to determine whether any of the boats will collide. Two boats are considered to collide if they come within a given distance of each other.n nnInputnThe first line of each test chunk contains a single integer c, the number of test cases to follow. Each test case starts with a line containing two numbers, n, the number of boats, and r, the collision distance. Two boats are considered to collide if they come within r metres of each other. There will be no more than 1000 boats. Each boat is identified by a line containing four numbers x, y, d, s. The numbers x and y give the current position of the boat as a distance east and north, respectively, from a common origin, and will be between -1000 and 1000, inclusive. The lake is small enough that we can model it as a flat surface. The number d gives the direction in which the boat is heading in degrees clockwise from north (so east is 90 degrees). The number s gives the speed of the boat in metres per second, and will be between 0.001 and 1000. Note that r, x, y, d, and s are not necessarily integers. The input data will be such that the answer will not change if any of the numbers x, y, d and s are changed by 10^-6 or less. nnPlease process to the end of the data file.n nnOutputnFor each test case, output a line containing a single integer, the number of seconds, rounded to the nearest second, before any of the boats come within r metres of each other. If none of the boats ever collide, output the line:nnNo collision.n nnSample Inputn2n2 5n0 0 90 1n10 10 180 1n2 10n0 0 0 0n8 8 270 1n2n2 5n0 0 90 1n10 10 180 1n2 10n0 0 0 0n8 8 270 1n nnSample Outputn6n2n6n2
One-way Traffic
In a certain town there are n intersections connected by two- and one-way streets. The town is very modern so a lot of streets run through tunnels or viaducts. Of course it is possible to travel between any two intersections in both ways, i.e. it is possible to travel from an intersection a to an intersection b as well as from b to a without violating traffic rules. Because one-way streets are safer, it has been decided to create as much one-way traffic as possible. In order not to make too much confusion it has also been decided that the direction of traffic in already existing one-way streets should not be changed.nnYour job is to create a new traffic system in the town. You have to determine the direction of traffic for as many two-way streets as possible and make sure that it is still possible to travel both ways between any two intersections.nnWrite a program that:nn> reads a description of the street system in the town from the standard input,nn> for each two-way street determines one direction of traffic or decides that the street must remain two-way,nn> writes the answer to the standard output.nnnInputnnThe rst line of the input contains two integers n and m, where 2 <= n <= 2000 and n-1 <= m <= n(n-1)/2. Integer n is the number of intersections in the town and interger m is the number of streets.nnEach of the next m lines contains three integers a, b and c, where 1 <= a <= n, 1 <= b <= n, a != b and c belongs to 1, 2. If c = 1 then intersections a and b are connected by an one-way street from a to b. If c = 2 then intersections a and b are connected by a two-way street. There is at most one street connecting any two intersections.nnProcess to the end of file.nnnOutput nnThe output contains exactly the same number of lines as the number of two-way streets in the input. nnFor each such street (in any order) the program should write three integers a, b and c meaning, the new direction of the street from a to b (c = 1) or that the street connecting a and b remains two-way (c = 2). If there are more than one solution with maximal number of one-way streets then your program should output any of them but just one.nnnSample Inputnn4 4 n4 1 1 n4 2 2 n1 2 1 n1 3 2 nnSample Outputnn2 4 1 n3 1 2
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview

相似问题

2
我用对hyperledger fabric性能进行了测试,但是测试结果并不是很懂,求解答
0
一个时间方面的区间线段的问题的办法,怎么解决这个问题用到C语言的办法
1
<android初学> <第一行代码> 学习使用<data>标签时出错
0
状态的连续变化的计算问题,怎么利用C语言的程序的设计的思想来解决
0
计算对于所有人来说最短的旅行距离的和,怎么利用 C 语言的程序的编写的办法来实现的
0
最短的路径的判断的计算的一个算法问题,怎么利用C语言的程序的设计实现的?
0
交通灯的排列组合的算法,怎么利用C语言的程序的设计的思想去实现的方法??
0
计程车的费用的计算的方式,怎么采用C语言的代码的程序的编写的过程?
0
数据结构的无相图的链接实现道路的问题,怎么实现代码程序的编写对问题的计算?
0
出租车运营费用的计算算法,怎么采用C语言的程序代码编写的技术去实现这个算法呢?
0
物流包裹的运输问题,怎么采用C程序的语言代码编写的思想方法去实现的呢?
0
交通拥堵的算法解决问题,怎么利用C程序编写代码的方式实现这个问题的思想方法
0
计算所有公共汽车经过转弯的最短时间,这个问题如果是采用C语言的程序设计的语言的过程应该如何来计算的
0
状态转移的建模的程序,怎么采用C语言的编程语言的技术的方式去实现代码
0
计算汽车发车的最小的时间是什么,怎么用C语言的程序的编写的代码的设计的方式来实现的?
0
NS2.35 中实现MAC/802.11 的PCF接入方式
0
计算运动的水平和垂直方向的速度的问题,怎么使用C语言的程序的代码设计思想的过程来解决?
1
Failed to retrieve data from /webhdfs/v1/?op=LISTSTATUS: Server Error,同时无法put文件到hdfs
0
计程车计费的计算算法,怎么采用C语言的代码的编写的过程的方式实现的步骤是什么
0
关于出租车费用的一个计算的问题,怎么采用C语言的程序的设计的代码的编写的过程有效加以实现的