Input expectations
Practice
3.1 (28 votes)
Arrays
Basic programming
Basic math
Math
Problem
84% Success 3340 Attempts 10 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Consider the following program:
int t;
cin >> t;
for(int i = 0; i < t; i++){
int n;
cin >> n;
for(int i = 0; i < n; i++){
int temp;
cin >> temp;
}
}
cout << "END OF THE PROGRAM";
This program accepts the input as follows:
\(t\)
\(n\)
\(a_1a_2 a_3 ... a_n\)
\(n\)
\(a_1a_2 a_3 ... a_n\)
\(.\)
\(.\)
\(.\)
\(n\)
\(a_1a_2 a_3 ... a_n\)
And, then prints "END OF THE PROGRAM".
Suppose you provide following input to the program:
\(n\)
\(a_1a_2 a_3 ... a_n\)
The program might expect more numbers.
How many more numbers does the program must be given to get the "END OF THE PROGRAM" output. If there are multiple answers, then print the minimum answer.
Input format
- The first line will contain an integer \(n\). (\(1 \le n \le 1000000\))
- The second line contains \(n\) space-separated integers (\(1 \le a_i \le 1000000\)):
- \(n\)
- \(a_1a_2 a_3 ... a_n\)
Output format
Print a single integer denoting the answer to the problem.
Submissions
Please login to view your submissions
Similar Problems
Points:10
2 votes
Tags:
Very-Easy
Points:10
5 votes
Tags:
Math BasicAlgorithmsBasic MathMath
Points:10
17 votes
Tags:
MathematicsBasic MathMath
Editorial