QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#259823 | #7758. Painter | zlxFTH# | WA | 1ms | 3680kb | C++17 | 1.2kb | 2023-11-21 14:47:19 | 2023-11-21 14:47:20 |
Judging History
answer
#include <iostream>
typedef long long LL;
const int N = 5e3 + 5;
int tp[N];
LL x1[N], y1[N], x2[N], y2[N], r[N];
char c[N];
LL sq(LL x) {return x * x;}
int main() {
std::ios::sync_with_stdio(0);
std::cin.tie(0);
int q;
std::cin >> q;
for (int i = 1; i <= q; ++i) {
std::string op;
std::cin >> op;
if (op == "Circle") {
std::cin >> x1[i] >> y1[i] >> r[i] >> c[i];
tp[i] = 1;
}
if (op == "Rectangle") {
std::cin >> x1[i] >> y1[i] >> x2[i] >> y2[i] >> c[i];
tp[i] = 2;
}
if (op == "Render") {
std::cin >> x1[i] >> y1[i] >> x2[i] >> y2[i];
for (int x = x1[i]; x <= x2[i]; ++x) {
for (int y = y1[i]; y <= y2[i]; ++y) {
char ch = '.';
for (int j = i - 1; j > 0; --j) {
if (tp[j] == 1 && sq(x - x1[j]) + sq(y - y1[j]) <= sq(r[j])) {
ch = c[j];
break;
}
if (tp[j] == 2 && x1[j] <= x && x <= x2[j] && y1[j] <= y && y <= y2[j]) {
ch = c[j];
break;
}
}
std::cout << ch;
}
std::cout << "\n";
}
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3680kb
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 3rd lines differ - expected: '.**@***@**.', found: '.******@**.'