답안 #144587

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
144587 2019-08-17T09:03:29 Z SamAnd Pick (COI18_pick) C++17
10 / 100
3 ms 376 KB
#include <bits/stdc++.h>
using namespace std;
const int xx[8] = {1, 0, 1, 1, -1, 0, -1, -1};
const int yy[8] = {0, 1, 1, -1, 0, -1, -1, 1};

int a, b, c, d;

void solv1()
{
    int x = 0, y = 0;
    for (int i = 0; i < a / 2; ++i)
    {
        cout << x << ' ' << y << endl;
        x += xx[0];
        y += yy[0];
    }
    for (int i = 0; i < b / 2; ++i)
    {
        cout << x << ' ' << y << endl;
        x += xx[1];
        y += yy[1];
    }
    for (int i = 0; i < a / 2; ++i)
    {
        cout << x << ' ' << y << endl;
        x += xx[4];
        y += yy[4];
    }
    for (int i = 0; i < b / 2; ++i)
    {
        cout << x << ' ' << y << endl;
        x += xx[5];
        y += yy[5];
    }
}

void solv2()
{
    int x = 0, y = 0;
    for (int i = 0; i < c / 2; ++i)
    {
        cout << x << ' ' << y << endl;
        x += xx[2];
        y += yy[2];
    }
    for (int i = 0; i < d / 2; ++i)
    {
        cout << x << ' ' << y << endl;
        x += xx[3];
        y += yy[3];
    }
    for (int i = 0; i < c / 2; ++i)
    {
        cout << x << ' ' << y << endl;
        x += xx[6];
        y += yy[6];
    }
    for (int i = 0; i < d / 2; ++i)
    {
        cout << x << ' ' << y << endl;
        x += xx[7];
        y += yy[7];
    }
}

int main()
{
    cin >> a >> b >> c >> d;
    if (c == 0 && d == 0)
    {
        solv1();
    }
    else if (a == 0 && b == 0)
    {
        solv2();
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Incorrect 2 ms 376 KB Unexpected end of file - int32 expected
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Incorrect 2 ms 376 KB Unexpected end of file - int32 expected
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Incorrect 2 ms 376 KB Unexpected end of file - int32 expected
10 Halted 0 ms 0 KB -