比赛 |
NOIP模拟赛1 |
评测结果 |
WWWWWWEEEEEEEEEEEEEE |
题目名称 |
天天爱射击 |
最终得分 |
0 |
用户昵称 |
sky_bz |
运行时间 |
8.741 s |
代码语言 |
C++ |
内存使用 |
292.10 MiB |
提交时间 |
2018-02-08 21:15:23 |
显示代码纯文本
- #include <cstdio>
- #include <iostream>
- using namespace std;
- int map[10100][10100];
- bool o[10100];
- int main()
- {
- freopen("shooting.in","r",stdin);
- freopen("shooting.out","w",stdout);
- int n,m;
- int temp1,temp2,temp3;
- cin>>n>>m;
- for(int i=1;i<=n;i++)
- {
- cin>>temp1>>temp2>>temp3;
- for(int j=temp1;j<=temp2;j++)
- map[i][j]=190;
- map[0][i]=temp3;
- o[i]=true;
- }
- temp2=n;//剩余的木板
- for(int i=1;i<=m;i++)
- {
- cin>>temp1;
- for(int j=1;j<=n;j++)
- {
- if(o[j])
- {
- if(map[temp1][j]==190)
- map[0][j]--;
- if(map[0][j]==0)
- {
- temp2--;
- o[j]=false;
- }
-
- }
- }
- cout<<n-temp2<<endl;
- }
- fclose(stdin);
- fclose(stdout);
- return 0;
- }
-
-