比赛 |
至少完成十道练习 |
评测结果 |
AAAAAAAAAAAAAAAAAAAA |
题目名称 |
海港 |
最终得分 |
100 |
用户昵称 |
TARDIS |
运行时间 |
0.285 s |
代码语言 |
C++ |
内存使用 |
0.50 MiB |
提交时间 |
2017-05-23 19:10:28 |
显示代码纯文本
- #include<bits/stdc++.h>
- #define COGS
- using namespace std;
- const int maxn=100010;
- int n,kn[maxn],ans,t[maxn],k,temp,last;
- int nation[maxn];int sum;
- struct man{
- int id,time;
- }now,old;
- queue<int> port;
- queue<man> hotel;
- inline void in(){
- #ifdef COGS
- freopen("port.in","r",stdin);
- freopen("port.out","w",stdout);
- #endif
- scanf("%d",&n);
- for (int i=1;i<=n;i++){
- scanf("%d%d",&t[i],&kn[i]);
- now.time=t[i];
- for (int j=1;j<=kn[i];j++){
- scanf("%d",&now.id);
- hotel.push(now);
- if (!nation[now.id]) sum++;
- nation[now.id]++;
- }
- while(520){
- old=hotel.front();
- if (now.time-old.time>=86400){
- nation[old.id]--;
- if (!nation[old.id]) sum--;
- hotel.pop();
- }
- else break;
- }
- printf("%d\n",sum);
- }
- }
- int Main(){
- in();
- return 0;
- }
- int main(){;}
- int xlm=Main();