# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
7104 |
2014-07-25T11:12:06 Z |
baneling100 |
지우개 (GA4_eraser) |
C++ |
|
12 ms |
3040 KB |
#include <stdio.h>
int N, M, A[100001];
long long B[100001], C[100001], Ans;
void input(void)
{
int i, temp;
scanf("%d",&N);
for(i=1 ; i<=N ; i++)
{
scanf("%d",&temp);
A[temp]++;
if(M<temp)
M=temp;
}
}
void process(void)
{
int i;
long long sum=0;
for(i=M ; i>=2 ; i--)
{
sum+=(long long)A[i]*i;
B[i-1]=sum*A[i-1]*(i-1);
}
sum=0;
for(i=M-1 ; i>=2 ; i--)
{
sum+=B[i];
C[i-1]=sum*A[i-1]*(i-1);
}
for(i=1 ; i<=M-2 ; i++)
Ans+=C[i];
}
void output(void)
{
printf("%lld",Ans);
}
int main(void)
{
input();
process();
output();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
3040 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
3040 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
3040 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
3040 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
3040 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
3040 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |