fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. int N;
  6. int main(){
  7. cin>>N;
  8. int a[N+1];
  9. int s,e;
  10. for(int n=0;n<N;n++){
  11. int v;
  12. cin>>s>>e;
  13. v=s*100+e;
  14. a[n]=v;
  15. }
  16. int now;
  17. cin>>now;
  18. a[N-1]=now;
  19. sort(a,a+N);
  20. for(int n=0;n<N;n++){
  21. if(a[n]==now && n!=(N-1)){
  22. cout<<a[n+1]/100<<" "<<a[n+1]%100;
  23. return 0;
  24. }
  25. }
  26. cout<<"Too Late";
  27. }
  28.  
Success #stdin #stdout 0.01s 5304KB
stdin
1
09 00
10 00
stdout
Too Late