用户输出
11
3 1 3 1 2 -10 1 1 3 1 3
Special Judge 信息
Wrong Answer | Sum from r[1] to r[6] is not positive.
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#25584 | #1145. ddd 和渡渡鸟 | Wrong Answer | 13 | 1440 ms | 82696 K | C++ 17 / 1.2 K | q3540555 | 2020-05-27 15:22:23 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
const int rge = 2e6;
ll arr[rge], psu[rge], idg[rge];
set<int> odg[rge];
vector<int> rk;
void solve() {
ll a, b;
cin >> a >> b;
ll gab = gcd(a, b);
ll ans = (a / gab) + (b / gab) - 2;
ll n = (ans + 1) * (gab - 1) + ans;
cout << n << endl;
if (n > 1e6)
return;
for (int i = 1; i <= n - a; ++i) ++idg[i], odg[i + a].insert(i);
for (int i = 1; i <= n - b; ++i) ++idg[i + b], odg[i].insert(i + b);
queue<int> stp;
for (int i = 1; i <= n; ++i)
if (!idg[i])
stp.push(i);
while (!stp.empty()) {
ll fnt = stp.front();
stp.pop();
rk.push_back(fnt);
for (int x : odg[fnt]) {
--idg[x];
if (idg[x] == 0)
stp.push(x);
}
}
for (int i = 0; i < rk.size(); ++i) psu[rk[i]] = i;
for (int i = 1; i <= n; ++i) arr[i] = psu[i] - psu[i - 1], printf("%lld ", arr[i]);
return;
}
int main() {
solve();
return 0;
}
用户输出
11
3 1 3 1 2 -10 1 1 3 1 3
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
383 -36 -36 -36 -36 -36 -36 -36 -36 -47 1 359 -36 -36 -36 -36 -36 -36 -36 -36 -36 -58 1 370 -36 -36 -36 -36 -36 -36 -36 -36
<1482 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
6732 1 3928 -5053 1 4490 -5615 1 5052 -6177 1 5614 -6739 1 6176 -7301 1 6733 1 3371 -4496 1 3933 -5058 1 4495 -5620 1 5057
<47575 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[2] to r[4495] 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
51480 1 1 1 1 1 1 1 1 46333 1 1 1 1 1 1 1 1 45148 1 1 1 1 1 1 1 -131144 1 1 1 1 1 1 1 1 1 50296 1 1 1 1 1 1 1 1 46333 1 1
<437193 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
76608 1 51073 1 43340 -147827 1 1 68876 1 51073 1 35607 -132361 1 1 61143 1 51073 1 27874 -116895 1 1 53410 1 45678 -1525
<806261 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
49818 1 33213 1 33213 1 33213 1 33213 1 22296 -172223 1 1 38902 1 33213 1 33213 1 33213 1 27986 -183603 1 1 44592 1 33213
<875737 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[2] to r[17291] 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
116736 1 1 1 1 1 1 102145 1 1 1 1 1 1 96084 1 1 1 1 1 -266502 1 1 1 1 1 1 1 110676 1 1 1 1 1 1 102145 1 1 1 1 1 1 90023 1
<995912 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[2] to r[119442] 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
200001 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
<799899 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[200000] is not negative.
系统信息
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
599995 -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
<1799877 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[299999] is not negative.
系统信息
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
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
<1199879 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[299999] is not positive.
系统信息
Exited with return code 0
390556
191381 -199177 191381 -199177 191381 -199177 191381 -199177 191381 -199177 191381 -199177 191
<2925179 bytes omitted>
用户输出
390556
15590 1 15591 1 15591 1 15591 1 15591 1 15591 1 15591 1 15591 1 15591 1 15591 1 15591 1 15591 1 15591 1 15591 1 15591 1 1
<1591081 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[2] to r[99444] is not positive.
系统信息
Exited with return code 0
292643
1 -15589 1 -15589 1 -15589 1 -15589 1 -15589 1 -15589 1 -15589 1 -15589 1 -15589 1 -15589 1 -
<1316798 bytes omitted>
用户输出
292643
23379 1 15587 1 15587 1 15587 1 15587 1 15587 1 15587 1 15587 1 15587 1 15587 1 15587 1 15587 1 15587 1 15587 1 15587 1 1
<1183833 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[49300] is not negative.
系统信息
Exited with return code 0
517013
1 1 -105107 1 1 -105107 1 1 -105107 1 1 411910 1 1 -105107 1 1 -105107 1 1 -105107 1 1 -10510
<2032921 bytes omitted>
用户输出
517013
140136 1 1 105103 1 1 105103 1 1 102267 1 -441276 1 1 1 137301 1 1 105103 1 1 105103 1 1 99431 1 -435604 1 1 1 134465 1 1
<1900698 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[251034] is not negative.
系统信息
Exited with return code 0
599995
1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1
<1199903 bytes omitted>
用户输出
599995
599993 -4 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1 -5 1
<1499875 bytes omitted>
Special Judge 信息
Wrong Answer | Sum from r[1] to r[299998] is not negative.
系统信息
Exited with return code 0
用户输出
0
Special Judge 信息
Accepted | Correct. answer = 0
系统信息
Exited with return code 0
299999
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
<599905 bytes omitted>
用户输出
299999
0 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
<599877 bytes omitted>
Special Judge 信息
Accepted | Correct. answer = 299999
系统信息
Exited with return code 0