Submission #2339

# Submission time Handle Problem Language Result Execution time Memory
2339 2013-07-21T03:35:03 Z crazysoldier 지우개 (GA4_eraser) C++
46 / 100
13 ms 2940 KB
#include <iostream>
#include <stdio.h>

using namespace std;
long long a[100009],b[100009];
int main()
{
    long long n,input,MaX,i,SizE=0;
    long long Sum=0,Mid=0,MiD=0;
    scanf("%lld",&n);
    scanf("%lld",&input); MaX=input; a[input]++;
    for(i=2;i<=n;i++)
    {
        scanf("%d",&input);
        a[input]++;
        if(MaX<input) MaX = input;
    }
    for(i=1;i<=MaX;i++)if(i*a[i])
    {
        SizE++;
        b[SizE]=i*a[i];
    }
    for(i=1;i<=SizE;i++) Mid += b[i];
    Sum += Mid*Mid*Mid;
    for(i=1;i<=SizE;i++) Sum += 2*b[i]*b[i]*b[i];
    Mid = 0;
    for(i=1;i<=SizE;i++){Mid+=b[i]*b[i]; MiD+=b[i];}
    Sum -= 3*Mid*MiD;
    printf("%lld",(Sum/6)%1000000007);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2940 KB Output is correct
2 Correct 0 ms 2940 KB Output is correct
3 Correct 0 ms 2940 KB Output is correct
4 Correct 0 ms 2940 KB Output is correct
5 Correct 0 ms 2940 KB Output is correct
6 Correct 0 ms 2940 KB Output is correct
7 Correct 0 ms 2940 KB Output is correct
8 Correct 0 ms 2940 KB Output is correct
9 Correct 0 ms 2940 KB Output is correct
10 Correct 0 ms 2940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2940 KB Output is correct
2 Correct 0 ms 2940 KB Output is correct
3 Correct 0 ms 2940 KB Output is correct
4 Correct 0 ms 2940 KB Output is correct
5 Correct 0 ms 2940 KB Output is correct
6 Correct 0 ms 2940 KB Output is correct
7 Correct 0 ms 2940 KB Output is correct
8 Correct 0 ms 2940 KB Output is correct
9 Correct 0 ms 2940 KB Output is correct
10 Correct 0 ms 2940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2940 KB Output is correct
2 Correct 0 ms 2940 KB Output is correct
3 Correct 0 ms 2940 KB Output is correct
4 Correct 0 ms 2940 KB Output is correct
5 Correct 0 ms 2940 KB Output is correct
6 Correct 0 ms 2940 KB Output is correct
7 Correct 0 ms 2940 KB Output is correct
8 Correct 0 ms 2940 KB Output is correct
9 Correct 0 ms 2940 KB Output is correct
10 Correct 0 ms 2940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2940 KB Output is correct
2 Correct 0 ms 2940 KB Output is correct
3 Correct 0 ms 2940 KB Output is correct
4 Correct 0 ms 2940 KB Output is correct
5 Correct 0 ms 2940 KB Output is correct
6 Correct 0 ms 2940 KB Output is correct
7 Correct 0 ms 2940 KB Output is correct
8 Correct 0 ms 2940 KB Output is correct
9 Correct 0 ms 2940 KB Output is correct
10 Correct 0 ms 2940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 2940 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 2940 KB Output isn't correct
2 Halted 0 ms 0 KB -