QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#519056#7758. PainterQF_love_younger_sisterWA 2ms4180kbC++232.0kb2024-08-14 15:46:072024-08-14 15:46:07

Judging History

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

  • [2024-08-14 15:46:07]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:4180kb
  • [2024-08-14 15:46:07]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N=2e3+10;
struct QF{
	string lx;
	int x,xx,y,yy,r;
	char fh;
}q[N];
unordered_map<int,char> mp;
vector<pair<int,int> > lie;
bool cmp(pair<int,int> a,pair<int,int> b){
	if(a.second==b.second){
		return a.first>b.first;
	}
	else return a.second>b.second;
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin >> n;
	for(int i=1;i<=n;i++){
		cin >> q[i].lx;
		if(q[i].lx=="Circle"){
			cin >> q[i].x >> q[i].y >> q[i].r >> q[i].fh;
		}
		else if(q[i].lx=="Rectangle"){
			cin >> q[i].x >> q[i].y >> q[i].xx >> q[i].yy >> q[i].fh;
		}
		else{
			cin >> q[i].x >> q[i].y >> q[i].xx >> q[i].yy;
			for(int k=q[i].x;k<=q[i].xx;k++){
				for(int j=q[i].y;j<=q[i].yy;j++){
					lie.push_back({k,j});
				}
			}
		}
	}
	sort(lie.begin(),lie.end(),cmp);
	lie.erase(unique(lie.begin(),lie.end()),lie.end());
	int len1=lie.size();
	for(int i=0;i<len1;i++){
		mp[i]='.';
	}
//	for(int i=0;i<len1;i++){
//		cout << lie[i].first << " " << lie[i].second << "\n";
//	}
//	cout << len1 << "\n";
	for(int i=1;i<=n;i++){
		int len=lie.size();
		if(q[i].lx=="Render"){
//			int chang;
			int js=0;
			for(int j=0;j<len;j++){
				int qian=q[i].y;
				if(lie[j].first>=q[i].x&&lie[j].first<=q[i].xx&&lie[j].second>=q[i].y&&lie[j].second<=q[i].yy){
					js++;
					cout << mp[j];
					if(qian<lie[j].second){
						qian=lie[j].second;
					}
//					int chang=q[i].xx-q[i].x+1;
					if(js%(q[i].yy-q[i].y+1)==0){
						cout << "\n";				
					}
				}
			}
//			cout << "\n";
//			cout << "\n" << chang << "\n";
			continue;
		}
		for(int j=0;j<len;j++){
			if(q[i].lx=="Circle"){
				if((lie[j].first-q[i].x)*(lie[j].first-q[i].x)+(lie[j].second-q[i].y)*(lie[j].second-q[i].y)<=q[i].r*q[i].r){
					mp[j]=q[i].fh;
				}
			}
			else{
				if(lie[j].first>=q[i].x&&lie[j].first<=q[i].xx&&lie[j].second>=q[i].y&&lie[j].second<=q[i].yy){
					mp[j]=q[i].fh;
				}
			}
		}
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3748kb

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:

ok 14 lines

Test #2:

score: 0
Accepted
time: 2ms
memory: 4180kb

input:

10
Rectangle -4262 2204 3116 9357 U
Circle 7078 6883 4684 W
Rectangle 390 675 1195 1251 =
Rectangle 78 2138 3288 2570 5
Rectangle -874 797 -99 1440 3
Render 7261 -4311 7304 -4268
Render 2060 9253 2103 9296
Render -1379 -7141 -1336 -7098
Render 982 5708 1025 5751
Render 1080 -9592 1123 -9549

output:

............................................
............................................
............................................
............................................
............................................
............................................
.................................

result:

ok 220 lines

Test #3:

score: -100
Wrong Answer
time: 2ms
memory: 4140kb

input:

10
Rectangle -10000 -10000 10000 10000 @
Rectangle 1197 -1 1198 1 y
Rectangle 3684 -1 3685 0 &
Circle 8957 0 1 Y
Rectangle -5375 0 -5373 2 <
Circle 2683 0 0 7
Rectangle 1262 -1 1263 -1 i
Circle 3238 0 0 K
Circle -3533 0 0 G
Render -1605 0 8394 0

output:

@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
...

result:

wrong answer 1st lines differ - expected: '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@', found: '@'