用户输出
11
1 1 1 -11 1 -5 0 6 1 3 1
Special Judge 信息
Wrong Answer | Sum from r[1] to r[6] is not positive.
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#24227 | #1145. ddd 和渡渡鸟 | Wrong Answer | 0 | 247 ms | 13360 K | C++ 11 / 1.1 K | YangDavid | 2020-04-22 22:59:55 |
// code with bugs
#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
const int MAXN = 606060;
int in[MAXN][2], out[MAXN][2], val[MAXN];
int main() {
memset(in, -1, sizeof in);
memset(out, -1, sizeof out);
int a, b, ans, cloc = 0;
cin >> a >> b;
ans = a + b - gcd(a, b) - 1;
queue<int> q;
for (int i = 0; i <= ans; ++i) {
if (i + a <= ans)
out[i][0] = i + a, in[i + a][0] = i;
if (i - b >= 0)
out[i][1] = i - b, out[i - b][0] = i;
if (in[i][0] == -1 && in[i][1] == -1)
q.push(i);
}
while (!q.empty()) {
int u = q.front(), v;
q.pop();
val[u] = cloc++;
if (out[u][0] != -1) {
v = out[u][0];
in[u][0] = out[u][0] = -1;
if (in[v][1] == -1)
q.push(v);
}
if (out[u][1] != -1) {
v = out[u][1];
in[v][1] = out[u][1] = -1;
if (in[v][0] == -1)
q.push(v);
}
}
printf("%d\n", ans);
for (int i = 1; i <= ans; ++i) printf("%d ", val[i] - val[i - 1]);
return 0;
}
用户输出
11
1 1 1 -11 1 -5 0 6 1 3 1
Special Judge 信息
Wrong Answer | Sum from r[1] to r[6] is not positive.
系统信息
Exited with return code 0
419
36 36 36 36 36 36 36 36 36 36 -385 36 36 36 36 36 36 36 36 36 36 36 -385 36 36 36 36 36 36 36 36
<1231 bytes omitted>
用户输出
419
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
<717 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[152] is not negative.
系统信息
Exited with return code 0
11223
3929 -7296 3929 3929 -7296 3929 3929 -7296 3929 3929 -7296 3929 3929 -7296 3929 3929 -7296 392
<59949 bytes omitted>
用户输出
11223
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
<22342 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[4494] is not positive.
系统信息
Exited with return code 0
174689
1 1 1 1 1 1 1 1 -46349 1 1 1 1 1 1 1 1 -46349 1 1 1 1 1 1 1 1 128350 1 1 1 1 1 1 1 1 -46349 1
<446330 bytes omitted>
用户输出
174689
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
<349263 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[79020] is not negative.
系统信息
Exited with return code 0
188827
1 -51075 1 -51075 1 137755 1 -51075 1 -51075 1 -51075 1 137755 1 -51075 1 -51075 1 -51075 1 1
<849626 bytes omitted>
用户输出
188827
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
<377539 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[37556] is not negative.
系统信息
Exited with return code 0
210661
1 -33215 1 -33215 1 -33215 1 -33215 1 -33215 1 177449 1 -33215 1 -33215 1 -33215 1 -33215 1 -
<947879 bytes omitted>
用户输出
210661
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
<421314 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[17290] is not positive.
系统信息
Exited with return code 0
366169
1 1 1 1 1 1 -102157 1 1 1 1 1 1 -102157 1 1 1 1 1 1 264020 1 1 1 1 1 1 -102157 1 1 1 1 1 1 -1
<1031507 bytes omitted>
用户输出
366169
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
<732256 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[119441] is not positive.
系统信息
Exited with return code 0
399999
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
<799921 bytes omitted>
用户输出
399999
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
<799883 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[300000] is not positive.
系统信息
Exited with return code 0
599997
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
<1199907 bytes omitted>
用户输出
599997
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
<1199879 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[300000] is not positive.
系统信息
Exited with return code 0
599997
-2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
<1799902 bytes omitted>
用户输出
599997
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
<1199890 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[299999] is not positive.
系统信息
Exited with return code 0