QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#680589 | #9434. Italian Cuisine | yueyuey | WA | 0ms | 3636kb | C++23 | 1.4kb | 2024-10-26 21:39:00 | 2024-10-26 21:39:05 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e6+10;
typedef pair<int, int> P;
const long double eps = 1e-6;
#define x first
#define y second
// 叉乘
int cross(P a, P b)
{
return a.x * b.y - a.y * b.x;
}
// 点积
int mul(P a, P b)
{
return a.x * b.x + a.y * b.y;
}
// 点平方和
int mul(P a)
{
return a.x * a.x + a.y * a.y;
}
// 计算矢量
P del(P a, P b)
{
return {a.x - b.x, a.y - b.y};
}
void solve()
{
int n;
cin>>n;
P C;
cin>>C.x;
cin>>C.y;
int R;
cin>>R;
vector<P> a(n);
for (int i = 0; i < n; i++)
{
cin>>a[i].x;
cin>>a[i].y;
}
int ans = 0;
int S = 0;
for (int l = 0, r = l + 1; l < n; l++)
{
while (1)
{
int rr = r % n + 1;
int s = cross(del(a[rr], a[l]), del(C, a[l]));
if (s <= 0)
break;
if (s * s < mul(del(a[rr], a[l])) * R * R)
break;
S += cross(del(a[r], a[l]), del(a[rr], a[l]));
r = rr;
}
ans = max(ans, S);
int ll = l % n + 1;
S -= cross(del(a[r], a[l]), del(a[r], a[ll]));
}
cout<<ans<<"\n";
}
signed main(){
int _ = 1;
cin>>_;
while (_--)
{
solve();
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3636kb
input:
3 5 1 1 1 0 0 1 0 5 0 3 3 0 5 6 2 4 1 2 0 4 0 6 3 4 6 2 6 0 3 4 3 3 1 3 0 6 3 3 6 0 3
output:
0 24 0
result:
wrong answer 1st numbers differ - expected: '5', found: '0'