QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 2048 MB Total points: 200 Difficulty: [show]

#1. I/O Test

Statistics

This is a test problem designed to evaluate input and output efficiency. You can use this problem to test the efficiency of your input and output methods.

Specifically, your program will perform one of the following two tasks:

  • Read $N$ integers $a_1, a_2, \cdots, a_N$ and output the sum of these $N$ integers.
  • Read an integer $N$ and output any $N$ integers in the range $[10^8, 10^9)$.

Implementation Details

You need to submit three files.

config

The first file you need to submit is config, which is a text file describing the size $N$ you want to test.

Specifically, it should contain exactly one line with two integers $N_{\mathrm{in}}, N_{\mathrm{out}}$, describing the sizes for the input test and output test respectively. In particular, if you do not want to perform a corresponding test, simply set the corresponding $N_*$ to $0$.

For convenience, you may specify any $1 \leq N \leq 10^7$. However, if you want your submission record to appear in the ranking on the problem statistics page, you must specify $N = 10^7$.

input_test

The second file you need to submit is input_test, which is a program source code describing the program for the input test.

This program will read input data from standard input in the following format:

The first line contains an integer $N$. The next line contains $N$ integers $a_1, a_2, \cdots, a_N$, where it is guaranteed that $1 \leq a_i \leq 10^9$.

You need to output a single integer to standard output, representing the sum of all $N$ integers.

output_test

The third file you need to submit is output_test, which is a program source code describing the program for the output test.

This program will read input data from standard input in the following format:

The input consists of only one line containing an integer $N$.

You need to output exactly $N$ integers in one line, each in the range $[10^8, 10^9)$. Any output that satisfies the conditions will be judged as correct.

Scoring

This problem contains $2$ test points, each worth $100$ points, for a total of $200$ points. The first test point will run the program input_test, and the second test point will run the program output_test.

During evaluation, the judging system will attempt to read the integers $N_{\mathrm{in}}, N_{\mathrm{out}}$ from config. You must ensure that $0 \leq N_{\mathrm{in}}, N_{\mathrm{out}} \leq 10^7$. If the information contained in this file is invalid, the system will terminate the evaluation and immediately return Compile Error.

Then, if the corresponding value of $N_*$ is not $0$, the judging system will compile the corresponding input_test or output_test. If a compilation error occurs, the system will terminate the evaluation and immediately return Compile Error.

After compilation, the system will generate test data according to the value of $N$ for each test.

In each test point, if your output is incorrect, a runtime error occurs, or the time limit (1.0 second) or memory limit (2.0 GiB) is exceeded, you will receive $0$ points. Otherwise, you will receive $\frac{N}{10^5}$ points.

On the problem statistics page, only submission records that receive full scores in both tests will be counted.

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.