用户输出
2
8 48
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#103556 | #1429. [L1-6] 序列变换 | Accepted | 100 | 82 ms | 2020 K | C++ 17 / 876 B | 7k1danWhen | 2024-03-19 0:30:46 |
#include <bits/stdc++.h>
using namespace std;
//#define ONLINE
#ifndef ONLINE
#define debug(...) fprintf(stderr, ##__VA_ARGS__)
#else
#define debug(...) ;
#endif
using LL = long long;
using PII = pair<int, int>;
template <typename T>
inline T READ() {
T x = 0;
bool f = 0;
char c = getchar();
while (c < '0' || c > '9') f |= (c == '-'), c = getchar();
while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
return f ? -x : x;
}
inline int read() { return READ<int>(); }
inline LL readLL() { return READ<LL>(); }
void solve() {
int n = read();
vector<LL> b(n + 1, 0), a(n + 10, 0);
for (int i = 1; i <= n; i++) b[i] = read();
if (n & 1) {
cout << "Inf";
return;
}
for (int i = 1; i <= n; i += 2) {
a[i + 1] = b[i] - a[i - 1];
}
for (int i = n; i > 0; i -= 2) {
a[i - 1] = b[i] - a[i + 1];
}
printf("%d\n", n);
for (int i = 1; i <= n; i++) printf("%lld ", a[i]);
}
int main() {
for (int T = 1; T--;) solve();
return 0;
}
用户输出
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
<1011714 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
<1011521 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
<1012098 bytes omitted>
系统信息
Exited with return code 0