제출 #36022

#제출 시각아이디문제언어결과실행 시간메모리
36022ngkan146Bulldozer (JOI17_bulldozer)C++98
0 / 100
109 ms512 KiB
#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 = 10000; 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...