QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#480535#784. 旋转卡壳lmeowdn#0 1ms3768kbC++141.8kb2024-07-16 16:24:422024-07-16 16:24:43

Judging History

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

  • [2024-10-16 12:18:36]
  • hack成功,自动添加数据
  • (/hack/1005)
  • [2024-09-24 16:55:39]
  • hack成功,自动添加数据
  • (/hack/888)
  • [2024-07-31 21:52:32]
  • hack成功,自动添加数据
  • (/hack/764)
  • [2024-07-31 21:47:53]
  • hack成功,自动添加数据
  • (/hack/763)
  • [2024-07-16 16:24:43]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3768kb
  • [2024-07-16 16:24:42]
  • 提交

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%