| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 3959 | movie_jo | Evaluation (kriii1_E) | C11 | 2000 ms | 4992 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define DIV 1000000007
long long a[100000], b[100000], c[100000], d[100000], p[100000];
int main(void)
{
int N;
long long S = 0, i, j, n, m;
scanf("%d", &N);
for(i = 0; i < N; i++)
{
scanf("%lld %lld %lld %lld %lld", a + i, b + i, c + i, d + i, p + i);
S = (S + p[i]*p[i]*((c[i] - a[i] + 1)*(d[i] - b[i] + 1)%DIV))%DIV;
for(j = 0; j < i; j++)
{
if(a[i] <= c[j] && c[i] >= a[j] && b[i] <= d[j] && d[i] >= b[j])
{
n = (c[i] > c[j]?c[j]:c[i]) - (a[i] > a[j]?a[i]:a[j]) + 1;
m = (d[i] > d[j]?d[j]:d[i]) - (b[i] > b[j]?b[i]:b[j]) + 1;
S = (S + 2*p[i]*p[j]*(n*m%DIV))%DIV;
}
}
}
printf("%lld\n", S);
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
