#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<complex>
#include<math.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef complex<long double> C;
#define chmax(a,b) a=max(a,b)
#define chmin(a,b) a=min(a,b)
#define all(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod
ll n,w[110];
C p[110];
ll solve(C g,C e){
vector<pair<long double,ll> >v;
rep(i,n){
C c=p[i]-g;
c*=e;
v.push_back(make_pair(c.imag(),i));
}
sort(all(v));
ll res=0,mi=0,rui=0;
rep(i,n){
rui+=w[v[i].second];
chmin(mi,rui);
chmax(res,rui-mi);
}
return res;
}
int main(){
cin>>n;
rep(i,n){
ll x,y;
cin>>x>>y>>w[i];
p[i]=C(x,y);
}
ll ans=0;
rep(i,n)rep(j,i){
ll dx=p[i].real()-p[j].real();
ll dy=p[i].imag()-p[j].imag();
chmax(ans,solve(p[j],C(dx,-dy)));
}
cout<<ans<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
38 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
57 ms |
256 KB |
Output is correct |
2 |
Correct |
57 ms |
256 KB |
Output is correct |
3 |
Correct |
61 ms |
256 KB |
Output is correct |
4 |
Correct |
61 ms |
256 KB |
Output is correct |
5 |
Correct |
57 ms |
256 KB |
Output is correct |
6 |
Correct |
58 ms |
256 KB |
Output is correct |
7 |
Correct |
56 ms |
376 KB |
Output is correct |
8 |
Correct |
58 ms |
256 KB |
Output is correct |
9 |
Correct |
56 ms |
256 KB |
Output is correct |
10 |
Correct |
57 ms |
256 KB |
Output is correct |
11 |
Correct |
5 ms |
256 KB |
Output is correct |
12 |
Incorrect |
5 ms |
256 KB |
Output isn't correct |
13 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
57 ms |
256 KB |
Output is correct |
2 |
Correct |
57 ms |
256 KB |
Output is correct |
3 |
Correct |
61 ms |
256 KB |
Output is correct |
4 |
Correct |
61 ms |
256 KB |
Output is correct |
5 |
Correct |
57 ms |
256 KB |
Output is correct |
6 |
Correct |
58 ms |
256 KB |
Output is correct |
7 |
Correct |
56 ms |
376 KB |
Output is correct |
8 |
Correct |
58 ms |
256 KB |
Output is correct |
9 |
Correct |
56 ms |
256 KB |
Output is correct |
10 |
Correct |
57 ms |
256 KB |
Output is correct |
11 |
Correct |
5 ms |
256 KB |
Output is correct |
12 |
Incorrect |
5 ms |
256 KB |
Output isn't correct |
13 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
57 ms |
256 KB |
Output is correct |
2 |
Correct |
57 ms |
256 KB |
Output is correct |
3 |
Correct |
61 ms |
256 KB |
Output is correct |
4 |
Correct |
61 ms |
256 KB |
Output is correct |
5 |
Correct |
57 ms |
256 KB |
Output is correct |
6 |
Correct |
58 ms |
256 KB |
Output is correct |
7 |
Correct |
56 ms |
376 KB |
Output is correct |
8 |
Correct |
58 ms |
256 KB |
Output is correct |
9 |
Correct |
56 ms |
256 KB |
Output is correct |
10 |
Correct |
57 ms |
256 KB |
Output is correct |
11 |
Correct |
5 ms |
256 KB |
Output is correct |
12 |
Incorrect |
5 ms |
256 KB |
Output isn't correct |
13 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
38 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |