#include<stdio.h>
#define M 20
int n, m;
int a[3100099];
int s[3100000];
int main()
{
int i, j, k, l;
scanf("%d",&n);
for(i=0;i<n;i++){scanf("%d",&a[i]);s[a[i]+M]++;}
scanf("%d",&m);
int cnt=0;
for(i=0;i<2*M+2;i++)if(s[i])cnt++;
for(i=n;i<=m&& i<2*M+20;i++)
{
a[i]=cnt;
s[cnt+M]++;
if(s[cnt+M]==1)cnt++;
printf("%d\n",cnt);
}
if(m<2*M+2)
{
printf("%d\n",a[m]);
}
else
{
int p,q;
p = a[i-2];
q = a[i-1];
if(p==q)printf("%d\n",p);
else
{
q+=(m-i)*(q-p);
printf("%d\n",q);
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
5 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
2 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
3 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
4 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
7 |
Runtime error |
0 ms |
25300 KB |
gettid (syscall #186) was called by the program (disallowed syscall) |
8 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
9 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
10 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
2 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
3 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
4 |
Incorrect |
4 ms |
25300 KB |
Output isn't correct |
5 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
6 |
Runtime error |
4 ms |
25300 KB |
SIGSEGV Segmentation fault |
7 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
8 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
9 |
Runtime error |
0 ms |
25300 KB |
SIGSEGV Segmentation fault |
10 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
11 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
12 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
13 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
14 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
15 |
Runtime error |
5 ms |
25300 KB |
SIGSEGV Segmentation fault |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
25300 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
4 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
5 |
Runtime error |
0 ms |
25300 KB |
SIGSEGV Segmentation fault |
6 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
7 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
8 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
9 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
10 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
11 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
12 |
Runtime error |
0 ms |
25296 KB |
SIGSEGV Segmentation fault |
13 |
Incorrect |
0 ms |
25300 KB |
Output isn't correct |
14 |
Runtime error |
0 ms |
25300 KB |
SIGSEGV Segmentation fault |
15 |
Runtime error |
4 ms |
25300 KB |
SIGSEGV Segmentation fault |