用户输出
11
233 -1165 233 -1165 233 2097 233 -1165 233 -1165 233
Special Judge 信息
Accepted | Correct. answer = 11
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#24226 | #1145. ddd 和渡渡鸟 | Accepted | 100 | 417 ms | 21480 K | C++ 11 / 915 B | YangDavid | 2020-04-22 22:48:47 |
#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
int main() {
int a, b, ans;
cin >> a >> b;
ans = a + b - gcd(a, b) - 1;
vector<int> indeg(ans + 1), val(ans + 1);
vector<vector<int> > G(ans + 1);
for (int i = 0; i + a <= ans; ++i) G[i].push_back(i + a), indeg[i + a]++;
for (int i = b; i <= ans; ++i) G[i].push_back(i - b), indeg[i - b]++;
queue<int> q;
for (int i = 0; i <= ans; ++i)
if (indeg[i] == 0)
q.push(i);
int cloc = 114514;
while (!q.empty()) {
int f = q.front();
q.pop();
cloc += 233;
val[f] = cloc;
for (auto g : G[f]) {
if (--indeg[g] == 0)
q.push(g);
}
}
printf("%d\n", ans);
for (int i = 1; i <= ans; ++i) printf("%d%c", val[i] - val[i - 1], " \n"[i == ans]);
return 0;
}
用户输出
11
233 -1165 233 -1165 233 2097 233 -1165 233 -1165 233
Special Judge 信息
Accepted | Correct. answer = 11
系统信息
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
8388 8388 8388 8388 8388 8388 8388 8388 8388 8388 -89705 8388 8388 8388 8388 8388 8388 8388 8388 8388 8388 8388 -89705 8388
<2041 bytes omitted>
Special Judge 信息
Accepted | Correct. answer = 419
系统信息
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
915457 -1699968 915457 915457 -1699968 915457 915457 -1699968 915457 915457 -1699968 915457 915457 -1699968 915457 915457
<86295 bytes omitted>
Special Judge 信息
Accepted | Correct. answer = 11223
系统信息
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
233 233 233 233 233 233 233 233 -10799317 233 233 233 233 233 233 233 233 -10799317 233 233 233 233 233 233 233 233 29905
<809941 bytes omitted>
Special Judge 信息
Accepted | Correct. answer = 174689
系统信息
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
233 -11900475 233 -11900475 233 32096915 233 -11900475 233 -11900475 233 -11900475 233 32096915 233 -11900475 233 -119004
<1296129 bytes omitted>
Special Judge 信息
Accepted | Correct. answer = 188827
系统信息
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
233 -7739095 233 -7739095 233 -7739095 233 -7739095 233 -7739095 233 41345617 233 -7739095 233 -7739095 233 -7739095 233
<1369173 bytes omitted>
Special Judge 信息
Accepted | Correct. answer = 210661
系统信息
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
233 233 233 233 233 233 -23802581 233 233 233 233 233 233 -23802581 233 233 233 233 233 233 61516660 233 233 233 233 233
<1763817 bytes omitted>
Special Judge 信息
Accepted | Correct. answer = 366169
系统信息
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
233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 2
<1599891 bytes omitted>
Special Judge 信息
Accepted | Correct. answer = 399999
系统信息
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
466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 466 4
<2399874 bytes omitted>
Special Judge 信息
Accepted | Correct. answer = 599997
系统信息
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
-466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -466 -
<2999869 bytes omitted>
Special Judge 信息
Accepted | Correct. answer = 599997
系统信息
Exited with return code 0