QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#751950#9434. Italian Cuisine111111qqqqqqCompile Error//C++141.4kb2024-11-15 21:23:152024-11-15 21:23:16

Judging History

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

  • [2024-11-15 21:23:16]
  • 评测
  • [2024-11-15 21:23:15]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef int_128 ll;
typedef unsigned long long ull;
#define pb push_back
#define db double
#define lowbit(x) x&(-x)
#define cerr(x) cout<<#x<<"="<<x<<endl
#define fi first
#define se second
#define N 100010
const db eps=1e-10;
int n;
ll rx,ry,r;
struct node{
    ll x,y;
    node(){}
    node(ll _x,ll _y):x(_x),y(_y){}
    node operator+(const node&t) const {return {x+t.x,y+t.y};}
    node operator-(const node&t) const {return {x-t.x,y-t.y};}
}p[N],o;
int js(int x) {
    return x>n?1:x;
}
ll dis(node a,node b) {
    ll dx=a.x-b.x,dy=a.y-b.y;
    return dx*dx+dy*dy;
}
ll cross(node a,node b) {
    return a.x*b.y-b.x*a.y;
}
ll pow_(ll x) {return x*x;}
void solve() {
    cin>>n;
    cin>>rx>>ry>>r;
    o=node(rx,ry);
    for(int i=1;i<=n;i++) {
        cin>>p[i].x>>p[i].y;
    }
    ll ans=0,mx=0;
    for(int i=1,j=i+1;i<=n;i++) {
        int id=js(j+1);
        while(cross(p[id]-p[i],o-p[i])>eps && pow_(cross(p[id]-p[i],o-p[i]))>=pow_(r)*dis(p[id],p[i]) && id!=i) {
            ll s=cross(p[j]-p[i],p[id]-p[i]);
            ans+=s,j=id,id=js(j+1);
            mx=max(mx,ans);
        }
        int tmp=js(i+1);
        ans-=cross(p[tmp]-p[i],p[j]-p[i]);
    }
    cout<<mx<<endl;
}
int main() {
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int T;
    cin>>T;
    while(T--) 
    solve();
    return 0;
}

Details

answer.code:3:9: error: ‘int_128’ does not name a type
    3 | typedef int_128 ll;
      |         ^~~~~~~
answer.code:14:1: error: ‘ll’ does not name a type; did you mean ‘ull’?
   14 | ll rx,ry,r;
      | ^~
      | ull
answer.code:16:5: error: ‘ll’ does not name a type; did you mean ‘ull’?
   16 |     ll x,y;
      |     ^~
      |     ull
answer.code:18:12: error: expected ‘)’ before ‘_x’
   18 |     node(ll _x,ll _y):x(_x),y(_y){}
      |         ~  ^~~
      |            )
answer.code: In member function ‘node node::operator+(const node&) const’:
answer.code:19:49: error: ‘x’ was not declared in this scope
   19 |     node operator+(const node&t) const {return {x+t.x,y+t.y};}
      |                                                 ^
answer.code:19:53: error: ‘const struct node’ has no member named ‘x’
   19 |     node operator+(const node&t) const {return {x+t.x,y+t.y};}
      |                                                     ^
answer.code:19:55: error: ‘y’ was not declared in this scope; did you mean ‘yn’?
   19 |     node operator+(const node&t) const {return {x+t.x,y+t.y};}
      |                                                       ^
      |                                                       yn
answer.code:19:59: error: ‘const struct node’ has no member named ‘y’
   19 |     node operator+(const node&t) const {return {x+t.x,y+t.y};}
      |                                                           ^
answer.code:19:60: error: could not convert ‘{<expression error>, <expression error>}’ from ‘<brace-enclosed initializer list>’ to ‘node’
   19 |     node operator+(const node&t) const {return {x+t.x,y+t.y};}
      |                                                            ^
      |                                                            |
      |                                                            <brace-enclosed initializer list>
answer.code: In member function ‘node node::operator-(const node&) const’:
answer.code:20:49: error: ‘x’ was not declared in this scope
   20 |     node operator-(const node&t) const {return {x-t.x,y-t.y};}
      |                                                 ^
answer.code:20:53: error: ‘const struct node’ has no member named ‘x’
   20 |     node operator-(const node&t) const {return {x-t.x,y-t.y};}
      |                                                     ^
answer.code:20:55: error: ‘y’ was not declared in this scope; did you mean ‘yn’?
   20 |     node operator-(const node&t) const {return {x-t.x,y-t.y};}
      |                                                       ^
      |                                                       yn
answer.code:20:59: error: ‘const struct node’ has no member named ‘y’
   20 |     node operator-(const node&t) const {return {x-t.x,y-t.y};}
      |                                                           ^
answer.code:20:60: error: could not convert ‘{<expression error>, <expression error>}’ from ‘<brace-enclosed initializer list>’ to ‘node’
   20 |     node operator-(const node&t) const {return {x-t.x,y-t.y};}
      |                                                            ^
      |                                                            |
      |                                                            <brace-enclosed initializer list>
answer.code: At global scope:
answer.code:25:1: error: ‘ll’ does not name a type; did you mean ‘ull’?
   25 | ll dis(node a,node b) {
      | ^~
      | ull
answer.code:29:1: error: ‘ll’ does not name a type; did you mean ‘ull’?
   29 | ll cross(node a,node b) {
      | ^~
      | ull
answer.code:32:1: error: ‘ll’ does not name a type; did you mean ‘ull’?
   32 | ll pow_(ll x) {return x*x;}
      | ^~
      | ull
answer.code: In function ‘void solve()’:
answer.code:35:10: error: ‘rx’ was not declared in this scope
   35 |     cin>>rx>>ry>>r;
      |          ^~
answer.code:35:14: error: ‘ry’ was not declared in this scope
   35 |     cin>>rx>>ry>>r;
      |              ^~
answer.code:35:18: error: ‘r’ was not declared in this scope
   35 |     cin>>rx>>ry>>r;
      |                  ^
answer.code:38:19: error: ‘struct node’ has no member named ‘x’
   38 |         cin>>p[i].x>>p[i].y;
      |                   ^
answer.code:38:27: error: ‘struct node’ has no member named ‘y’
   38 |         cin>>p[i].x>>p[i].y;
      |                           ^
answer.code:40:5: error: ‘ll’ was not declared in this scope; did you mean ‘ull’?
   40 |     ll ans=0,mx=0;
      |     ^~
      |     ull
answer.code:43:15: error: ‘cross’ was not declared in this scope
   43 |         while(cross(p[id]-p[i],o-p[i])>eps && pow_(cross(p[id]-p[i],o-p[i]))>=pow_(r)*dis(p[id],p[i]) && id!=i) {
      |               ^~~~~
answer.code:43:47: error: ‘pow_’ was not declared in this scope; did you mean ‘powl’?
   43 |         while(cross(p[id]-p[i],o-p[i])>eps && pow_(cross(p[id]-p[i],o-p[i]))>=pow_(r)*dis(p[id],p[i]) && id!=i) {
      |                                               ^~~~
      |           ...