Submission #8473495


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
struct{
	double x, y;
}arr[9];
int main(){
	//ios_base::sync_with_stdio(0); cin.tie(0);
	int N;
	scanf("%d",&N);
	for(int i=1;i<=N;i++){
		cin>>arr[i].x>>arr[i].y;
	}
	double ans=0;
	for(int i=1;i<=N;i++){
		for(int j=i+1;j<=N;j++){
			ans+=sqrt((arr[i].x-arr[j].x)*(arr[i].x-arr[j].x) + (arr[i].y-arr[j].y)*(arr[i].y-arr[j].y));
		}
	}
	ans=ans*(double)2/(double)N;
	printf("%.9lf\n",ans);
}

Submission Info

Submission Time
Task C - Average Length
User Seremo
Language C++14 (GCC 5.4.1)
Score 300
Code Size 457 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:9:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&N);
                ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 15
Set Name Test Cases
Sample sample00, sample01, sample02
All handmade03, handmade04, handmade05, random06, random07, random08, random09, random10, random11, random12, random13, random14, sample00, sample01, sample02
Case Name Status Exec Time Memory
handmade03 AC 1 ms 256 KB
handmade04 AC 1 ms 256 KB
handmade05 AC 1 ms 256 KB
random06 AC 1 ms 256 KB
random07 AC 1 ms 256 KB
random08 AC 1 ms 256 KB
random09 AC 1 ms 256 KB
random10 AC 1 ms 256 KB
random11 AC 1 ms 256 KB
random12 AC 1 ms 256 KB
random13 AC 1 ms 256 KB
random14 AC 1 ms 256 KB
sample00 AC 1 ms 256 KB
sample01 AC 1 ms 256 KB
sample02 AC 1 ms 256 KB