QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#405669 | #8630. 字符树 | wxqwq# | 20 | 2090ms | 9816kb | C++14 | 1.6kb | 2024-05-06 11:59:47 | 2024-05-06 11:59:48 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
inline int read()
{
int x=0;bool f=0;char ch=getchar();
while(ch<'0' || ch>'9') {if(ch=='-') f=1;ch=getchar();}
while(ch>='0' && ch<='9') x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
return f?-x:x;
}
inline int read1()
{
int x=0;bool f=0;char ch=getchar();
while(ch<'0' || ch>'9') {if(ch=='-') f=1;ch=getchar();}
return ch;
// return f?-x:x;
}
#define x first
#define y second
#define pb push_back
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> PII;
typedef long long LL;
typedef unsigned long long ull;
const int N=5e5+10;
int n,m,X;
int fa[N],fw[N],dep[N];
char str[N],tmp1[N],tmp2[N];
bool check(int l,int r) {
bool ans=1;
for(int i=l,j=1;i<=r;i++,++j) ans&=(str[j]==tmp1[i]);
return ans;
}
int main()
{
n=read(),m=read(),X=read();
for(int i=2;i<=n;i++) fa[i]=read(),dep[i]=dep[fa[i]]+1;
rep(i,2,n) fw[i]=read1();
int op,x,y;
while(m--) {
op=read(),x=read(),y=read();
scanf("%s",str+1);
if(op==1) {
int tt=1,hh=X;
while(dep[x]>dep[y]) fw[x]=str[tt++],x=fa[x];
while(dep[y]>dep[x]) fw[y]=str[hh--],y=fa[y];
while(x!=y) fw[x]=str[tt++],x=fa[x],fw[y]=str[hh--],y=fa[y];
}
else if(op==2) {
int i=0,j=0;
while(dep[x]>dep[y]) tmp1[++i]=fw[x],x=fa[x];
while(dep[y]>dep[x]) tmp2[++j]=fw[y],y=fa[y];
while(x!=y) tmp1[++i]=fw[x],x=fa[x],tmp2[++j]=fw[y],y=fa[y];
for(int k=i+1,o=j;o>=1;k++,o--) tmp1[k]=tmp2[o];
int len=i+j,ans=0;
for(int i=1;i<=len;i++) if(i+X-1<=len && check(i,i+X-1)) ++ans;
printf("%d\n",ans);
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 0ms
memory: 7956kb
input:
250 250 62 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 30 67 68 8 70 16 72 3 74 75 32 77 75 31 80 81 65 83 30 19 49 4 1 89 57 91 92 43 94 95 96 85 51 32 100 8...
output:
1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 2 3 0 0 0 4 4 0 0 0 0 0 2 0 4 0 0 0 0 0 0 0 0 4 0 0 0 0 1 0 0 10 0 0 0 0 0 0 2 0 0 0 0 0 0 0 3 0 2 0 1 0 0 7
result:
ok 118 numbers
Test #2:
score: 10
Accepted
time: 1ms
memory: 7944kb
input:
250 250 6 1 1 1 4 1 1 1 1 1 1 1 1 1 14 1 1 1 1 19 1 1 1 1 24 1 26 27 28 1 30 1 32 1 1 35 1 37 1 1 1 1 1 43 44 45 1 47 1 1 1 1 1 53 54 1 56 57 58 1 60 1 62 63 64 65 1 1 68 69 70 71 1 1 1 1 76 77 78 79 1 81 1 83 84 1 1 1 88 89 1 91 1 93 94 1 96 97 98 99 1 1 102 103 1 105 106 107 108 1 110 111 112 113 ...
output:
1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 0 1 1 0 1 0 0 1 0 0 0 3 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 3 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 2 2 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 1 0 1
result:
ok 118 numbers
Test #3:
score: 10
Accepted
time: 0ms
memory: 7956kb
input:
250 250 6 1 2 2 4 5 2 7 2 8 10 11 12 13 14 14 16 17 16 19 20 21 22 1 24 16 26 27 28 29 23 31 20 33 34 35 15 37 38 39 40 41 42 30 44 45 46 47 32 49 50 34 52 53 54 7 56 9 58 59 60 52 42 63 64 65 43 67 68 69 70 71 72 11 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 20 66 95 96 97 9 99 100 10...
output:
0 1 1 1 2 1 0 0 8 1 1 0 0 1 1 2 3 1 1 1 1 3 1 0 1 2 0 2 0 8 1 0 2 1 0 2 1 1 3 0 0 1 0 1 0 1 0 0 1 0 2 0 0 3 0 0 0 3 2 0 3 0 5 0 13 5 0 0 7 4 1 0 0 0 1 0 3 0 0 7 0 0 6 0 9 3 8 0 3 7 7 0 15 1 0 8 0 1 6 10 10 0 2 1 0 0 0 3 0 2 6 3 0 3 0 0 2 7 2 0 2 6 17 2 0 0 0 0 0
result:
ok 129 numbers
Test #4:
score: 10
Accepted
time: 1ms
memory: 7964kb
input:
246 250 113 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 6 1 0 1 0 2 0 2 1 1 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 1 0 0 0 0 0 0 0 0 0 0 0 0
result:
ok 128 numbers
Test #5:
score: 10
Accepted
time: 1ms
memory: 7948kb
input:
249 250 47 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 1 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 1 1 70 71 1 73 74 75 76 1 78 1 80 1 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 1 99 1 101 1 1...
output:
1 1 1 1 0 1 0 1 0 0 0 1 1 0 1 1 0 1 1 1 0 0 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 0 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
result:
ok 118 numbers
Test #6:
score: 10
Accepted
time: 1ms
memory: 7964kb
input:
250 250 95 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 14 5 98 99 5 ...
output:
1 1 1 1 0 1 1 0 0 1 0 0 0 1 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0
result:
ok 121 numbers
Test #7:
score: 10
Accepted
time: 0ms
memory: 7884kb
input:
250 245 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 26 27 28 29 1 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 1 49 50 51 52 53 1 55 56 57 1 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 1 80 81 82 83 84 85 86 87 88 89 1 91 92 93 94 95 96 97 98 1 100 101 1...
output:
1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 4 0 4 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 9 0 0 1 0 0 1 4 0 0 4 0 1 0 0 0 0 2 1 9 0 0 0 7 0 0 2 0 0 0 0 0 0 4 11 0 0 0 0 11 19 1 2 0 0 0 0 0 4 0 0
result:
ok 123 numbers
Test #8:
score: 10
Accepted
time: 1ms
memory: 7956kb
input:
250 250 82 1 1 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
1 1 1 1 0 1 1 0 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 22 0 0 0 0 0 0 0 0 0 0 0 0 36 0 0 18 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
result:
ok 118 numbers
Test #9:
score: 10
Accepted
time: 0ms
memory: 7944kb
input:
250 250 7 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 33 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 26 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 1 1 1 0 0 1 1 0 0 0 0 1 0 1 1 1 1 1 0 1 1 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 3 0 0 0 0 3 0 8 0 6 0 7 0 10 10 10 0 0 0 0 2 0 2 0 0 0 1 0 9 0 2 17 4 1 0 0 0 0 1 0 0 0 2 0 0 1 4 3 0 0 0 0
result:
ok 123 numbers
Test #10:
score: 10
Accepted
time: 1ms
memory: 7940kb
input:
249 246 2 1 2 2 2 5 4 7 1 2 2 11 3 2 3 15 11 7 13 9 20 6 6 13 8 13 26 27 6 5 30 31 32 33 34 35 2 29 38 39 40 21 30 37 44 45 14 25 32 49 50 51 52 15 5 14 37 23 27 59 60 61 51 63 47 12 34 57 34 69 70 49 60 25 3 75 72 51 78 78 80 81 78 83 84 85 86 62 88 89 90 2 92 93 94 95 96 97 41 89 81 87 102 45 14 3...
output:
2 3 0 1 2 9 1 1 2 2 2 3 2 3 0 0 1 1 1 0 2 1 2 1 2 8 0 1 2 0 0 3 0 2 2 0 0 2 3 0 1 6 0 1 3 4 2 2 5 5 0 0 1 1 3 0 1 5 0 3 0 4 6 4 7 6 0 8 1 4 0 0 3 0 0 0 0 3 0 0 7 0 6 4 1 1 2 1 1 1 4 1 0 1 3 1 1 0 1 0 4 0 1 0 0 0 7 6 0 0 0 2 0 1 1 4 1 0 4 9 1 0 4 2 2
result:
ok 125 numbers
Subtask #2:
score: 0
Time Limit Exceeded
Test #11:
score: 10
Accepted
time: 355ms
memory: 9760kb
input:
500000 650 769 1 2 3 4 5 6 7 8 9 10 11 12 7 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 1 0 0 1 1 1 1 1 1 0 0 1 1 0 1 1 1 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 0 0 1 1 0 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 650 numbers
Test #12:
score: 10
Accepted
time: 572ms
memory: 9572kb
input:
500000 499995 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 12 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 55 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
113 133 1 134 138 143 35 117 79 1 55 26 98 190 53 82 1 190 141 4 161 4 82 328 193 160 189 124 32 293 133 133 41 119 50 110 194 67 107 30 131 111 24 91 168 139 0 3 162 70 108 140 72 174 60 1 184 157 184 13 138 52 212 193 172 132 147 200 143 51 179 33 184 104 129 71 58 59 6 86 139 79 159 94 0 56 36 55...
result:
ok 499995 numbers
Test #13:
score: 10
Accepted
time: 1779ms
memory: 9768kb
input:
500000 100000 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 5 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...
output:
648 90 150 309 2 0 23 5 227 190 52 6 0 14 381 1 177 73 11 1 345 191 3 16 246 0 1 828 11 87 9 1 52 260 5 819 3 55 451 138 3 6 94 45 96 8 1 109 692 285 1 328 1 599 6 0 364 190 1 151 132 13 3 19 32 36 0 263 14 3 199 0 487 0 371 0 345 6 111 85 159 17 422 2 343 218 320 801 183 34 3 968 1 93 164 2 32 119 ...
result:
ok 100000 numbers
Test #14:
score: 10
Accepted
time: 15ms
memory: 9816kb
input:
500000 8 56878 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...
output:
1 1 0 0 1 0 1 1
result:
ok 8 numbers
Test #15:
score: 10
Accepted
time: 45ms
memory: 9568kb
input:
499995 62500 8 1 2 3 4 5 6 7 8 2 10 11 12 13 14 15 12 17 18 19 20 21 6 23 24 25 26 27 28 14 30 31 23 33 34 13 36 37 12 39 30 41 15 43 44 20 46 47 48 1 32 51 52 17 54 55 11 57 58 59 60 61 62 63 30 65 66 67 68 69 70 71 72 73 24 75 76 77 1 79 80 81 82 18 73 85 86 87 88 89 90 91 92 93 94 95 54 97 98 99 ...
output:
1 1 0 1 1 0 5 1 1 2 1 0 1 1 1 1 1 1 1 1 2 1 1 1 1 0 1 1 9 1 0 1 1 0 1 1 1 0 0 1 1 0 0 2 1 2 0 0 0 3 7 1 2 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 0 1 4 1 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 0 1 1 1 1 1 0 2 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 5 0 6 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 4 0 0 0 0 1 0 0 0 ...
result:
ok 62500 numbers
Test #16:
score: 10
Accepted
time: 809ms
memory: 9720kb
input:
500000 499999 1 1 2 3 4 5 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 20 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 32 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 27 90 91 92 93 94 95 96 97 98 ...
output:
7 207 7 66 49 163 53 104 45 266 7 17 95 20 112 181 146 1 0 102 157 97 56 76 53 227 124 20 177 11 33 282 208 63 251 198 3 46 91 29 63 78 93 2 69 95 36 95 10 63 245 61 7 5 12 267 0 18 9 10 190 177 135 138 99 10 12 16 14 18 132 13 16 9 3 303 4 9 201 50 184 134 95 11 130 148 111 124 205 103 141 13 252 1...
result:
ok 499999 numbers
Test #17:
score: 10
Accepted
time: 2024ms
memory: 9740kb
input:
500000 55552 9 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...
output:
18 1 2 1 3 3 1 50 0 59 1 1 17 1 0 1 0 17 8 2 1 9 0 0 1 2 8 8 6 2 56 0 6 0 2 4 87 2 2 0 0 14 2 1 45 1 2 17 50 58 38 1 3 9 0 0 0 46 1 9 0 3 12 12 0 51 40 1 1 1 0 15 0 4 59 3 0 1 10 0 7 5 1 1 0 57 131 17 56 0 57 1 7 60 11 87 1 4 1 37 19 57 76 3 0 137 62 0 36 22 0 0 69 0 0 0 0 2 26 16 122 69 35 0 4 0 0 ...
result:
ok 55552 numbers
Test #18:
score: 10
Accepted
time: 57ms
memory: 9708kb
input:
500000 250000 2 1 2 3 4 5 6 1 1 1 10 11 1 1 14 15 16 17 1 1 1 1 1 1 24 1 26 27 1 29 30 31 1 1 34 1 36 37 1 1 1 41 1 1 44 45 1 1 1 1 1 1 1 53 54 1 56 1 1 59 60 1 62 63 1 1 1 1 1 69 70 71 1 1 74 75 76 77 78 1 80 81 1 1 84 85 86 87 88 1 1 1 1 1 94 1 96 1 98 1 1 1 1 1 104 105 1 107 108 109 110 111 1 113...
output:
1 1 0 1 1 0 1 0 1 3 2 1 0 0 0 0 0 0 0 1 1 1 0 1 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1 2 0 1 1 4 0 1 1 0 1 1 2 1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 0 2 1 0 1 0 0 1 1 0 2 1 0 1 1 0 1 1 0 0 0 1 2 1 2 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 ...
result:
ok 250000 numbers
Test #19:
score: 0
Time Limit Exceeded
input:
499996 500000 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
997 577 24 996 4 1 1786 1286 603 11 240 809 929 968 4184 272 27 819 92 718 395 371 181 1344 301 957 472 518 1712 174 2419 933 88 379 2 215 18 975 363 96 125 1643 2 44 1126 214 849 0 205 1524 1183 1797 755 121 1742 473 160 170 34 568 518 938 794 1189 9 2257 302 182 124 81 781 1355 146 110 3741 1250 1...
result:
Subtask #3:
score: 0
Time Limit Exceeded
Test #21:
score: 10
Accepted
time: 78ms
memory: 9724kb
input:
500000 499998 1 1 2 3 4 5 6 7 8 1 1 11 12 13 14 15 16 1 1 19 20 21 22 23 24 1 26 1 28 29 30 1 32 33 34 35 1 37 38 39 40 41 42 43 1 45 46 47 48 49 50 1 52 53 54 55 56 57 1 1 60 61 62 63 64 65 66 67 68 69 1 71 1 73 1 75 76 77 78 79 80 81 82 83 1 1 86 87 88 89 1 91 92 93 94 95 96 97 98 99 100 101 102 1...
output:
2 0 6 4 8 1 3 6 5 1 8 3 11 4 6 1 3 0 2 0 2 0 1 1 3 1 1 3 1 2 1 3 4 5 4 4 5 0 0 4 1 1 5 5 0 0 1 0 1 5 0 0 4 0 0 2 3 5 13 3 3 6 0 9 0 5 1 5 0 0 4 2 4 0 0 4 0 2 6 1 4 1 3 0 1 3 7 1 0 1 5 0 0 0 3 0 0 3 1 7 1 1 0 10 0 5 7 1 0 0 2 0 0 0 0 4 0 3 0 1 5 1 1 0 0 2 0 2 8 4 4 2 4 1 3 14 6 2 5 16 0 0 10 5 0 0 5 ...
result:
ok 250246 numbers
Test #22:
score: 10
Accepted
time: 225ms
memory: 9644kb
input:
499995 499996 1 1 2 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 6 27 28 29 30 31 32 33 34 35 36 37 38 39 37 41 42 27 44 45 46 43 48 49 50 32 52 53 54 55 56 9 58 59 60 61 62 63 64 65 41 67 68 69 70 71 72 73 74 75 76 51 78 79 80 81 82 83 14 85 86 87 88 89 90 61 92 93 94 93 96 97 98 9...
output:
25 119 1 38 5 27 42 23 4 28 29 3 21 23 63 21 34 9 5 56 4 11 56 3 4 32 48 4 39 6 75 44 4 3 52 7 3 71 84 78 10 6 59 25 4 70 90 9 5 52 10 59 3 24 48 28 15 63 76 43 67 1 24 6 29 37 29 50 4 28 47 14 1 4 58 43 34 2 1 23 2 3 35 57 0 52 24 3 22 34 32 2 17 13 38 5 36 0 3 115 61 36 50 61 50 52 11 3 48 4 88 18...
result:
ok 249848 numbers
Test #23:
score: 10
Accepted
time: 109ms
memory: 9544kb
input:
500000 500000 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 1 61 62 63 1 1 66 67 68 69 70 71 72 73 74 75 76 1 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
9 8 11 36 5 1 6 18 25 1 7 20 23 6 2 10 1 4 1 6 3 5 1 2 21 1 2 17 1 0 27 3 36 3 6 8 3 5 3 1 10 21 26 19 0 7 5 14 37 18 31 27 18 18 3 0 1 30 0 36 9 3 5 1 0 12 2 1 0 53 1 7 0 9 7 11 0 18 34 1 18 22 19 7 1 4 8 1 4 4 3 8 1 6 0 0 16 15 12 6 10 4 16 0 10 4 0 17 2 0 37 3 12 2 6 43 3 17 32 5 5 6 19 0 5 3 4 2...
result:
ok 249445 numbers
Test #24:
score: 0
Time Limit Exceeded
input:
500000 500000 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
17672 25594 24568 36011 16778 68155 51386 2299 1 727 27893 112385 59514 9221 87735 5482 7401 5909 66693 15958 8958 8439 18126 16553 7925 22449 38 35874 4427 140733 9113 2 49766 31636 11655 58122 49282 14144 27748 3741 26121 38539 125007 30785 3224 12580 11780 80245 82717 21451 11646 14234 13585 1832...
result:
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Time Limit Exceeded
Test #41:
score: 10
Accepted
time: 13ms
memory: 9816kb
input:
499997 9 40060 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...
output:
1 1 0 0 1 0
result:
ok 6 numbers
Test #42:
score: 10
Accepted
time: 371ms
memory: 9808kb
input:
500000 21 23702 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
1 1 1 0 1 0
result:
ok 6 numbers
Test #43:
score: 10
Accepted
time: 1047ms
memory: 9660kb
input:
500000 20 24356 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
1 0 0 1 1 0 1 8454 1
result:
ok 9 numbers
Test #44:
score: 10
Accepted
time: 15ms
memory: 9812kb
input:
500000 20 20150 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
1 1 1 1 0 1 0 1 1 0
result:
ok 10 numbers
Test #45:
score: 10
Accepted
time: 8ms
memory: 9808kb
input:
499998 22 20008 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
1 1 1 0 1 1 1 0 1 1 1 0 0 1 1
result:
ok 15 numbers
Test #46:
score: 10
Accepted
time: 13ms
memory: 9632kb
input:
500000 24 20019 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
1 0 1 1 0 16 0 1 1
result:
ok 9 numbers
Test #47:
score: 10
Accepted
time: 5ms
memory: 9684kb
input:
499995 17 29083 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
0 1 0 0 1 0
result:
ok 6 numbers
Test #48:
score: 0
Time Limit Exceeded
input:
499999 4 104570 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
result:
Subtask #6:
score: 0
Time Limit Exceeded
Test #51:
score: 0
Time Limit Exceeded
input:
500000 62500 8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...
output:
401 4604 1323 306 4495 376 586 755 1378 93 4870 2851 11048 323 394 285 38 3851 2964 10676 877 2741 5036 921 243 436 3738 638 594 620 5202 644 342 1969 1899 87 779 106 3665 3770 20 227 198 85 1504 1455 3 124 591 11012 33 50 36374 0 10596 188 192 28 29 177 417 2141 21266 153 728 2 2 1215 10296 0 0 630...
result:
Subtask #7:
score: 0
Time Limit Exceeded
Test #61:
score: 0
Time Limit Exceeded
input:
500000 100000 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
4 17986 30064 174788 38161 211015 106448 91622 13037 95529 151167 65689 66396 156390 28230 176115 272339 89286 141946 222298 17188 18213 11792 181011 84012 52257 5989 7 124253 93612 38134 153437 28244 265895 49422 144945 116186 6479 39619 48047 258474 169068 66514 134304 108561 96952 184906 38445 12...
result:
Subtask #8:
score: 10
Accepted
Test #71:
score: 10
Accepted
time: 3ms
memory: 8100kb
input:
25000 2500 10 1 2 3 4 5 6 7 8 9 10 1 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99...
output:
1 1 1 4 1 1 1 1 0 2 21 1 1 1 1 1 6 1 3 1 2 0 0 1 2 2 2 1 0 1 1 2 0 14 2 0 1 0 1 1 0 1 1 3 1 1 2 1 3 2 0 0 0 0 0 0 0 0 0 0 0 2 1 1 1 0 0 0 1 0 0 0 19 0 4 0 0 0 1 1 0 0 0 0 0 1 0 1 1 2 2 0 30 0 4 3 0 1 0 0 0 0 0 3 3 0 1 1 1 1 0 0 0 2 4 0 0 1 0 0 0 1 13 0 0 1 0 1 0 0 3 0 0 0 0 0 39 2 0 0 0 0 0 2 0 0 0 ...
result:
ok 1310 numbers
Test #72:
score: 10
Accepted
time: 0ms
memory: 8096kb
input:
25000 3570 7 1 2 2 4 5 4 6 1 2 1 2 4 9 6 5 16 17 7 19 15 20 22 10 24 25 20 25 12 12 30 31 32 11 34 35 25 37 38 39 15 41 42 43 32 27 28 47 48 21 12 29 2 5 54 55 4 6 6 59 25 61 57 63 64 65 26 57 37 69 48 49 72 73 74 57 72 77 37 79 6 81 82 83 84 21 55 61 88 78 76 91 92 39 69 95 7 84 98 55 100 101 94 24...
output:
1 1 0 1 0 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 1 1 1 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 1759 numbers
Test #73:
score: 10
Accepted
time: 36ms
memory: 5976kb
input:
25000 3125 8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99...
output:
1 1 0 1 1 0 0 2 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 1 1 0 1 0 0 2 0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 1 1 1 0 1 1 0 1 1 0 4 0 12 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 7 1 0 0 0 0 0 2 0 0 0 3 1 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 1567 numbers
Test #74:
score: 10
Accepted
time: 15ms
memory: 7984kb
input:
25000 2079 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
24 1 2 1 0 2 12 2 1 2 13 2 1 2 7 1 1 3 18 5 0 2 1 1 2 1 6 4 1 14 0 11 1 1 12 0 1 2 1 1 1 9 1 2 21 2 0 4 0 3 0 1 2 4 3 6 4 5 3 1 0 1 34 3 0 0 0 1 1 1 0 1 13 0 9 23 4 0 5 5 1 0 2 0 0 1 0 0 16 0 0 0 2 0 4 0 0 0 1 1 1 31 0 1 0 53 1 7 1 0 0 0 20 0 3 16 3 0 0 3 0 0 6 4 0 5 0 0 0 3 70 0 6 0 2 0 0 28 0 1 4 ...
result:
ok 1058 numbers
Test #75:
score: 10
Accepted
time: 199ms
memory: 8120kb
input:
25000 25000 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
2798 2755 1063 1447 7043 8002 2036 2 323 40 262 907 7086 6920 155 472 162 6795 3971 516 3097 127 7608 2551 854 1422 1954 4783 431 6479 1258 1397 513 2080 1258 1548 1576 1875 1116 6050 3485 663 2527 5477 166 272 1470 257 2727 732 2353 5454 353 668 1719 1285 1121 30 465 1275 472 649 4481 5165 4776 251...
result:
ok 12503 numbers
Test #76:
score: 10
Accepted
time: 7ms
memory: 7976kb
input:
25000 12499 2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 1 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99...
output:
29 80 19 98 50 113 4 18 57 22 11 5 15 12 54 42 22 14 8 19 64 39 42 40 2 1 56 6 14 30 26 11 75 26 19 43 138 18 8 27 23 107 13 63 18 39 69 79 34 53 4 23 34 4 15 11 41 6 74 47 37 65 0 41 25 35 34 55 227 8 8 13 75 3 40 89 36 59 45 3 24 42 205 113 24 17 32 5 5 1 36 1 22 57 180 10 75 18 4 3 68 207 1 79 6 ...
result:
ok 6223 numbers
Test #77:
score: 10
Accepted
time: 48ms
memory: 8024kb
input:
25000 3123 8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99...
output:
25 71 1 475 56 73 62 56 20 0 9 425 41 12 0 213 369 4 38 2 44 28 11 58 10 12 59 6 2 1 100 148 0 5 1 16 62 5 129 0 376 185 11 3 7 1 1180 976 13 0 125 2 13 1 16 21 20 236 6 2 310 4 3 650 5 1 0 373 108 17 15 52 16 40 182 28 117 43 9 20 0 46 47 19 12 235 310 127 11 17 159 5 259 122 26 0 30 12 63 25 12 65...
result:
ok 1572 numbers
Test #78:
score: 10
Accepted
time: 0ms
memory: 7952kb
input:
24997 45 496 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99...
output:
1 0 1 0 1 0 0 0 1 0 0 1 1 1 1 1 1 1 218 1 0
result:
ok 21 numbers
Test #79:
score: 10
Accepted
time: 129ms
memory: 7960kb
input:
24997 12500 2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
277 104 13 187 153 3061 566 1967 2176 14 1501 401 171 8 1674 1528 97 313 8 557 1905 232 17 39 88 564 385 32 24 178 45 9 542 947 36 2418 1840 2670 2690 280 2672 179 2 9 94 4 72 6 1272 75 2627 1057 835 1025 2026 1 1133 58 230 1344 382 242 0 2328 71 218 1425 5 33 95 53 645 22 76 25 1393 2 26 676 8 1693...
result:
ok 6313 numbers
Test #80:
score: 10
Accepted
time: 0ms
memory: 8004kb
input:
25000 3571 7 1 2 3 1 5 6 7 8 9 10 11 12 13 1 15 16 17 18 19 20 21 22 23 24 25 26 1 28 29 30 31 32 33 34 35 36 1 38 39 40 41 42 43 44 45 46 47 48 49 50 1 52 53 54 55 56 57 58 59 1 61 62 63 64 65 66 67 68 1 70 71 72 1 74 75 76 77 78 79 80 81 82 83 84 85 86 87 1 89 90 91 92 93 94 95 96 97 98 99 100 101...
output:
1 1 1 1 2 2 1 1 2 0 1 2 1 1 1 0 2 1 1 1 1 1 1 1 0 2 5 2 1 2 0 1 0 1 1 0 1 0 1 0 0 0 0 4 1 1 1 1 0 1 4 0 0 1 0 0 3 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 3 0 0 0 0 0 0 0 2 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 1783 numbers
Subtask #9:
score: 0
Time Limit Exceeded
Dependency #8:
100%
Accepted
Test #81:
score: 10
Accepted
time: 2090ms
memory: 9032kb
input:
250000 13888 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
1 0 1 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 1 1 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 6992 numbers
Test #82:
score: 10
Accepted
time: 832ms
memory: 8844kb
input:
250000 501 499 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...
output:
0 0 0 1 1 1 1 1 1 1 1 0 0 1 0 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 10 0 10 4 0 0 7 0 0 2 75 112 0 18 7 0 32 7 0 219 421 0 0 0 410 314 0 2 252 0 7 503 528 11 629 455 2 0 28 455 13 2 0 ...
result:
ok 237 numbers
Test #83:
score: 10
Accepted
time: 2ms
memory: 8708kb
input:
250000 22 11183 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
1 0 1 0 1 1 1
result:
ok 7 numbers
Test #84:
score: 10
Accepted
time: 98ms
memory: 8732kb
input:
250000 25000 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...
output:
0 5 5 2 14 19 1 7 2 1 1 84 3 1 1 49 5 3 1 2 1 4 2 12 4 5 4 0 3 1 5 2 7 5 4 1 1 5 0 0 5 6 0 4 1 1 40 7 3 1 4 17 0 0 0 4 1 31 8 4 1 4 0 0 8 0 2 3 21 2 7 0 1 0 0 0 13 3 9 0 0 0 0 10 1 0 3 5 0 0 6 8 0 0 4 4 2 0 9 2 16 4 3 0 0 3 9 0 1 3 1 0 17 51 0 8 0 2 0 3 1 0 30 7 0 0 0 0 2 0 0 5 1 5 0 6 0 16 1 36 0 1...
result:
ok 12442 numbers
Test #85:
score: 10
Accepted
time: 415ms
memory: 8980kb
input:
250000 5 44600 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...
output:
1 1
result:
ok 2 number(s): "1 1"
Test #86:
score: 10
Accepted
time: 622ms
memory: 8892kb
input:
249999 125000 2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
333 39 1273 1280 1946 808 56 49 214 816 301 1254 1106 52 425 485 157 368 1282 2018 563 394 1459 984 1036 564 1092 278 1731 29 98 506 778 1184 1268 2355 1494 474 187 581 393 253 347 941 545 953 610 639 556 348 82 127 329 180 634 721 927 262 602 994 811 2404 1832 480 234 369 320 1016 295 457 477 335 6...
result:
ok 62442 numbers
Test #87:
score: 0
Time Limit Exceeded
input:
249999 83333 3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...
output:
4381 2 807 1364 18 926 14583 45 186 4745 797 871 2 3803 280 628 10 266 927 264 705 4853 80 891 20125 12395 76 6 3645 3227 277 6 0 80 1509 615 3455 52 140 33 552 7 25 304 10142 862 1817 1429 989 9 5473 158 9 4 3543 9591 2447 278 4626 280 6029 8 43 7657 6732 1073 58 3592 1687 44 2900 5613 2587 28 409 ...
result:
Subtask #10:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%