Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int x, n, i, j, pocetok=0, kraj=0, maxi=0;
- cin >> n;
- int niza[86401]={0};
- string str1, str2;
- for(i=0; i<n; i++)
- {
- pocetok=0, kraj=0;
- cin >> str1 >> str2;
- pocetok = ((((str1[0]-'0')*10)+str1[1]-'0')*3600) + ((((str1[3]-'0')*10)+str1[4]-'0')*60) + (((str1[6]-'0')*10)+str1[7]-'0');
- kraj = ((((str2[0]-'0')*10)+str2[1]-'0')*3600) + ((((str2[3]-'0')*10)+str2[4]-'0')*60) + (((str2[6]-'0')*10)+str2[7]-'0');
- while(pocetok<=kraj)
- {
- niza[pocetok]++;
- pocetok++;
- }
- }
- for(i=0; i<86401; i++)
- if(maxi<niza[i]) maxi = niza[i];
- cout << maxi;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment