Advertisement
apl-mhd

aaaaaaaaa

Apr 14th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <map>
  4.  
  5. using namespace std;
  6.  
  7.  
  8. int main(int argc, char **argv)
  9. {
  10.    
  11.     map<string, int> subject;
  12.     map<string, int>::iterator it;
  13.    
  14.    
  15.     int t;
  16.     cin>>t;
  17.     while(t){
  18.        
  19.         string sbjct;
  20.         int n,day,D;
  21.         cin>>n;
  22.     for(int i=0; i<n; i++){
  23.        
  24.         cin>>sbjct>>day;
  25.        
  26.         subject[sbjct] = day;
  27.        
  28.         }
  29.        
  30.         cin>>D;
  31.         cin>>sbjct;
  32.        
  33.         cout<<subject[sbjct];
  34.         if(subject[sbjct] <= D)
  35.             cout<<"YES"<<endl;
  36.         else if(subject[sbjct] <=D+5)
  37.             cout<<"Late"<<endl;
  38.         else
  39.             cout<<"Do your own homework!"<<endl;
  40.        
  41.  
  42.        
  43.         t--;
  44.     }
  45. /* 
  46.      for (it=subject.begin(); it!=subject.end(); ++it)
  47.     std::cout << it->first << " => " << it->second << '\n';
  48. */ 
  49.    
  50.     return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement