답안 #7898

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
7898 2014-08-24T02:48:02 Z gs14004 지우개 (GA4_eraser) C++
46 / 100
24 ms 2648 KB
#include <cstdio>

int n;
long long a[100005];
long long sum[100005];
long long mod = 1e9+7;
int main(){
    int t;
    scanf("%d",&n);
    for (int i=0; i<n; i++) {
        scanf("%d",&t);
        a[t]++;
    }
    for (int i=1; i<=100000; i++) {
        a[i] *= i;
        a[i] %= mod;
    }
    for (int i=1; i<=100000; i++) {
        sum[i] = a[i] + sum[i-1];
    }
    long long res = 0;
    for (int i=1; i<=1000; i++) {
        for (int j=i+1; j<=1000; j++) {
            res += a[i] * a[j] * (sum[100000] - sum[j]);
            res %= mod;
        }
    }
    printf("%lld",res);
    // iCnti
    
}
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 2648 KB Output is correct
2 Correct 12 ms 2648 KB Output is correct
3 Correct 12 ms 2648 KB Output is correct
4 Correct 12 ms 2648 KB Output is correct
5 Correct 12 ms 2648 KB Output is correct
6 Correct 12 ms 2648 KB Output is correct
7 Correct 8 ms 2648 KB Output is correct
8 Correct 12 ms 2648 KB Output is correct
9 Correct 12 ms 2648 KB Output is correct
10 Correct 12 ms 2648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 2648 KB Output is correct
2 Correct 12 ms 2648 KB Output is correct
3 Correct 12 ms 2648 KB Output is correct
4 Correct 12 ms 2648 KB Output is correct
5 Correct 12 ms 2648 KB Output is correct
6 Correct 12 ms 2648 KB Output is correct
7 Correct 12 ms 2648 KB Output is correct
8 Correct 12 ms 2648 KB Output is correct
9 Correct 12 ms 2648 KB Output is correct
10 Correct 12 ms 2648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 2648 KB Output is correct
2 Correct 8 ms 2648 KB Output is correct
3 Correct 8 ms 2648 KB Output is correct
4 Correct 8 ms 2648 KB Output is correct
5 Correct 12 ms 2648 KB Output is correct
6 Correct 12 ms 2648 KB Output is correct
7 Correct 8 ms 2648 KB Output is correct
8 Correct 12 ms 2648 KB Output is correct
9 Correct 8 ms 2648 KB Output is correct
10 Correct 12 ms 2648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 2648 KB Output is correct
2 Correct 8 ms 2648 KB Output is correct
3 Correct 12 ms 2648 KB Output is correct
4 Correct 8 ms 2648 KB Output is correct
5 Correct 8 ms 2648 KB Output is correct
6 Correct 12 ms 2648 KB Output is correct
7 Correct 8 ms 2648 KB Output is correct
8 Correct 12 ms 2648 KB Output is correct
9 Correct 8 ms 2648 KB Output is correct
10 Correct 12 ms 2648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 24 ms 2648 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 20 ms 2648 KB Output isn't correct
2 Halted 0 ms 0 KB -