0
已解决
请各位走过路过的大佬帮忙找找错!!!
Runtime Error:50分
赵航宇的测评结果:
测试点#1测评结果 : Accepted时间 : 0ms
测试点#2测评结果 : Accepted时间 : 0ms
测试点#3测评结果 : Accepted时间 : 0ms
测试点#4测评结果 : Accepted时间 : 0ms
测试点#5测评结果 : Accepted时间 : 0ms
测试点#6测评结果 : Runtime Error时间 : 0ms偷看一下数据测试点#7测评结果 : Runtime Error时间 : 0ms偷看一下数据测试点#8测评结果 : Runtime Error时间 : 0ms偷看一下数据测试点#9测评结果 : Runtime Error时间 : 0ms偷看一下数据测试点#10测评结果 : Runtime Error时间 : 0ms偷看一下数据
我的提交(cpp):
#include<iostream>
#include<algorithm>
using namespace std;
struct w{
int x,y;
}a[110];
bool cmp(w a,w b)
{
if(a.x!=b.y)return a.x<b.y;
return a.y<b.y;
}
int main()
{
int n,cnt=0;
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i].x>>a[i].y;
sort(a+1,a+1+n,cmp);
for(int i=1;i<=n;i++)
if(a[i].y<a[i+1].x)
cnt++;
cout<<cnt+1;
return 0;
}
0
0
https://wenda.codingtang.com/questions/5431/
https://wenda.codingtang.com/questions/3588/
这两个网址可能会帮助你!
望采纳,谢谢!!


