QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#238276#7680. Subwayucup-team266#WA 0ms3480kbC++141.9kb2023-11-04 16:16:342023-11-04 16:16:35

Judging History

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

  • [2023-11-04 16:16:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3480kb
  • [2023-11-04 16:16:34]
  • 提交

answer

/*
Things to notice:
1. do not calculate useless values
2. do not use similar names
 
Things to check:
1. submit the correct file
2. time (it is log^2 or log)
3. memory
4. prove your naive thoughts 
5. long long
6. corner case like n=0,1,inf or n=m
7. check if there is a mistake in the ds or other tools you use
8. fileio in some oi-contest

9. module on time 
10. the number of a same divisor in a math problem
11. multi-information and queries for dp and ds problems
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pii pair<long long,long long>
#define mp make_pair
#define pb push_back
const int mod=998244353;
const int inf=0x3f3f3f3f;
const int INF=1e18;
int n;
array<int,3> A[55];
int B[55];
mt19937_64 rnd(114514);
int gen_range(int l,int r)
{
	return l+rnd()%(r-l+1);
}
const int K=20001;
vector <pii > pts[55];
void solve()
{
	cin>>n;
	for(int i=1;i<=n;i++) cin>>A[i][0]>>A[i][1]>>A[i][2],A[i][0]+=1001,A[i][1]+=1001;
	sort(A+1,A+1+n);
	int maxx=0;
	for(int i=1;i<=n;i++) maxx=max(maxx,A[i][2]);
	cout<<maxx<<"\n";
	if(n==1)
	{
		while(maxx--)
		{
			int x=rnd()%1000000000,y=rnd()%1000000000;
			cout<<2<<" "<<x<<" "<<y<<" "<<A[1][0]-1001<<" "<<A[1][1]-1001<<"\n";
		}
		return;
	}
	for(int i=1;i+1<=n;i++)
	{
		int b=A[i][1]+K*A[i][0];
		b/=2;
		if(A[i][0]%2) b++;
		for(int x=2;pts[i].size()<=50;x+=2) 
		{
			int y=-K*x/2+b;
			if(y<0) pts[i].pb(mp(x,y));
		}
	} 
	for(int i=1;i<=maxx;i++)
	{
		vector <pii > vec;
		for(int j=1;j<=n;j++) 
		{
			if(A[j][2]>=i) vec.pb(mp(A[j][0],A[j][1]));
			if(j<n) vec.pb(pts[j][0]),pts[j].erase(pts[j].begin());
		}
		cout<<vec.size()<<" ";
		for(int j=0;j<vec.size();j++) cout<<vec[j].fi-1001<<" "<<vec[j].se-1001<<" ";
		cout<<"\n";
	}
	
}
signed main()
{
//	ios::sync_with_stdio(0);
//	cin.tie(0);
	int _=1;
//	cin>>_;
	while(_--) solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1 2 1
2 1 2
3 3 2

output:

2
5 1 2 3 -20501 2 1 3 -10500 3 3 
4 5 -40502 2 1 5 -30501 3 3 

result:

wrong answer Polyline 2 intersects with previous polylines.