QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#480535 | #784. 旋转卡壳 | lmeowdn# | 0 | 1ms | 3768kb | C++14 | 1.8kb | 2024-07-16 16:24:42 | 2024-07-16 16:24:43 |
Judging History
answer
//Shirasu Azusa 2024.7
#include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128;
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x) {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x) {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x) {return (x==0?-1:__builtin_ctzll(x));}
#define int long long
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vp;
typedef tuple<int,int,int> tiii;
int read() {
int x=0,w=1; char c=getchar();
while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();}
return x*w;
}
const int N=5e5+5;
const ld eps=1e-10;
struct vec {ld x,y;};
vector<vec> a;
vec operator - (vec a,vec b) {
return (vec){a.x-b.x,a.y-b.y};
}
ld operator ^ (vec a,vec b) {
return a.x*b.y-a.y*b.x;
}
ld area(vec a,vec b,vec c) {
return fabs((a-b)^(a-c));
}
ld dis(vec a,vec b) {
return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
signed main() {
int n=read();
rep(i,0,n-1) {
vec x; x.x=read(), x.y=read();
a.eb(x);
}
int j=1; ld ans=0;
rep(i,0,n-1) {
while(area(a[i],a[j],a[(j+1)%n])<area(a[i],a[(j+1)%n],a[(j+2)%n])) j=(j+1)%n;
chmax(ans,dis(a[i],a[j]));
chmax(ans,dis(a[i],a[(j+1)%n]));
}
printf("%.8Lf\n",ans);
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3768kb
input:
1000 0 0 -997615 -8573 -1988394 -28911 -2726572 -44296 -3491635 -60392 -4419752 -82814 -5298550 -105946 -5723430 -118453 -6608257 -147267 -7034966 -161982 -7563964 -181682 -8507871 -222865 -9499799 -271846 -10090186 -303547 -10400262 -322989 -10614073 -339725 -11081438 -378596 -11791568 -439127 -127...
output:
56340738.12207100
result:
wrong answer 1st numbers differ - expected: '274339223.1895614', found: '56340738.1220710', error = '0.7946311'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #1:
0%