E - Argus

Description

A data stream is a real-time, continuous, ordered sequence of items. Some examples include sensor data, Internet traffic, financial tickers, on-line auctions, and transaction logs such as Web usage logs and telephone call records. Likewise, queries over streams run continuously over a period of time and incrementally return new results as new data arrives. For example, a temperature detection system of a factory warehouse may run queries like the following.
Query-1: "Every five minutes, retrieve the maximum temperature over the past five minutes."
Query-2: "Return the average temperature measured on each floor over the past 10 minutes."

We have developed a Data Stream Management System called Argus, which processes the queries over the data streams. Users can register queries to the Argus. Argus will keep the queries running over the changing data and return the results to the corresponding user with the desired frequency.

For the Argus, we use the following instruction to register a query:
Register Q_num Period

Q_num (0 < Q_num <= 3000) is query ID-number, and Period (0 < Period <= 3000) is the interval between two consecutive returns of the result. After Period seconds of register, the result will be returned for the first time, and after that, the result will be returned every Period seconds.

Here we have several different queries registered in Argus at once. It is confirmed that all the queries have different Q_num. Your task is to tell the first K queries to return the results. If two or more queries are to return the results at the same time, they will return the results one by one in the ascending order of Q_num.

Input

The first part of the input are the register instructions to Argus, one instruction per line. You can assume the number of the instructions will not exceed 1000, and all these instructions are executed at the same time. This part is ended with a line of "#".

The second part is your task. This part contains only one line, which is one positive integer K (<= 10000).

Output

You should output the Q_num of the first K queries to return the results, one number per line.

Sample Input

Register 2004 200
Register 2005 300
#
5

Sample Output

2004
2005
2004
2004
2005
#include <iostream>
#include <queue>
#include <cstdio>
#include <string>
using namespace std;

struct cmp
{
    int number,t,time;
    bool operator <(const cmp&p)const
    {
        return p.time<time||(p.time==time&&p.number<number);
    }

};
int main()
{
    priority_queue<cmp>pb;
  char s[30];
    int n1,n2;
    cmp n;
    while(scanf("%s",s)&&s[0]!='#')
    {
        scanf("%d%d",&n.number,&n.t);
        n.time=n.t;
        pb.push(n);
    }
    scanf("%d",&n1);
    while(n1--)
    {
        cmp n2=pb.top();
        pb.pop();
        printf("%d\n",n2.number);
        n2.time+=n2.t;
        pb.push(n2);
    }

    return 0;
}
这个题主要就是讲了 一个ID号  后面是它的周期 也可以说成冷却时间,时间一到 就把它的ID号弹出来 ,时间相同 则把ID号小的弹出来,这里用到了优先队列 默认弹出大的 所以我们重载了 <运算符
 
 
 
### Argus 模型概述 Argus模型主要应用于网络安全领域,专注于入侵检测系统的研发与应用。该模型通过收集并分析网络流量数据来识别潜在的安全威胁和异常行为。然而,在提供的参考资料中并未直接提及Argus模型的具体细节[^1]。 尽管如此,可以从其他公开资源了解到,Argus(Remote Traffic Analysis and Security Monitoring System)是一个开源的工具集,用于实时监控和记录双向TCP/IP通信会话的状态信息。它能够帮助管理员理解网络性能特征,并支持多种高级功能如带宽管理、安全审计等。 对于希望部署此类系统的机构而言,建立一个强大的数据中心至关重要。正如360数科所提出的那样,在现代金融科技环境中,构建统一的数据平台可以有效提升各类智能化服务的质量,这同样适用于任何依赖大量数据分析工作的项目,比如基于Argus模型的安全监测系统。 为了确保系统的安全性,采用可信计算技术也是必不可少的一环。这些技术覆盖了从硬件到软件多个层面的安全保障措施,例如信任链传递技术和安全芯片设计技术等,这些都是保护像Argus这样的敏感应用程序免受攻击的重要手段[^2]。 ```python # Python伪代码展示如何调用Argus API获取网络流统计信息 import requests def get_network_flow_stats(api_url, params=None): response = requests.get(url=api_url, params=params) if response.status_code == 200: return response.json() else: raise Exception(f"Failed to fetch data: {response.text}") if __name__ == "__main__": api_endpoint = "http://example.com/argus/api/v1/stats" try: stats_data = get_network_flow_stats(api_endpoint) print(stats_data) except Exception as e: print(e) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值