Submission #64794112
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
using ll=__float128;
int n,bk[305];
ll sx[305],sy[305],gx[305],gy[305];
bool vis[305];
vector<int>con[305];
bool dfs(int u){
for(int v:con[u])if(!vis[v]){
vis[v]=1;
if(!bk[v] || dfs(bk[v]))return bk[v]=u,1;
}
return 0;
}
ll sqr(ll x){return x*x;}
bool check(ll mid){
for(int i=1;i<=n;i++){
bk[i]=0,con[i].clear();
for(int j=1;j<=n;j++)if(sqr(gx[j]-sx[i])+sqr(gy[j]-sy[i])<=mid*mid)con[i].push_back(j);
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++)vis[j]=0;
if(!dfs(i))return 0;
}
return 1;
}
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++)scanf("%Lf%Lf",&sx[i],&sy[i]);
for(int i=1;i<=n;i++)scanf("%Lf%Lf",&gx[i],&gy[i]);
ll l=0,r=1.5e18,mid;
for(int t=0;t<100;t++){
mid=(l+r)/2;
if(check(mid))r=mid;
else l=mid+1e-8;
}
printf("%.7Lf",l);
}
Submission Info
| Submission Time |
|
| Task |
G - Push Simultaneously |
| User |
zeyuanliu |
| Language |
C++ 20 (gcc 12.2) |
| Score |
0 |
| Code Size |
860 Byte |
| Status |
WA |
| Exec Time |
2207 ms |
| Memory |
4144 KiB |
Compile Error
Main.cpp: In function ‘int main()’:
Main.cpp:29:39: warning: format ‘%Lf’ expects argument of type ‘long double*’, but argument 2 has type ‘ll*’ {aka ‘__float128*’} [-Wformat=]
29 | for(int i=1;i<=n;i++)scanf("%Lf%Lf",&sx[i],&sy[i]);
| ~~^ ~~~~~~
| | |
| | ll* {aka __float128*}
| long double*
Main.cpp:29:42: warning: format ‘%Lf’ expects argument of type ‘long double*’, but argument 3 has type ‘ll*’ {aka ‘__float128*’} [-Wformat=]
29 | for(int i=1;i<=n;i++)scanf("%Lf%Lf",&sx[i],&sy[i]);
| ~~^ ~~~~~~
| | |
| | ll* {aka __float128*}
| long double*
Main.cpp:30:39: warning: format ‘%Lf’ expects argument of type ‘long double*’, but argument 2 has type ‘ll*’ {aka ‘__float128*’} [-Wformat=]
30 | for(int i=1;i<=n;i++)scanf("%Lf%Lf",&gx[i],&gy[i]);
| ~~^ ~~~~~~
| | |
| | ll* {aka __float128*}
| long double*
Main.cpp:30:42: warning: format ‘%Lf’ expects argument of type ‘long double*’, but argument 3 has type ‘ll*’ {aka ‘__float128*’} [-Wformat=]
30 | for(int i=1;i<=n;i++)scanf("%Lf%Lf",&gx[i],&gy[i]);
| ~~^ ~~~~~~
| | |
| | ll* {aka __float128*}
| long double*
Main.cpp:37:21: warning: format ‘%Lf’ expects argument of type ‘long double’, but argument 2 has type ‘ll’ {aka ‘__float128’} [-Wformat=]
37 | printf("%.7Lf",l);
| ~~~~^ ~
| | |
| | ll {aka __float128}
| long double
Main.cpp:28:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
28 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
Main.cpp:29:35: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
29 | for(int i=1;i<=n;i++)scanf("%Lf%Lf",&sx[i],&sy[i]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:30:35: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
30 | for(int i=1;i<=n;i++)scanf("%Lf%Lf",&gx[i],&gy[i]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
0 / 575 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All |
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 01_random_28.txt, 01_random_29.txt, 01_random_30.txt, 01_random_31.txt, 02_handmade_32.txt, 02_handmade_33.txt, 02_handmade_34.txt, 02_handmade_35.txt, 02_handmade_36.txt, 02_handmade_37.txt, 02_handmade_38.txt, 02_handmade_39.txt, 02_handmade_40.txt, 02_handmade_41.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 00_sample_00.txt |
WA |
2 ms |
3772 KiB |
| 00_sample_01.txt |
WA |
2 ms |
3712 KiB |
| 00_sample_02.txt |
WA |
8 ms |
3704 KiB |
| 01_random_03.txt |
TLE |
2207 ms |
4036 KiB |
| 01_random_04.txt |
TLE |
2207 ms |
4092 KiB |
| 01_random_05.txt |
TLE |
2207 ms |
4128 KiB |
| 01_random_06.txt |
TLE |
2207 ms |
4016 KiB |
| 01_random_07.txt |
TLE |
2207 ms |
4056 KiB |
| 01_random_08.txt |
TLE |
2207 ms |
4028 KiB |
| 01_random_09.txt |
TLE |
2207 ms |
3964 KiB |
| 01_random_10.txt |
TLE |
2207 ms |
4092 KiB |
| 01_random_11.txt |
TLE |
2207 ms |
4024 KiB |
| 01_random_12.txt |
TLE |
2207 ms |
4060 KiB |
| 01_random_13.txt |
TLE |
2207 ms |
4140 KiB |
| 01_random_14.txt |
TLE |
2207 ms |
4036 KiB |
| 01_random_15.txt |
TLE |
2207 ms |
4040 KiB |
| 01_random_16.txt |
TLE |
2207 ms |
4068 KiB |
| 01_random_17.txt |
TLE |
2207 ms |
4092 KiB |
| 01_random_18.txt |
TLE |
2207 ms |
4136 KiB |
| 01_random_19.txt |
TLE |
2207 ms |
4032 KiB |
| 01_random_20.txt |
TLE |
2207 ms |
4032 KiB |
| 01_random_21.txt |
TLE |
2207 ms |
4024 KiB |
| 01_random_22.txt |
TLE |
2207 ms |
3948 KiB |
| 01_random_23.txt |
TLE |
2207 ms |
4040 KiB |
| 01_random_24.txt |
TLE |
2207 ms |
3964 KiB |
| 01_random_25.txt |
TLE |
2207 ms |
3968 KiB |
| 01_random_26.txt |
TLE |
2207 ms |
4036 KiB |
| 01_random_27.txt |
TLE |
2207 ms |
4128 KiB |
| 01_random_28.txt |
TLE |
2207 ms |
4064 KiB |
| 01_random_29.txt |
TLE |
2207 ms |
4032 KiB |
| 01_random_30.txt |
TLE |
2207 ms |
4132 KiB |
| 01_random_31.txt |
TLE |
2207 ms |
3948 KiB |
| 02_handmade_32.txt |
TLE |
2207 ms |
4068 KiB |
| 02_handmade_33.txt |
TLE |
2207 ms |
4144 KiB |
| 02_handmade_34.txt |
TLE |
2207 ms |
4024 KiB |
| 02_handmade_35.txt |
TLE |
2207 ms |
4132 KiB |
| 02_handmade_36.txt |
TLE |
2207 ms |
4016 KiB |
| 02_handmade_37.txt |
TLE |
2207 ms |
4036 KiB |
| 02_handmade_38.txt |
TLE |
2207 ms |
4064 KiB |
| 02_handmade_39.txt |
TLE |
2207 ms |
4092 KiB |
| 02_handmade_40.txt |
TLE |
2207 ms |
4132 KiB |
| 02_handmade_41.txt |
TLE |
2207 ms |
4024 KiB |