70 ,6个wa

P2058 [NOIP2016 普及组] 海港

```cpp #include<bits/stdc++.h> using namespace std; int n,ans,flag[1000005]; queue <int> qt,qx,qk; int main(){ int t,k,x; scanf("%d",&n); while(n--){ scanf("%d%d",&t,&k),qt.push(t),qk.push(k); while(k--){ scanf("%d",&x),flag[x]++,qx.push(x); if(flag[x]==1) ans++; } while((qt.back()-qt.front())>=86400){ qt.pop(),k=qk.front(),qk.pop(); while(k--){ flag[qx.front()]--; if(flag[qx.front()]==0) ans--; qx.pop(); } } printf("%d\n",ans); } return 0; } ``` @[100a](/user/1125878) 有个用que做的
by o7o7 @ 2024-04-22 15:11:04


|