QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#318920#7758. PaintertackWA 0ms3536kbC++141.0kb2024-02-01 10:59:302024-02-01 10:59:30

Judging History

This is the latest submission verdict.

  • [2024-02-01 10:59:30]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3536kb
  • [2024-02-01 10:59:30]
  • Submitted

answer

#include <bits/stdc++.h>

using namespace std;

const int N = 2e3 + 5;

struct node {
	int op, a, b, c, d;
	char x;
}a[N];

int t, _;

int main() {
	cin >> t;
	while (t--) {
		string op;
		char u;
		int _a, _b, _c, _d;
		cin >> op;
		if (op == "Circle") {
			cin >> _a >> _b >> _c >> u;
			a[++_] = {1, _a, _b, _c, 0, u};
		} 
		else if (op == "Rectangle") {
			cin >> _a >> _b >> _c >> _d >> u;
			a[++_] = {2, _a, _b, _c, _d, u};
		}
		else {
			cin >> _a >> _b >> _c >> _d;
			for (int i = _d; i >= _b; i--) {
				for (int j = _a; j <= _c; j++) {
					char tmp = '.';
					for (int _i = 1; _i <= _; _i++) {
						if (a[_i].op == 1) {
							if (((a[_i].a - j) * (a[_i].a - j) + (a[_i].b - i) * (a[_i].b - i)) <= a[_i].c * a[_i].c) {
								tmp = a[_i].x;
							}
						}
						else {
							if (j >= a[_i].a && j <= a[_i].c && i >= a[_i].b && i <= a[_i].d) {
								tmp = a[_i].x;	
							}
						}
					}
					cout << tmp;
				}
				cout << "\n";
			}
		}
		cout << "\n";
	}
	return 0;
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3536kb

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: ''