Submission #36021

# Submission time Handle Problem Language Result Execution time Memory
36021 2017-12-04T09:05:45 Z ngkan146 Bulldozer (JOI17_bulldozer) C++
0 / 100
2000 ms 512 KB
#include <bits/stdc++.h>
using namespace std;
#define double long double
const double pi = acos(-1);
struct point{
	double x,y;
	int w;
	point(double x=0,double y=0,int w=0): x(x), y(y), w(w) {}
};
int n;
point a[2005];
void rotate(point &P,double alpha){
	double tx = P.x * cos(alpha) - P.y * sin(alpha);
	double ty = P.x * sin(alpha) + P.y * cos(alpha);
	P.x = tx;
	P.y = ty;
}
bool cmp(point p,point q){
	return p.x < q.x;
}
int main(){
	iostream::sync_with_stdio(0);
	cin >> n;
	for(int i=1;i<=n;i++)
		cin >> a[i].x >> a[i].y >> a[i].w;
	
	long long ans = 0;
	int _Time = 300000;
	
	for(int i=0;i<_Time;i++){
		sort(a+1,a+n+1,cmp);
		long long mi = 0, sum = 0;
		for(int j=1;j<=n;j++){
			sum += a[j].w;
			//cout << a[j].w << ' ';
			ans = max(ans, sum - mi);
			mi = min(mi, sum);
		}
		for(int j=1;j<=n;j++){
			rotate(a[j], pi / _Time);
		}
		//cout << endl;
	}
	cout << ans;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 2040 ms 384 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2045 ms 512 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2045 ms 512 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2045 ms 512 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2040 ms 384 KB Time limit exceeded
2 Halted 0 ms 0 KB -