比赛 至少完成十道练习 评测结果 AAAAAAAAAAAAAAAAAAAA
题目名称 海港 最终得分 100
用户昵称 TARDIS 运行时间 0.285 s
代码语言 C++ 内存使用 0.50 MiB
提交时间 2017-05-23 19:10:28
显示代码纯文本
  1. #include<bits/stdc++.h>
  2. #define COGS
  3. using namespace std;
  4. const int maxn=100010;
  5. int n,kn[maxn],ans,t[maxn],k,temp,last;
  6. int nation[maxn];int sum;
  7. struct man{
  8. int id,time;
  9. }now,old;
  10. queue<int> port;
  11. queue<man> hotel;
  12. inline void in(){
  13. #ifdef COGS
  14. freopen("port.in","r",stdin);
  15. freopen("port.out","w",stdout);
  16. #endif
  17. scanf("%d",&n);
  18. for (int i=1;i<=n;i++){
  19. scanf("%d%d",&t[i],&kn[i]);
  20. now.time=t[i];
  21. for (int j=1;j<=kn[i];j++){
  22. scanf("%d",&now.id);
  23. hotel.push(now);
  24. if (!nation[now.id]) sum++;
  25. nation[now.id]++;
  26. }
  27. while(520){
  28. old=hotel.front();
  29. if (now.time-old.time>=86400){
  30. nation[old.id]--;
  31. if (!nation[old.id]) sum--;
  32. hotel.pop();
  33. }
  34. else break;
  35. }
  36. printf("%d\n",sum);
  37. }
  38. }
  39. int Main(){
  40. in();
  41. return 0;
  42. }
  43. int main(){;}
  44. int xlm=Main();