QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#623592#9434. Italian Cuisineucup-team4153#WA 0ms3836kbC++202.1kb2024-10-09 13:21:082024-10-09 13:21:09

Judging History

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

  • [2024-10-09 13:21:09]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3836kb
  • [2024-10-09 13:21:08]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;using ld=long double;using ll=long long;using i128=__int128;
using pll=pair<ll,ll>;
const int M=1e9+7,inv2=(M+1)/2,P2=15,P=P2*3,N=64;//N=32
const ld eps=1e-8,pi=acos(-1);
pll operator -(pll A,pll B){return {A.first-B.first,A.second-B.second};}
ll operator %(pll A,pll B){return -A.second*B.first+A.first*B.second;}
bool opc=0;
ll poww(ll bs,ll x){ll res=1;for(;x;x>>=1,(bs*=bs)%=M)if(x&1)(res*=bs)%=M;return res;}
ll invv(ll bs){return poww(bs,M-2);}
void add(ll&a,ll b){a+=b;if(a>=M)a-=M;}
void xin(pll&A){cin>>A.first>>A.second;}
void xout(pll&A){cout<<"["<<A.first<<','<<A.second<<"]";}
ll dis2(pll A){return A.first*A.first+A.second*A.second;}
ll R;
struct S
{
    int n,l,r;pll bas;ll sum=0,res=0;
    vector<pll>pos;
    /*
5
1 1 1
0 0
1 0
5 0
3 3
0 5

 */
    bool jud(int dS,int dT)
    {
        if(dT==10)exit(0);
        if(opc)cout<<"--------------\n";
        auto pS=pos[dS%n],pT=pos[dT%n],pd=pT-pS;pS=pll()-pS;
        //ll v=
        if(opc){xout(pS);xout(pd);cout<<(pS%pd)<<"&"<<R<<"&"<<dis2(pd)<<'\n';}
        ll v=(pS%pd);if(v<=0)return 0;
        if(opc)cout<<dS<<"&"<<dT<<":"<<bool(i128(v)*(v)>=(i128)R*R*dis2(pd))<<'\n';
        return i128(pS%pd)*(pS%pd)>=(i128)R*R*dis2(pd);
    }
    void outp(){if(opc)cout<<l<<'/'<<r<<"sum"<<sum<<'\n';}
    void move_l(){sum-=(pos[(r)%n]-pos[(l)%n])%(pos[(l+1)%n]-pos[(l)%n]);l++;outp();}
    void move_r(){sum+=(pos[(r+1)%n]-pos[(l)%n])%(pos[(r)%n]-pos[(l)%n]);r++;outp();}
    void ini()
    {
        cin>>n;pos.resize(n);xin(bas);cin>>R;
        for(auto&k:pos)xin(k),k=k-bas;reverse(pos.begin(),pos.end());
        for(l=0,r=-1;l<n;move_l())
        {
            while(r<l||jud(l,r+1))move_r();
            res=max(res,sum);
            if(opc)cout<<l<<"*"<<r<<"*"<<sum<<'\n';
        }
    }
    void solve()
    {
        cout<<res<<'\n';
    }
};
void precal()
{

}
signed main()
{
    opc=0;
    cout<<fixed<<setprecision(12);
    //ios::sync_with_stdio(0);cin.tie(0);
    precal();
    int t=1;cin>>t;
    while(t--){S SS;SS.ini();SS.solve();}
}
/*
5
1 1 1
0 0
1 0
5 0
3 3
0 5

 */

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3836kb

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:

5
24
0

result:

ok 3 number(s): "5 24 0"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

1
6
0 0 499999993
197878055 -535013568
696616963 -535013568
696616963 40162440
696616963 499999993
-499999993 499999993
-499999993 -535013568

output:

0

result:

ok 1 number(s): "0"

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3604kb

input:

6666
19
-142 -128 26
-172 -74
-188 -86
-199 -157
-200 -172
-199 -186
-195 -200
-175 -197
-161 -188
-144 -177
-127 -162
-107 -144
-90 -126
-87 -116
-86 -104
-89 -97
-108 -86
-125 -80
-142 -74
-162 -72
16
-161 -161 17
-165 -190
-157 -196
-154 -197
-144 -200
-132 -200
-128 -191
-120 -172
-123 -163
-138...

output:


result:

wrong answer Answer contains longer sequence [length = 6666], but output contains 0 elements