Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: 曹北健(37509)
- Result: AC Submission_id: 4162855
- Created at: Mon Mar 14 2022 21:23:04 GMT+0800 (China Standard Time)
- Problem: 5395 Time: 24 Memory: 5592
- */
- #include <stdio.h>
- double ans[1919810];
- int main(){
- int n,x[1000],y[1000],i=0,j,k,l,m;
- scanf("%d",&n);
- while ((scanf("%d %d",&x[i],&y[i]))!=EOF){
- i++;
- }
- l=0;
- for(j=1;j<n;j++){
- for(k=0;k<j;k++){
- ans[l]=1.0*(y[j]-y[k])/(x[j]-x[k]);
- l++;
- }
- }
- double max=-1e12;
- for(m=0;m<l;m++){
- if(ans[m]>max){
- max=ans[m];
- }
- }
- printf("%.3f",max);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment