Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
338141 黄浙峰老师 【C6-7】看电视-会议安排 C++ Accepted 100 31 MS 256 KB 405 2025-08-06 11:07:24

Tests(1/1):


#include<bits/stdc++.h> using namespace std; struct P{ int b,e; }p[110]; bool cmp(P a,P b){ return a.e<b.e; } int main(){ int n; while(1){ cin>>n; if(n==0) break; for(int i=0;i<n;i++){ cin>>p[i].b>>p[i].e; } sort(p,p+n,cmp); int end=p[0].e,c=1; for(int i=1;i<n;i++){ if(p[i].b>=end){ c++; end=p[i].e; } } cout<<c<<endl; } return 0; }


Judgement Protocol: