编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#24224 #1145. ddd 和渡渡鸟 Runtime Error 0 214 ms 21540 K C++ 11 / 927 B YangDavid 2020-04-22 22:41:35
显示原始代码
#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);
        }
    }
    assert(cloc == ans + 1);
    printf("%d\n", ans);
    for (int i = 1; i <= ans; ++i) printf("%d ", val[i] - val[i - 1]);

    return 0;
}
子任务 #1
Runtime Error
得分:0
测试点 #1
Runtime Error
得分:0
用时:3 ms
内存:356 KiB

输入文件(1.in

6 8

答案文件(1.out

11
1 -5 1 -5 1 9 1 -5 1 -5 1 

标准错误流

/sandbox/1/a.cpp:27: int main(): Assertion `cloc == ans + 1' failed.

系统信息

Killed: Segmentation fault
测试点 #2
Runtime Error
得分:0
用时:3 ms
内存:384 KiB

输入文件(2.in

269 152

答案文件(2.out

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>

标准错误流

/sandbox/1/a.cpp:27: int main(): Assertion `cloc == ans + 1' failed.

系统信息

Killed: Segmentation fault
测试点 #3
Runtime Error
得分:0
用时:4 ms
内存:780 KiB

输入文件(3.in

4494 6731

答案文件(3.out

11223
3929 -7296 3929 3929 -7296 3929 3929 -7296 3929 3929 -7296 3929 3929 -7296 3929 3929 -7296 392
<59949 bytes omitted>

标准错误流

/sandbox/1/a.cpp:27: int main(): Assertion `cloc == ans + 1' failed.

系统信息

Killed: Segmentation fault
测试点 #4
Runtime Error
得分:0
用时:16 ms
内存:6520 KiB

输入文件(4.in

95679 79020

答案文件(4.out

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>

标准错误流

/sandbox/1/a.cpp:27: int main(): Assertion `cloc == ans + 1' failed.

系统信息

Killed: Segmentation fault
测试点 #5
Runtime Error
得分:0
用时:29 ms
内存:7016 KiB

输入文件(5.in

151274 37556

答案文件(5.out

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>

标准错误流

/sandbox/1/a.cpp:27: int main(): Assertion `cloc == ans + 1' failed.

系统信息

Killed: Segmentation fault
测试点 #6
Runtime Error
得分:0
用时:31 ms
内存:7800 KiB

输入文件(6.in

17290 193374

答案文件(6.out

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>

标准错误流

/sandbox/1/a.cpp:27: int main(): Assertion `cloc == ans + 1' failed.

系统信息

Killed: Segmentation fault
测试点 #7
Runtime Error
得分:0
用时:37 ms
内存:13248 KiB

输入文件(7.in

119441 246736

答案文件(7.out

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>

标准错误流

/sandbox/1/a.cpp:27: int main(): Assertion `cloc == ans + 1' failed.

系统信息

Killed: Segmentation fault
测试点 #8
Runtime Error
得分:0
用时:20 ms
内存:13248 KiB

输入文件(8.in

300000 200000

答案文件(8.out

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>

标准错误流

/sandbox/1/a.cpp:27: int main(): Assertion `cloc == ans + 1' failed.

系统信息

Killed: Segmentation fault
测试点 #9
Runtime Error
得分:0
用时:35 ms
内存:21504 KiB

输入文件(9.in

300000 299999

答案文件(9.out

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>

标准错误流

/sandbox/1/a.cpp:27: int main(): Assertion `cloc == ans + 1' failed.

系统信息

Killed: Segmentation fault
测试点 #10
Runtime Error
得分:0
用时:36 ms
内存:21540 KiB

输入文件(10.in

299999 300000

答案文件(10.out

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>

标准错误流

/sandbox/1/a.cpp:27: int main(): Assertion `cloc == ans + 1' failed.

系统信息

Killed: Segmentation fault