用户输出
2
8 48
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#103372 | #1429. [L1-6] 序列变换 | Accepted | 100 | 99 ms | 2020 K | C++ 17 (Clang) / 705 B | 焱 | 2024-03-17 20:04:20 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve() {
int n;
cin >> n;
vector<int> tip(n + 1);
for (int i = 1; i <= n; i++) {
cin >> tip[i];
}
if (n % 2) {
cout << "Inf"
<< "\n";
return;
}
vector<int> ans(n + 1);
int las = 0;
for (int i = 1; i <= n; i += 2) {
ans[i + 1] = tip[i] - las;
las = ans[i + 1];
}
las = 0;
for (int i = n; i >= 1; i -= 2) {
ans[i - 1] = tip[i] - las;
las = ans[i - 1];
}
cout << n << "\n";
for (int i = 1; i <= n; i++) {
cout << ans[i] << " ";
}
cout << "\n";
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
}
用户输出
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
<4166 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
<4156 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
<1011715 bytes omitted>
系统信息
Exited with return code 0
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
<1011522 bytes omitted>
系统信息
Exited with return code 0
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
<1012099 bytes omitted>
系统信息
Exited with return code 0