QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#395743#7680. Subwayzzuqy#WA 0ms3604kbC++14942b2024-04-21 17:57:442024-04-21 17:57:44

Judging History

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

  • [2024-04-21 17:57:44]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3604kb
  • [2024-04-21 17:57:44]
  • 提交

answer

#include<bits/stdc++.h>
#define N 59
using namespace std;
int n,mx;
int px[N],py[N],a[N];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)cin>>px[i]>>py[i]>>a[i],mx=max(mx,a[i]);
	cout<<mx<<endl;
	for(int x=mx;x>=1;x--){
		vector<pair<int,int>>v,line;
		for(int i=1;i<=n;i++)if(x<=a[i])v.push_back(make_pair(px[i],py[i]));
		v.push_back(make_pair(-1001,0));
		sort(v.begin(),v.end());
		line.push_back(v[0]); 
		int k1=10000,k2=100000;
		for(int i=1;i<v.size();i++){
			if(v[i-1].first==v[i].first){
				line.push_back(make_pair(v[i-1].first-x,v[i-1].second+k1*x+1));
				line.push_back(make_pair(v[i].first-x,v[i].second+k2*x-1));
			}
			else{
				line.push_back(make_pair(v[i-1].first-x,v[i-1].second+k1*x+1));
				line.push_back(make_pair(v[i-1].first-x,(2000-x)+k2*x-1));
			}
			line.push_back(v[i]);
		}
		cout<<line.size()<<" ";
		for(auto i:line)cout<<i.first<<" "<<i.second<<" ";cout<<endl;
	}
	return 0;
}

詳細信息

Test #1:

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

input:

3
1 2 1
2 1 2
3 3 2

output:

2
7 -1001 0 -1003 20001 -1003 201997 2 1 0 20002 0 201997 3 3 
10 -1001 0 -1002 10001 -1002 101998 1 2 0 10003 0 101998 2 1 1 10002 1 101998 3 3 

result:

wrong answer Self-intersecting polyline 2.