Submission #19132953


Source Code Expand

#include <stdio.h>
int main(void){
	int n,i,j,ans=0,x[1000],y[1000];
	double k,x2[1000],y2[1000];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %d",&x[i],&y[i]);
		x2[i]=x[i]*0.1*10;
		y2[i]=y[i]*0.1*10;
	}
	
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			k=(y2[j]-y2[i])/(x2[j]-x2[i]);
			if(-1<=k&&k<=1)ans++;
		}
	}
	
	printf("%d\n",ans);
	return 0;
}

Submission Info

Submission Time
Task B - Gentle Pairs
User spade
Language C (GCC 9.2.1)
Score 0
Code Size 375 Byte
Status WA
Exec Time 9 ms
Memory 1760 KiB

Compile Error

./Main.c: In function ‘main’:
./Main.c:5:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
    5 |  scanf("%d",&n);
      |  ^~~~~~~~~~~~~~
./Main.c:7:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
    7 |   scanf("%d %d",&x[i],&y[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 3
AC × 14
WA × 7
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
random_01.txt AC 5 ms 1652 KiB
random_02.txt AC 1 ms 1648 KiB
random_03.txt AC 2 ms 1688 KiB
random_04.txt AC 3 ms 1664 KiB
random_05.txt WA 1 ms 1748 KiB
random_06.txt AC 1 ms 1648 KiB
random_07.txt AC 1 ms 1664 KiB
random_08.txt AC 1 ms 1656 KiB
random_09.txt AC 1 ms 1660 KiB
random_10.txt AC 1 ms 1656 KiB
random_11.txt WA 8 ms 1696 KiB
random_12.txt WA 7 ms 1748 KiB
random_13.txt WA 9 ms 1760 KiB
random_14.txt WA 9 ms 1660 KiB
random_15.txt AC 2 ms 1732 KiB
random_16.txt WA 2 ms 1756 KiB
random_17.txt WA 6 ms 1672 KiB
random_18.txt AC 3 ms 1748 KiB
sample_01.txt AC 1 ms 1724 KiB
sample_02.txt AC 1 ms 1692 KiB
sample_03.txt AC 1 ms 1676 KiB