QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 512 MB 満点: 100

#3337. 疯狂教授

統計

Lasse 是一位古怪的教授。他坚信为了开发未来的计算机程序,应该将它们并行化。为了向世人证明他是对的,他想要进行一项实验。实验过程如下:对于一些已有串行实现的程序,他估计了该程序在接下来一年内(届时程序可能会被重写)将被执行的次数。他命令他的助手 Magnus 开发该程序的并行版本,并测量 Magnus 开发它所花费的时间。最后,他们测量了并行版本和串行版本的执行时间。

基于收集到的数据,Lasse 想要知道在哪些情况下,通过并行化可以使该程序所花费的总工时最小。工时包括开发并行版本所花费的时间以及程序执行时的等待时间。

输入格式

输入包含 $t \le 1000$ 组测试用例,其中 $t$ 由输入的第一行给出。每个测试用例由一行包含四个整数 $d, n, s$ 和 $p$ 的数据组成,它们之间用空格分隔。$d$ 是开发并行版本所花费的时间 ($0 \le d \le 1000000$),$n$ 是该程序在接下来一年内预计执行的次数 ($0 \le n \le 100000$)。$s$ 和 $p$ 分别是程序的串行版本和并行版本的运行时间 ($0 \le s, p \le 1000$)。

输出格式

对于每个测试用例,如果并行化是有益的,则在一行中输出 "parallelize"。如果并行化没有益处,则输出 "do not parallelize"。如果无论是否并行化,程序预计花费的总时间相同,则输出 "does not matter"。

样例

输入格式 1

3
10 2 3 2
20 5 8 2
0 2 1 1

输出格式 1

do not parallelize
parallelize
does not matter

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.