QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#595503 | #7758. Painter | forget-star# | WA | 0ms | 1448kb | C++14 | 1.7kb | 2024-09-28 13:52:09 | 2024-09-28 13:52:09 |
Judging History
answer
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <assert.h>
#define int long long
#define pow2(x) ((x)*(x))
using namespace std;
const int N=1e6+7,inf = 2e9+77777777;
int read()
{
int a = 0,x = 1;char ch = getchar();
while(ch > '9' || ch < '0') {if(ch == '-') x = -1;ch = getchar();}
while(ch >= '0' && ch <= '9') {a = a*10 + ch-'0';ch = getchar();}
return a*x;
}
char s[2007][20],col[2007];
int arr[2007][5],n;
char calc(int x,int y,int t)
{
for(int i = t;i >= 1;i --) {
if(s[i][2] == 'n') continue;
if(s[i][2] == 'c') {
if(x < arr[i][0] || x > arr[i][2]) continue;
if(y < arr[i][1] || y > arr[i][3]) continue;
return col[i];
}
if(s[i][0] == 'C') {
if(arr[i][2]*arr[i][2] < pow2(x-arr[i][0]) + pow2(y-arr[i][1])) continue;
return col[i];
}
}
return '.';
}
void solve()
{
n = read();
for(int i = 1;i <= n;i ++) {
scanf("%s",s[i]);
if(s[i][0] == 'C') {
scanf("%d %d %d %c",&arr[i][0],&arr[i][1],&arr[i][2],&col[i]);
} else if(s[i][2] == 'c') {
scanf("%d %d %d %d %c",&arr[i][0],&arr[i][1],&arr[i][2],&arr[i][3],&col[i]);
} else if(s[i][2] == 'n') {
scanf("%d %d %d %d",&arr[i][0],&arr[i][1],&arr[i][2],&arr[i][3]);
for(int y = arr[i][3];y >= arr[i][1];y --) {
for(int x = arr[i][0];x <= arr[i][2];x ++) {
putchar(calc(x,y,i));
}
putchar('\n');
}
}
}
}
signed main()
{
// freopen("in.in","r",stdin);freopen("out.out","w",stdout);
int T = 1;
while(T --) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 1448kb
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: ''