#include<iostream>#include<algorithm>usingnamespace std;constint N =100010;int n;structRange{int l, r;booloperator<(const Range &W)const{return l < W.l;}} range[N];intmain(){int st, ed;scanf("%d%d",&st,&ed);scanf("%d",&n);for(int i =0; i < n; i++){int l, r;scanf("%d%d",&l,&r);
range[i]={l, r};}sort(range, range + n);int res =0;bool success =false;for(int i =0; i < n; i++){int j = i, r =-2e9;while(j < n && range[j].l <= st){
r =max(r, range[j].r);
j++;}if(r < st){
res =-1;break;}
res++;if(r >= ed){
success =true;break;}
st = r;
i = j -1;}if(!success) res =-1;printf("%d\n", res);return0;}
前言: 当今互联网已成为人们生活的重要组成部分,而HTTP协议(Hypertext Transfer Protocol)是支持Web通信的基础。随着Web技术的发展和互联网应用的不断增多,HTTP也在不断演进。本文旨在介绍HTTP的演变过程中的三个重要…