用户输出
2
8 48
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#101734 | #1429. [L1-6] 序列变换 | Time Limit Exceeded | 70 | 4752 ms | 92388 K | Java / 835 B | Shirost | 2024-03-14 22:27:57 |
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
int N = 100000 + 5;
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[N];
int[] b = new int[N];
for (int i = 1; i <= n; ++i) a[i] = sc.nextInt();
sc.close();
if (n % 2 == 1)
System.out.println("Inf");
else {
for (int i = 1; i <= n; i += 2) {
if (i == 1)
b[2] = a[1];
else
b[i + 1] = a[i] - b[i - 1];
}
for (int i = n; i >= 1; i -= 2) {
if (i == n)
b[n - 1] = a[n];
else
b[i - 1] = a[i] - b[i + 1];
}
System.out.println(n);
for (int i = 1; i <= n; ++i)
if (i != n)
System.out.print(b[i] + " ");
else
System.out.println(b[i]);
}
}
}
用户输出
10
-1 0 -1 -1 0 -1 -1 -1 1 1
系统信息
Exited with return code 0
用户输出
10
0 -1 -1 1 0 1 1 -1 -1 -1
系统信息
Exited with return code 0
1000
-293 119 -631 246 -101 -236 -68 25 -606 626 -559 -213 -155 -1 462 806 339 365 -46 496 454 504 6
<4192 bytes omitted>
1000
-32 -293 151 -338 95 237 -331 -305 356 -301 270 -258 -483 103 482 359 324 -20 41 -26 455 480 49
<4192 bytes omitted>
用户输出
1000
-32 -293 151 -338 95 237 -331 -305 356 -301 270 -258 -483 103 482 359 324 -20 41 -26 455 480 49 167 445 -276 -53 -477 -138
<4165 bytes omitted>
系统信息
Exited with return code 0
1000
9 -449 -61 -108 271 -112 739 -80 648 634 -123 531 -361 135 16 -240 154 127 148 529 -190 -213 -8
<4182 bytes omitted>
1000
-210 9 -239 -70 131 341 -243 398 163 250 471 -373 60 12 75 4 -315 150 442 -2 87 -188 -300 107 8
<4182 bytes omitted>
用户输出
1000
-210 9 -239 -70 131 341 -243 398 163 250 471 -373 60 12 75 4 -315 150 442 -2 87 -188 -300 107 81 -390 342 -217 -494 -487 24
<4155 bytes omitted>
系统信息
Exited with return code 0
10001
61 273 120 -18 40 236 -372 50 -666 -99 -791 321 -367 182 507 453 362 19 28 -941 306 -969 671 -
<42744 bytes omitted>
用户输出
Inf
系统信息
Exited with return code 0
100000
-245033200 269057026 -444307583 12738569 -2572768 -10255372 -2437516 -41423001 44403267 -2472
<1016729 bytes omitted>
100000
108942099 -245033200 160114927 -199274383 -147376358 196701615 137120986 -199139131 -17854398
<1011741 bytes omitted>
用户输出
100000
108942099 -245033200 160114927 -199274383 -147376358 196701615 137120986 -199139131 -178543987 243542398 -68747560 220332
<750214 bytes omitted>
100000
142956745 326311724 185848189 102625101 200830050 -115640813 333907651 -166296483 399441282 -
<1015936 bytes omitted>
100000
109781724 142956745 216530000 42891444 -113904899 157938606 -1735914 175969045 -164560569 223
<1011548 bytes omitted>
用户输出
100000
109781724 142956745 216530000 42891444 -113904899 157938606 -1735914 175969045 -164560569 223472237 -223759388 -138607069
<301643 bytes omitted>
100000
-54394293 -28181679 128662233 -260235512 307048828 -340128627 21628743 -100509964 -32690440 2
<1016350 bytes omitted>
100000
110545068 -54394293 -138726747 183056526 -121508765 123992302 -218619862 -102363559 118109898
<1012125 bytes omitted>
用户输出
100000
110545068 -54394293 -138726747 183056526 -121508765 123992302 -218619862 -102363559 118109898 69673119 173468942 84192097
<1012098 bytes omitted>