QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#633468 | #7758. Painter | Bai_xiaobo# | WA | 1ms | 3632kb | C++20 | 1.8kb | 2024-10-12 15:29:58 | 2024-10-12 15:29:59 |
Judging History
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: '....***....'