比赛 NOIP模拟赛1 评测结果 WWWWWWEEEEEEEEEEEEEE
题目名称 天天爱射击 最终得分 0
用户昵称 sky_bz 运行时间 8.741 s
代码语言 C++ 内存使用 292.10 MiB
提交时间 2018-02-08 21:15:23
显示代码纯文本
  1. #include <cstdio>
  2. #include <iostream>
  3. using namespace std;
  4. int map[10100][10100];
  5. bool o[10100];
  6. int main()
  7. {
  8. freopen("shooting.in","r",stdin);
  9. freopen("shooting.out","w",stdout);
  10. int n,m;
  11. int temp1,temp2,temp3;
  12. cin>>n>>m;
  13. for(int i=1;i<=n;i++)
  14. {
  15. cin>>temp1>>temp2>>temp3;
  16. for(int j=temp1;j<=temp2;j++)
  17. map[i][j]=190;
  18. map[0][i]=temp3;
  19. o[i]=true;
  20. }
  21. temp2=n;//剩余的木板
  22. for(int i=1;i<=m;i++)
  23. {
  24. cin>>temp1;
  25. for(int j=1;j<=n;j++)
  26. {
  27. if(o[j])
  28. {
  29. if(map[temp1][j]==190)
  30. map[0][j]--;
  31. if(map[0][j]==0)
  32. {
  33. temp2--;
  34. o[j]=false;
  35. }
  36. }
  37. }
  38. cout<<n-temp2<<endl;
  39. }
  40. fclose(stdin);
  41. fclose(stdout);
  42. return 0;
  43. }