답안 #8589

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
8589 2014-09-17T16:20:22 Z yuioyuio 사회적 불평등 (TOKI14_social) C++
0 / 100
300 ms 1836 KB
#include <cstdio>

int main () {
	int N;
	int L[111111];
	int P[111111];

	scanf("%d", &N);
	for (int i=0; i<N; i++) {
		scanf("%d %d", &L[i], &P[i]);
	}

	int sum=0;
	int c1,c2,c;
	for (int i=0; i<N-1; i++) {
		for (int j=i+1; j<N; j++) {
			if (L[i]>=L[j]) c1=L[i]-L[j];
			else c1=(L[i]-L[j])*-1;
			if (P[i]>=P[j]) c2=P[i]-P[j];
			else c2=(P[i]-P[j])*-1;
			c=c1*c2;
			sum+=c;
		}
	}
	printf("%d", sum);
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1828 KB Output is correct
2 Correct 0 ms 1836 KB Output is correct
3 Correct 0 ms 1832 KB Output is correct
4 Correct 0 ms 1832 KB Output is correct
5 Correct 0 ms 1832 KB Output is correct
6 Correct 0 ms 1828 KB Output is correct
7 Correct 0 ms 1832 KB Output is correct
8 Correct 0 ms 1832 KB Output is correct
9 Correct 16 ms 1836 KB Output is correct
10 Incorrect 44 ms 1832 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 300 ms 1832 KB Program timed out
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 300 ms 1828 KB Program timed out
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 300 ms 1832 KB Program timed out
2 Halted 0 ms 0 KB -