编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#57565 #1142. ddd和大象 Wrong Answer 27 9298 ms 1196 K C++ 17 / 2.1 K 人工智能01杨进杰 2021-07-12 21:42:05
显示原始代码
#include <iostream>
using namespace std;
struct postion {
    int x, y;
};
void dddmove(postion *b, int c) {
    int x1 = 0, x2 = 0, x3 = 0, x4 = 0;
    for (int i = 0; i < c; i++) {
        if (b[i].x > 0)
            x1++;
        if (b[i].x < 0)
            x3++;
        if (b[i].y > 0)
            x2++;
        if (b[i].y < 0)
            x4++;
    }
    if (x1 > 0 && x2 > 0 && x3 > 0 && x4 > 0) {
        return;
    } else if (x1 == 0) {
        for (int i = 0; i < c; i++) {
            b[i].x--;
        }
    } else if (x2 == 0) {
        for (int i = 0; i < c; i++) {
            b[i].y--;
        }
    } else if (x3 == 0) {
        for (int i = 0; i < c; i++) {
            b[i].x++;
        }
    } else if (x4 == 0) {
        for (int i = 0; i < c; i++) {
            b[i].y++;
        }
    }
}
void elephantmove(postion *a, int c) {
    for (int i = 0; i < c; i++) {
        if (a[i].x > 0) {
            a[i].x--;
        }
        if (a[i].x < 0) {
            a[i].x++;
        }
        if (a[i].y > 0) {
            a[i].y--;
        }
        if (a[i].y < 0) {
            a[i].y++;
        }
    }
}
int judge(postion *b, int c) {
    int m = 0, n = 0;
    if (c == 0) {
        return 3;
    }
    for (int i = 0; i < c; i++) {
        if (b[i].x == 0 && b[i].y == 0) {
            return 9;
        }
        if (b[i].x != 0 && b[i].y != 0) {
            return 8;
        }
        if (b[i].x == 0) {
            m++;
        }
        if (b[i].y == 0) {
            n++;
        }
    }
    if (m != 0 & n != 0) {
        return 8;
    }
    return 3;
}
int main() {
    postion ddd;
    ddd.x = ddd.y = 0;
    int n;
    cin >> n;
    postion *elephant = new postion[n];
    for (int i = 0; i < n; i++) {
        cin >> elephant[i].x >> elephant[i].y;
    }
    int m = 8;
    while (m == 8) {
        dddmove(elephant, n);
        elephantmove(elephant, n);
        m = judge(elephant, n);
    }
    if (m == 9) {
        cout << "banana";
    }
    if (m == 3) {
        cout << "ddd";
    }
    delete[] elephant;
    return 0;
}
子任务 #1
Wrong Answer
得分:26
测试点 #1
Accepted
得分:100
用时:3 ms
内存:448 KiB

输入文件(1.in

2
0 1000
1000 0

答案文件(1.out

banana

用户输出

banana

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:4 ms
内存:352 KiB

输入文件(2.in

2
1 -100000
1 114514

答案文件(2.out

ddd

用户输出

ddd

系统信息

Exited with return code 0
测试点 #3
Wrong Answer
得分:0
用时:2 ms
内存:248 KiB

输入文件(3.in

2
0 1000
0 -112123

答案文件(3.out

banana

用户输出

ddd

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:2 ms
内存:248 KiB

输入文件(4.in

1
0 0

答案文件(4.out

banana

用户输出

banana

系统信息

Exited with return code 0
测试点 #5
Wrong Answer
得分:0
用时:2 ms
内存:248 KiB

输入文件(5.in

1
0 1

答案文件(5.out

ddd

用户输出

banana

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #6
Time Limit Exceeded
得分:0
用时:1011 ms
内存:248 KiB

输入文件(6.in

1
1000000000 1000000000

答案文件(6.out

ddd
测试点 #7
Time Limit Exceeded
得分:0
用时:1035 ms
内存:1156 KiB

输入文件(7.in

100000
-1000000000 -1000000000
-1000000000 -1000000000
-1000000000 -1000000000
-1000000000 -10000000
<2399907 bytes omitted>

答案文件(7.out

ddd
测试点 #8
Time Limit Exceeded
得分:0
用时:1024 ms
内存:1196 KiB

输入文件(8.in

100000
-571340417 463560346
403124531 -797547705
-758821057 -514451613
831005957 -500699947
-6422173
<2077792 bytes omitted>

答案文件(8.out

banana
测试点 #9
Time Limit Exceeded
得分:0
用时:1042 ms
内存:1012 KiB

输入文件(9.in

100000
-438108394 170968360
-234057734 -829803060
-262258987 -231854118
-922675242 943352998
2528484
<2077959 bytes omitted>

答案文件(9.out

banana
测试点 #10
Time Limit Exceeded
得分:0
用时:1032 ms
内存:1108 KiB

输入文件(10.in

100000
-549857431 345016800
-412131138 556921917
7246642 -464357808
-975496833 602878280
445593594 8
<2077557 bytes omitted>

答案文件(10.out

banana
测试点 #11
Time Limit Exceeded
得分:0
用时:1034 ms
内存:1088 KiB

输入文件(11.in

100000
678089562 538953470
258583896 912487915
420506774 510970659
128240660 405522019
958653829 394
<2027598 bytes omitted>

答案文件(11.out

ddd
测试点 #12
Time Limit Exceeded
得分:0
用时:1027 ms
内存:1012 KiB

输入文件(12.in

100000
61058594 -659126515
632527415 -498875302
-883598349 -754477065
-813784284 -741617825
-3903755
<2127879 bytes omitted>

答案文件(12.out

ddd
测试点 #13
Accepted
得分:100
用时:3 ms
内存:336 KiB

输入文件(13.in

2
706 -200
-901 137

答案文件(13.out

banana

用户输出

banana

系统信息

Exited with return code 0
测试点 #14
Time Limit Exceeded
得分:0
用时:1037 ms
内存:248 KiB

输入文件(14.in

5
637698483 -974613293
-928109931 465894288
70394878 -224931957
768070863 594202926
766088780 955236
<3 bytes omitted>

答案文件(14.out

banana
测试点 #15
Time Limit Exceeded
得分:0
用时:1040 ms
内存:248 KiB

输入文件(15.in

5
483821865 -133684948
-369441770 47303804
543530555 -854685963
875279045 -355845962
-409298769 -426
<7 bytes omitted>

答案文件(15.out

banana