QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#633468#7758. PainterBai_xiaobo#WA 1ms3632kbC++201.8kb2024-10-12 15:29:582024-10-12 15:29:59

Judging History

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

  • [2024-10-12 15:29:59]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3632kb
  • [2024-10-12 15:29:58]
  • 提交

answer

#include<bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
#define ll long long
#define endl "\n"
#define int long long
#define pr pair<int,int>
#define x first
#define y second
ll mod=1e9+7;

const ll N=2e3+10;


void solve()
{
    ll n;
    cin>>n;
    map<pr,char>mp;
    for(int i=1;i<=n;i++)
    {
        string a;
        cin>>a;
        if(a=="Circle")
        {
            ll x,y,r;
            string c;
            cin>>x>>y>>r>>c;
            for(int j=x-r;j<=x+r;j++)
            {
                for(int k=y-r;k<=y+r;k++)
                {
                    if(abs(j-x)+abs(k-y)<=r)
                    {
                        mp[{j,k}]=c[0];
                    }
                }
            }
        }
        else if(a=="Rectangle")
        {
            ll x1,y1,x2,y2;
            cin>>x1>>y1>>x2>>y2;
            string c;
            cin>>c;
            for(int j=x1;j<=x2;j++)
            {
                for(int k=y1;k<=y2;k++)
                {
                    mp[{j,k}]=c[0];

                }
            }
        }
        else
        {
            ll x1,y1,x2,y2;
            cin>>x1>>y1>>x2>>y2;
            for(int j=y2;j>=y1;j--)
            {
                for(int k=x1;k<=x2;k++)
                {
                    if(!mp[{k,j}])
                        cout<<'.';
                    else
                    cout<<mp[{k,j}];
                }
                cout<<'\n';
            }
        }
    }
}

/*
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
 */

signed main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--)
        solve();
}

詳細信息

Test #1:

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

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 2nd lines differ - expected: '..*******..', found: '....***....'