QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#718510#7758. PainterJokerloveWA 1ms3552kbC++142.0kb2024-11-06 20:42:442024-11-06 20:42:44

Judging History

你现在查看的是最新测评结果

  • [2024-11-06 20:42:44]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3552kb
  • [2024-11-06 20:42:44]
  • 提交

answer

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
long long n, m, k;
const double eps = 1e-8, pi = 3.141592653589;

struct Node
{
    long long tp, x1, y1, x2, y2;
    char c;
};

std :: vector<Node> op;

char check(long long x,long long y,Node op)
{
    auto [tp, x1, y1, x2, y2, c] = op;
    if(tp)
    {
        if(x1 <= x && x <= x2&&y1 <= y && y <= y2)
        {
            return c;
        }
    }
    else
    {
        if((x1 - x)*(x1 - x) + (y1 - y)*(y1 - y)<=x2*x2)
            return c;
    }
    return char(1);
}




int main()
{
    std :: cin >> n;
    for(int i = 0;i < n ;i ++)
    {
        std :: string s;
        std :: cin >> s;
        if(s == "Circle")
        {
            long long x,y,r;
            std :: cin >> x >> y >> r;

            char c;
            std :: cin >> c;

            op.push_back({0, x, y, r, 0, c});
        }
        else if(s == "Rectangle")
        {
            long long x1,x2,y1,y2;
            std ::cin >> x1 >> y1 >> x2 >> y2;
            char c;
            std::cin >> c;

            op.push_back({1, x1, y1, x2, y2, c});
        }
        else
        {
            long long x1,x2,y1,y2;
            std ::cin >> x1 >> y1 >> x2 >> y2;

            for (long long y = y2; y >= y1;y--)
            {
                char c = '.';
                for (long long x = x1;x<=x2;x++)
                {

                    for (long long j = op.size();j>=0;j--)
                    {
                        char cur = check(x, y, op[j]);
                        if(cur !=1)
                        {
                            c = cur;
                            break;
                        }
                    }
                    std :: cout << c;
                    if(x==x2)
                    {
                        std ::cout << '\n';
                    }
                        

                }


            }
        }




    }

    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3552kb

input:

7
Circle 0 0 5 *
Circle -2 2 1 @
Circle 2 2 1 @
Rectangle 0 -1 0 0 ^
Rectangle -2 -2 2 -2 _
Render -5 -5 5 5
Render -1 0 1 2

output:

.....******
..*********
.**@***@***
.*@@@*@@@**
.**@***@***
*****

result:

wrong answer 1st lines differ - expected: '.....*.....', found: '.....******'