#include <bits/stdc++.h>
using namespace std;
int n;
long long d[200001];
long long p[200001];
int dp[200001][2];
int ans(int ind,int type) {
if (ind==n) {
return 0;
}
if (dp[ind][type]!=-1) {
return dp[ind][type];
}
int ret=1e6;
if (type==1&&p[ind+1]==p[ind]+d[ind+1]-d[ind]) {
ret=min(ret,ans(ind+1,1));
}
if (type==0&&p[ind+1]==p[ind]-d[ind+1]+d[ind]) {
ret=min(ret,ans(ind+1,0));
}
ret=min(ret,ans(ind+1,1-type)+1);
return dp[ind][type]=ret;
}
int main(void) {
scanf("%d",&n);
for(int i=1;i<=n;i++) {
scanf("%lld %lld",&d[i],&p[i]);
}
for(int i=1;i<=n;i++) {
if (((d[i-1]+p[i-1])&1)!=((d[i]+p[i])&1)) {
printf("-1");
return 0;
}
if (abs(d[i]-d[i-1])<abs(p[i]-p[i-1])) {
printf("-1");
return 0;
}
}
memset(dp,-1,sizeof(dp));
printf("%d\n",min(ans(0,0),ans(0,1))+1);
int now=min(ans(0,0),ans(0,1));
int type;
if (ans(0,0)<ans(0,1)) {
type=0;
}
else {
type=1;
}
int prev=0;
for(int i=1;i<=n;i++) {
if (type==0&&p[i-1]-d[i]+d[i-1]==p[i]&&ans(i,type)==now) {
continue;
}
else if (type==1&&p[i-1]+d[i]-d[i-1]==p[i]&&ans(i,type)==now) {
continue;
}
else {
int t;
if (type==0) {
t=d[i-1]+(d[i]-d[i-1]-p[i]+p[i-1])/2;
}
else {
t=d[i-1]+(d[i]-d[i-1]+p[i]-p[i-1])/2;
}
printf("%d",t-prev);
printf(" %c\n",type==0?'-':'+');
prev=t;
type=1-type;
now--;
}
}
printf("%d",d[n]-prev);
printf(" %c\n",type==0?'-':'+');
}
Compilation message
Main.cpp: In function 'int main()':
Main.cpp:75:14: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
75 | printf("%d",d[n]-prev);
| ~^ ~~~~~~~~~
| | |
| int long long int
| %lld
Main.cpp:28:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
28 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
Main.cpp:30:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
30 | scanf("%lld %lld",&d[i],&p[i]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1924 KB |
OK, n=2 ans=1 |
2 |
Correct |
1 ms |
1868 KB |
OK, n=3 ans=1 |
3 |
Correct |
1 ms |
1868 KB |
OK, n=1 ans=1 |
4 |
Correct |
1 ms |
1868 KB |
OK, n=5 ans=1 |
5 |
Correct |
1 ms |
1868 KB |
OK, n=8 ans=1 |
6 |
Correct |
1 ms |
1868 KB |
OK, n=88 ans=1 |
7 |
Correct |
1 ms |
1868 KB |
OK, n=888 ans=1 |
8 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
9 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
10 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
11 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
12 |
Correct |
1 ms |
1868 KB |
OK, n=2 ans=1 |
13 |
Correct |
1 ms |
1868 KB |
OK, n=34 ans=1 |
14 |
Correct |
1 ms |
1868 KB |
OK, n=567 ans=1 |
15 |
Correct |
2 ms |
1928 KB |
OK, n=1234 ans=1 |
16 |
Correct |
0 ms |
204 KB |
OK, no solution, n=2 |
17 |
Correct |
0 ms |
204 KB |
OK, no solution, n=3 |
18 |
Correct |
0 ms |
204 KB |
OK, no solution, n=40 |
19 |
Correct |
1 ms |
204 KB |
OK, no solution, n=118 |
20 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
21 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1924 KB |
OK, n=2 ans=1 |
2 |
Correct |
1 ms |
1868 KB |
OK, n=3 ans=1 |
3 |
Correct |
1 ms |
1868 KB |
OK, n=1 ans=1 |
4 |
Correct |
1 ms |
1868 KB |
OK, n=5 ans=1 |
5 |
Correct |
1 ms |
1868 KB |
OK, n=8 ans=1 |
6 |
Correct |
1 ms |
1868 KB |
OK, n=88 ans=1 |
7 |
Correct |
1 ms |
1868 KB |
OK, n=888 ans=1 |
8 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
9 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
10 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
11 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
12 |
Correct |
1 ms |
1868 KB |
OK, n=2 ans=1 |
13 |
Correct |
1 ms |
1868 KB |
OK, n=34 ans=1 |
14 |
Correct |
1 ms |
1868 KB |
OK, n=567 ans=1 |
15 |
Correct |
2 ms |
1928 KB |
OK, n=1234 ans=1 |
16 |
Correct |
0 ms |
204 KB |
OK, no solution, n=2 |
17 |
Correct |
0 ms |
204 KB |
OK, no solution, n=3 |
18 |
Correct |
0 ms |
204 KB |
OK, no solution, n=40 |
19 |
Correct |
1 ms |
204 KB |
OK, no solution, n=118 |
20 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
21 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
22 |
Correct |
2 ms |
1740 KB |
OK, n=2 ans=2 |
23 |
Correct |
1 ms |
1868 KB |
OK, n=3 ans=2 |
24 |
Correct |
1 ms |
1868 KB |
OK, n=4 ans=1 |
25 |
Correct |
1 ms |
1868 KB |
OK, n=5 ans=2 |
26 |
Correct |
1 ms |
1868 KB |
OK, n=8 ans=2 |
27 |
Correct |
1 ms |
1868 KB |
OK, n=88 ans=2 |
28 |
Correct |
1 ms |
1868 KB |
OK, n=888 ans=2 |
29 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
30 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
31 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
32 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
33 |
Correct |
1 ms |
1740 KB |
OK, n=2 ans=1 |
34 |
Correct |
1 ms |
1868 KB |
OK, n=34 ans=2 |
35 |
Correct |
1 ms |
1868 KB |
OK, n=567 ans=2 |
36 |
Correct |
2 ms |
1868 KB |
OK, n=1234 ans=2 |
37 |
Correct |
1 ms |
204 KB |
OK, no solution, n=6 |
38 |
Correct |
1 ms |
204 KB |
OK, no solution, n=10 |
39 |
Correct |
1 ms |
204 KB |
OK, no solution, n=50 |
40 |
Correct |
1 ms |
204 KB |
OK, no solution, n=333 |
41 |
Correct |
2 ms |
332 KB |
OK, no solution, n=2000 |
42 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
43 |
Correct |
1 ms |
1868 KB |
OK, n=1 ans=2 |
44 |
Correct |
1 ms |
1868 KB |
OK, n=1 ans=2 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1924 KB |
OK, n=2 ans=1 |
2 |
Correct |
1 ms |
1868 KB |
OK, n=3 ans=1 |
3 |
Correct |
1 ms |
1868 KB |
OK, n=1 ans=1 |
4 |
Correct |
1 ms |
1868 KB |
OK, n=5 ans=1 |
5 |
Correct |
1 ms |
1868 KB |
OK, n=8 ans=1 |
6 |
Correct |
1 ms |
1868 KB |
OK, n=88 ans=1 |
7 |
Correct |
1 ms |
1868 KB |
OK, n=888 ans=1 |
8 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
9 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
10 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
11 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
12 |
Correct |
1 ms |
1868 KB |
OK, n=2 ans=1 |
13 |
Correct |
1 ms |
1868 KB |
OK, n=34 ans=1 |
14 |
Correct |
1 ms |
1868 KB |
OK, n=567 ans=1 |
15 |
Correct |
2 ms |
1928 KB |
OK, n=1234 ans=1 |
16 |
Correct |
0 ms |
204 KB |
OK, no solution, n=2 |
17 |
Correct |
0 ms |
204 KB |
OK, no solution, n=3 |
18 |
Correct |
0 ms |
204 KB |
OK, no solution, n=40 |
19 |
Correct |
1 ms |
204 KB |
OK, no solution, n=118 |
20 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
21 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
22 |
Correct |
1 ms |
1868 KB |
OK, n=4 ans=2 |
23 |
Correct |
1 ms |
1868 KB |
OK, n=6 ans=2 |
24 |
Correct |
1 ms |
1868 KB |
OK, n=15 ans=2 |
25 |
Correct |
1 ms |
1868 KB |
OK, n=200 ans=2 |
26 |
Correct |
1 ms |
1868 KB |
OK, n=1000 ans=2 |
27 |
Correct |
4 ms |
2636 KB |
OK, n=10000 ans=2 |
28 |
Correct |
44 ms |
9656 KB |
OK, n=100000 ans=2 |
29 |
Correct |
47 ms |
14276 KB |
OK, n=159807 ans=2 |
30 |
Correct |
59 ms |
17408 KB |
OK, n=200000 ans=2 |
31 |
Correct |
63 ms |
17488 KB |
OK, n=200000 ans=2 |
32 |
Correct |
67 ms |
17496 KB |
OK, n=200000 ans=2 |
33 |
Correct |
1 ms |
1868 KB |
OK, n=3 ans=2 |
34 |
Correct |
1 ms |
1868 KB |
OK, n=45 ans=2 |
35 |
Correct |
1 ms |
1868 KB |
OK, n=789 ans=2 |
36 |
Correct |
2 ms |
1996 KB |
OK, n=2345 ans=2 |
37 |
Correct |
23 ms |
7108 KB |
OK, n=67890 ans=2 |
38 |
Correct |
34 ms |
2704 KB |
OK, no solution, n=159807 |
39 |
Correct |
48 ms |
3332 KB |
OK, no solution, n=200000 |
40 |
Correct |
49 ms |
3364 KB |
OK, no solution, n=200000 |
41 |
Correct |
50 ms |
3372 KB |
OK, no solution, n=200000 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1868 KB |
OK, n=5 ans=3 |
2 |
Correct |
1 ms |
1868 KB |
OK, n=10 ans=4 |
3 |
Correct |
1 ms |
1868 KB |
OK, n=20 ans=5 |
4 |
Correct |
1 ms |
1868 KB |
OK, n=50 ans=9 |
5 |
Correct |
1 ms |
1868 KB |
OK, n=100 ans=18 |
6 |
Correct |
2 ms |
1868 KB |
OK, n=200 ans=46 |
7 |
Correct |
1 ms |
1868 KB |
OK, n=100 ans=5 |
8 |
Correct |
1 ms |
1868 KB |
OK, n=200 ans=20 |
9 |
Correct |
1 ms |
1868 KB |
OK, n=400 ans=76 |
10 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=196 |
11 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=434 |
12 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=582 |
13 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=798 |
14 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=867 |
15 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=200 |
16 |
Correct |
2 ms |
1996 KB |
OK, n=1998 ans=500 |
17 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=800 |
18 |
Correct |
2 ms |
1996 KB |
OK, n=1995 ans=1000 |
19 |
Correct |
2 ms |
2028 KB |
OK, n=2000 ans=1500 |
20 |
Correct |
3 ms |
1996 KB |
OK, n=2000 ans=2000 |
21 |
Correct |
1 ms |
204 KB |
OK, no solution, n=10 |
22 |
Correct |
1 ms |
204 KB |
OK, no solution, n=50 |
23 |
Correct |
1 ms |
204 KB |
OK, no solution, n=400 |
24 |
Correct |
1 ms |
332 KB |
OK, no solution, n=1000 |
25 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
26 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
27 |
Correct |
1 ms |
1868 KB |
OK, n=4 ans=5 |
28 |
Correct |
1 ms |
1868 KB |
OK, n=30 ans=31 |
29 |
Correct |
2 ms |
1868 KB |
OK, n=500 ans=501 |
30 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=1001 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1924 KB |
OK, n=2 ans=1 |
2 |
Correct |
1 ms |
1868 KB |
OK, n=3 ans=1 |
3 |
Correct |
1 ms |
1868 KB |
OK, n=1 ans=1 |
4 |
Correct |
1 ms |
1868 KB |
OK, n=5 ans=1 |
5 |
Correct |
1 ms |
1868 KB |
OK, n=8 ans=1 |
6 |
Correct |
1 ms |
1868 KB |
OK, n=88 ans=1 |
7 |
Correct |
1 ms |
1868 KB |
OK, n=888 ans=1 |
8 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
9 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
10 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
11 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
12 |
Correct |
1 ms |
1868 KB |
OK, n=2 ans=1 |
13 |
Correct |
1 ms |
1868 KB |
OK, n=34 ans=1 |
14 |
Correct |
1 ms |
1868 KB |
OK, n=567 ans=1 |
15 |
Correct |
2 ms |
1928 KB |
OK, n=1234 ans=1 |
16 |
Correct |
0 ms |
204 KB |
OK, no solution, n=2 |
17 |
Correct |
0 ms |
204 KB |
OK, no solution, n=3 |
18 |
Correct |
0 ms |
204 KB |
OK, no solution, n=40 |
19 |
Correct |
1 ms |
204 KB |
OK, no solution, n=118 |
20 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
21 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
22 |
Correct |
2 ms |
1740 KB |
OK, n=2 ans=2 |
23 |
Correct |
1 ms |
1868 KB |
OK, n=3 ans=2 |
24 |
Correct |
1 ms |
1868 KB |
OK, n=4 ans=1 |
25 |
Correct |
1 ms |
1868 KB |
OK, n=5 ans=2 |
26 |
Correct |
1 ms |
1868 KB |
OK, n=8 ans=2 |
27 |
Correct |
1 ms |
1868 KB |
OK, n=88 ans=2 |
28 |
Correct |
1 ms |
1868 KB |
OK, n=888 ans=2 |
29 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
30 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
31 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
32 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
33 |
Correct |
1 ms |
1740 KB |
OK, n=2 ans=1 |
34 |
Correct |
1 ms |
1868 KB |
OK, n=34 ans=2 |
35 |
Correct |
1 ms |
1868 KB |
OK, n=567 ans=2 |
36 |
Correct |
2 ms |
1868 KB |
OK, n=1234 ans=2 |
37 |
Correct |
1 ms |
204 KB |
OK, no solution, n=6 |
38 |
Correct |
1 ms |
204 KB |
OK, no solution, n=10 |
39 |
Correct |
1 ms |
204 KB |
OK, no solution, n=50 |
40 |
Correct |
1 ms |
204 KB |
OK, no solution, n=333 |
41 |
Correct |
2 ms |
332 KB |
OK, no solution, n=2000 |
42 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
43 |
Correct |
1 ms |
1868 KB |
OK, n=1 ans=2 |
44 |
Correct |
1 ms |
1868 KB |
OK, n=1 ans=2 |
45 |
Correct |
1 ms |
1868 KB |
OK, n=5 ans=3 |
46 |
Correct |
1 ms |
1868 KB |
OK, n=10 ans=4 |
47 |
Correct |
1 ms |
1868 KB |
OK, n=20 ans=5 |
48 |
Correct |
1 ms |
1868 KB |
OK, n=50 ans=9 |
49 |
Correct |
1 ms |
1868 KB |
OK, n=100 ans=18 |
50 |
Correct |
2 ms |
1868 KB |
OK, n=200 ans=46 |
51 |
Correct |
1 ms |
1868 KB |
OK, n=100 ans=5 |
52 |
Correct |
1 ms |
1868 KB |
OK, n=200 ans=20 |
53 |
Correct |
1 ms |
1868 KB |
OK, n=400 ans=76 |
54 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=196 |
55 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=434 |
56 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=582 |
57 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=798 |
58 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=867 |
59 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=200 |
60 |
Correct |
2 ms |
1996 KB |
OK, n=1998 ans=500 |
61 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=800 |
62 |
Correct |
2 ms |
1996 KB |
OK, n=1995 ans=1000 |
63 |
Correct |
2 ms |
2028 KB |
OK, n=2000 ans=1500 |
64 |
Correct |
3 ms |
1996 KB |
OK, n=2000 ans=2000 |
65 |
Correct |
1 ms |
204 KB |
OK, no solution, n=10 |
66 |
Correct |
1 ms |
204 KB |
OK, no solution, n=50 |
67 |
Correct |
1 ms |
204 KB |
OK, no solution, n=400 |
68 |
Correct |
1 ms |
332 KB |
OK, no solution, n=1000 |
69 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
70 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
71 |
Correct |
1 ms |
1868 KB |
OK, n=4 ans=5 |
72 |
Correct |
1 ms |
1868 KB |
OK, n=30 ans=31 |
73 |
Correct |
2 ms |
1868 KB |
OK, n=500 ans=501 |
74 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=1001 |
75 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
76 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
77 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=4 |
78 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=10 |
79 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=21 |
80 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=66 |
81 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=200 |
82 |
Correct |
3 ms |
1996 KB |
OK, n=2000 ans=454 |
83 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=666 |
84 |
Correct |
3 ms |
1996 KB |
OK, n=2000 ans=818 |
85 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1027 |
86 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1198 |
87 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
88 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
89 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
90 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
91 |
Correct |
1 ms |
1868 KB |
OK, n=20 ans=21 |
92 |
Correct |
1 ms |
1868 KB |
OK, n=300 ans=301 |
93 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=1001 |
94 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2001 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1924 KB |
OK, n=2 ans=1 |
2 |
Correct |
1 ms |
1868 KB |
OK, n=3 ans=1 |
3 |
Correct |
1 ms |
1868 KB |
OK, n=1 ans=1 |
4 |
Correct |
1 ms |
1868 KB |
OK, n=5 ans=1 |
5 |
Correct |
1 ms |
1868 KB |
OK, n=8 ans=1 |
6 |
Correct |
1 ms |
1868 KB |
OK, n=88 ans=1 |
7 |
Correct |
1 ms |
1868 KB |
OK, n=888 ans=1 |
8 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
9 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
10 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
11 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
12 |
Correct |
1 ms |
1868 KB |
OK, n=2 ans=1 |
13 |
Correct |
1 ms |
1868 KB |
OK, n=34 ans=1 |
14 |
Correct |
1 ms |
1868 KB |
OK, n=567 ans=1 |
15 |
Correct |
2 ms |
1928 KB |
OK, n=1234 ans=1 |
16 |
Correct |
0 ms |
204 KB |
OK, no solution, n=2 |
17 |
Correct |
0 ms |
204 KB |
OK, no solution, n=3 |
18 |
Correct |
0 ms |
204 KB |
OK, no solution, n=40 |
19 |
Correct |
1 ms |
204 KB |
OK, no solution, n=118 |
20 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
21 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
22 |
Correct |
2 ms |
1740 KB |
OK, n=2 ans=2 |
23 |
Correct |
1 ms |
1868 KB |
OK, n=3 ans=2 |
24 |
Correct |
1 ms |
1868 KB |
OK, n=4 ans=1 |
25 |
Correct |
1 ms |
1868 KB |
OK, n=5 ans=2 |
26 |
Correct |
1 ms |
1868 KB |
OK, n=8 ans=2 |
27 |
Correct |
1 ms |
1868 KB |
OK, n=88 ans=2 |
28 |
Correct |
1 ms |
1868 KB |
OK, n=888 ans=2 |
29 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
30 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
31 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
32 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
33 |
Correct |
1 ms |
1740 KB |
OK, n=2 ans=1 |
34 |
Correct |
1 ms |
1868 KB |
OK, n=34 ans=2 |
35 |
Correct |
1 ms |
1868 KB |
OK, n=567 ans=2 |
36 |
Correct |
2 ms |
1868 KB |
OK, n=1234 ans=2 |
37 |
Correct |
1 ms |
204 KB |
OK, no solution, n=6 |
38 |
Correct |
1 ms |
204 KB |
OK, no solution, n=10 |
39 |
Correct |
1 ms |
204 KB |
OK, no solution, n=50 |
40 |
Correct |
1 ms |
204 KB |
OK, no solution, n=333 |
41 |
Correct |
2 ms |
332 KB |
OK, no solution, n=2000 |
42 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
43 |
Correct |
1 ms |
1868 KB |
OK, n=1 ans=2 |
44 |
Correct |
1 ms |
1868 KB |
OK, n=1 ans=2 |
45 |
Correct |
1 ms |
1868 KB |
OK, n=4 ans=2 |
46 |
Correct |
1 ms |
1868 KB |
OK, n=6 ans=2 |
47 |
Correct |
1 ms |
1868 KB |
OK, n=15 ans=2 |
48 |
Correct |
1 ms |
1868 KB |
OK, n=200 ans=2 |
49 |
Correct |
1 ms |
1868 KB |
OK, n=1000 ans=2 |
50 |
Correct |
4 ms |
2636 KB |
OK, n=10000 ans=2 |
51 |
Correct |
44 ms |
9656 KB |
OK, n=100000 ans=2 |
52 |
Correct |
47 ms |
14276 KB |
OK, n=159807 ans=2 |
53 |
Correct |
59 ms |
17408 KB |
OK, n=200000 ans=2 |
54 |
Correct |
63 ms |
17488 KB |
OK, n=200000 ans=2 |
55 |
Correct |
67 ms |
17496 KB |
OK, n=200000 ans=2 |
56 |
Correct |
1 ms |
1868 KB |
OK, n=3 ans=2 |
57 |
Correct |
1 ms |
1868 KB |
OK, n=45 ans=2 |
58 |
Correct |
1 ms |
1868 KB |
OK, n=789 ans=2 |
59 |
Correct |
2 ms |
1996 KB |
OK, n=2345 ans=2 |
60 |
Correct |
23 ms |
7108 KB |
OK, n=67890 ans=2 |
61 |
Correct |
34 ms |
2704 KB |
OK, no solution, n=159807 |
62 |
Correct |
48 ms |
3332 KB |
OK, no solution, n=200000 |
63 |
Correct |
49 ms |
3364 KB |
OK, no solution, n=200000 |
64 |
Correct |
50 ms |
3372 KB |
OK, no solution, n=200000 |
65 |
Correct |
1 ms |
1868 KB |
OK, n=5 ans=3 |
66 |
Correct |
1 ms |
1868 KB |
OK, n=10 ans=4 |
67 |
Correct |
1 ms |
1868 KB |
OK, n=20 ans=5 |
68 |
Correct |
1 ms |
1868 KB |
OK, n=50 ans=9 |
69 |
Correct |
1 ms |
1868 KB |
OK, n=100 ans=18 |
70 |
Correct |
2 ms |
1868 KB |
OK, n=200 ans=46 |
71 |
Correct |
1 ms |
1868 KB |
OK, n=100 ans=5 |
72 |
Correct |
1 ms |
1868 KB |
OK, n=200 ans=20 |
73 |
Correct |
1 ms |
1868 KB |
OK, n=400 ans=76 |
74 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=196 |
75 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=434 |
76 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=582 |
77 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=798 |
78 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=867 |
79 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=200 |
80 |
Correct |
2 ms |
1996 KB |
OK, n=1998 ans=500 |
81 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=800 |
82 |
Correct |
2 ms |
1996 KB |
OK, n=1995 ans=1000 |
83 |
Correct |
2 ms |
2028 KB |
OK, n=2000 ans=1500 |
84 |
Correct |
3 ms |
1996 KB |
OK, n=2000 ans=2000 |
85 |
Correct |
1 ms |
204 KB |
OK, no solution, n=10 |
86 |
Correct |
1 ms |
204 KB |
OK, no solution, n=50 |
87 |
Correct |
1 ms |
204 KB |
OK, no solution, n=400 |
88 |
Correct |
1 ms |
332 KB |
OK, no solution, n=1000 |
89 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
90 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
91 |
Correct |
1 ms |
1868 KB |
OK, n=4 ans=5 |
92 |
Correct |
1 ms |
1868 KB |
OK, n=30 ans=31 |
93 |
Correct |
2 ms |
1868 KB |
OK, n=500 ans=501 |
94 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=1001 |
95 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1 |
96 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2 |
97 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=4 |
98 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=10 |
99 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=21 |
100 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=66 |
101 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=200 |
102 |
Correct |
3 ms |
1996 KB |
OK, n=2000 ans=454 |
103 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=666 |
104 |
Correct |
3 ms |
1996 KB |
OK, n=2000 ans=818 |
105 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1027 |
106 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=1198 |
107 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
108 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
109 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
110 |
Correct |
1 ms |
332 KB |
OK, no solution, n=2000 |
111 |
Correct |
1 ms |
1868 KB |
OK, n=20 ans=21 |
112 |
Correct |
1 ms |
1868 KB |
OK, n=300 ans=301 |
113 |
Correct |
2 ms |
1868 KB |
OK, n=1000 ans=1001 |
114 |
Correct |
2 ms |
1996 KB |
OK, n=2000 ans=2001 |
115 |
Correct |
1 ms |
1868 KB |
OK, n=4 ans=3 |
116 |
Correct |
1 ms |
1868 KB |
OK, n=2 ans=2 |
117 |
Correct |
0 ms |
204 KB |
OK, no solution, n=1 |
118 |
Correct |
69 ms |
17476 KB |
OK, n=200000 ans=1 |
119 |
Correct |
63 ms |
17484 KB |
OK, n=200000 ans=2 |
120 |
Correct |
68 ms |
17476 KB |
OK, n=200000 ans=3 |
121 |
Correct |
66 ms |
17400 KB |
OK, n=200000 ans=4 |
122 |
Correct |
63 ms |
17476 KB |
OK, n=200000 ans=5 |
123 |
Correct |
67 ms |
17472 KB |
OK, n=200000 ans=10 |
124 |
Correct |
65 ms |
17472 KB |
OK, n=200000 ans=20 |
125 |
Correct |
65 ms |
17440 KB |
OK, n=200000 ans=74 |
126 |
Correct |
59 ms |
17448 KB |
OK, n=200000 ans=239 |
127 |
Correct |
61 ms |
17396 KB |
OK, n=200000 ans=500 |
128 |
Correct |
61 ms |
17476 KB |
OK, n=200000 ans=3998 |
129 |
Correct |
62 ms |
17460 KB |
OK, n=200000 ans=9964 |
130 |
Correct |
68 ms |
17732 KB |
OK, n=200000 ans=46259 |
131 |
Correct |
84 ms |
18044 KB |
OK, n=200000 ans=103531 |
132 |
Correct |
105 ms |
18228 KB |
OK, n=200000 ans=116810 |
133 |
Correct |
84 ms |
18128 KB |
OK, n=200000 ans=119975 |
134 |
Correct |
63 ms |
3412 KB |
OK, no solution, n=200000 |
135 |
Correct |
47 ms |
3416 KB |
OK, no solution, n=200000 |
136 |
Correct |
47 ms |
3344 KB |
OK, no solution, n=200000 |
137 |
Correct |
47 ms |
3304 KB |
OK, no solution, n=200000 |
138 |
Correct |
46 ms |
3304 KB |
OK, no solution, n=200000 |
139 |
Correct |
59 ms |
3380 KB |
OK, no solution, n=200000 |
140 |
Correct |
90 ms |
18244 KB |
OK, n=200000 ans=200001 |
141 |
Correct |
91 ms |
18664 KB |
OK, n=200000 ans=200001 |