Advertisement
TLE

11917

TLE
Mar 30th, 2014
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<stdlib.h>
  4.  
  5. int main()
  6. {
  7. char subject[110][25],due[25];
  8. int D,t,n,day[110],i,j,flag,ca=0,x,y;
  9. scanf("%d",&t);
  10. for(x=0; x<t; x++)
  11. {
  12. scanf("%d",&n);
  13. i = 0;
  14. for(y=0; y<n; y++)
  15. {
  16. scanf("%s %d",subject[i],&day[i]);
  17. i++;
  18. }
  19. scanf("%d",&D);
  20. scanf("%s",due);
  21. flag = 0;
  22. printf("Case %d: ",++ca);
  23. for(j=0; j<i; j++)
  24. {
  25. if( strcmp(due,subject[j]) == 0)
  26. {
  27. flag = 1;
  28. if( day[j] < D )
  29. {
  30. printf("Yesss\n");
  31. }
  32. else if( day[j] <= (D+5) )
  33. {
  34. printf("Late\n");
  35. }
  36. else
  37. {
  38. printf("Do your own homework!\n");
  39. }
  40. break;
  41. }
  42. }
  43. if(flag == 0)
  44. {
  45. printf("Do your own homework!\n");
  46. }
  47. }
  48. return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement