QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 1024 MB Puntuación total: 100 Hackeable ✓

#17685. 分割

Estadísticas

ZOYI 正在开发一个名为 Channel 的工具,该工具提供了一个与网站上在线用户交流的途径。最近,ZOYI 引入了 RF(Recency / Frequency,近度/频度)模型来区分正在使用 Channel 的用户,并决定通过以下计算对用户进行分类。

图:RF Channel 中区分用户的示意图。横轴代表 Recency(近度),纵轴代表 Frequency(频度)。

$$ (0 < f_1 < f_2 < f_3 < f_4, \ 0 < r_1 < r_2 < r_3 < r_4, \text{ 所有 } f_i \text{ 和 } r_i \text{ 均为整数。}) $$

$x$ 轴代表 Recency(近度),$y$ 轴代表 Frequency(频度)。所有在线用户根据其连接记录被赋予 $r, f$ 值,并被归类为以下十二种状态之一:

  • “New Customer"
  • “Promising"
  • “About to Sleep"
  • “Hibernating"
  • “Lost"
  • “Potential Loyalist"
  • “Need Attention"
  • “About to Leave"
  • “Champion"
  • “Loyal Customer"
  • “Can’t Lose Them"
  • “None"

在这些状态中,“None” 表示该用户在服务器上没有连接记录。如果 $(r, f)$ 位于两个或多个分类区域的边界上,则其分类遵循 $(r - 0.5, f - 0.5)$ 的分类。例如,如果 $(r, f)$ 的值为 $(r_4, f_2)$,它将被归类为 “Hibernating”;而如果值为 $(r_3, f_4)$,它将被归类为 “Loyal Customer”。

你想要调查对 RUN 感兴趣的用户状态,因此你尝试按以下方式安装该程序:

  • $r$:如果当前时间为 $t$,$t - (\text{最近一次访问时间})$
  • $f$:访问次数

给定网站用户的事件,编写一个程序,根据上方给出的图片对用户进行分类。

输入格式

第一行包含四个空格分隔的整数 $r_1, r_2, r_3, r_4$。($0 < r_1 < r_2 < r_3 < r_4 \le 10,000$)

第二行包含四个空格分隔的整数 $f_1, f_2, f_3, f_4$。($0 < f_1 < f_2 < f_3 < f_4 \le 10,000$)

第三行包含一个整数 $N$。($1 \le N \le 100,000$)

接下来的 $N$ 行按时间顺序包含事件,其中第 $i$ 个元素表示在时间 $i$ 发生的事件。

每个事件由空格分隔的 $A$ 和 $B$ 给出,其中 $B$ 是用户名(不包含空格,最多包含 10 个字母)。$A$ 的值为 1 或 2,其中 1 表示用户进入了网站,而 2 表示你应该输出该用户当前的分类。

输出格式

对于 $A$ 为 2 的事件,在每行中输出该用户的分类(不带引号)。

样例

输入样例 1

1 2 3 4
1 2 3 4
8
1 RUN
1 Alex
2 Alex
1 RUN
1 RUN
1 Alex
2 Alex
2 RUN

输出样例 1

New Customer
Potential Loyalist
Need Attention

说明

在时间 3,Alex 的连接状态为 $f = 1$(首次访问),$r = 1$(时间 $3 - 2 = 1$)。因此,Alex 被归类为 “New Customer”。

在时间 7,Alex 的连接状态为 $f = 2$(第二次访问),$r = 1$(时间 $7 - 6 = 1$)。因此,Alex 被归类为 “Potential Loyalist”。

在时间 8,RUN 的连接状态为 $f = 3$(第三次访问),$r = 3$(时间 $8 - 5 = 3$)。因此,RUN 被归类为 “Need Attention”。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.