1 条题解

  • 0
    @ 2024-12-25 13:09:44
    #include <bits/stdc++.h>
    #define LL long long
    using namespace std;
    const int N = 3e5 + 10;
    const int INF = 0x3f3f3f3f;
    struct duce
    {
    	int c;
    	int t;
    };
    int n , m , k , s , a , v [N] , ans;
    queue < duce > q;
    
    int main()
    {
    	    cin >> n;
    	    while ( n-- )
    	    {
    	    	cin >> m >> k;
    	    	while ( k-- )
    	    	{
    	    		cin >> a;
    	    		q . push ((duce) {a , m});
    	    		v [a]++;
    	    		if (v [a] == 1)
    	    		{
    	    			ans++;
    				}
    			}
    			while (m - q . front (). t >= 86400)
    			{
    				v [q . front (). c]--;
    				if (!v [q . front (). c])
    				    ans--;
    				q . pop ();
    			}
    			cout << ans << endl;
    		}
    		return 0;
    }
    
    • 1

    信息

    ID
    3046
    时间
    1000ms
    内存
    256MiB
    难度
    7
    标签
    递交数
    106
    已通过
    28
    上传者