# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
5920 |
2014-05-23T10:15:53 Z |
baneling100 |
지우개 (GA4_eraser) |
C++ |
|
16 ms |
3432 KB |
#include <stdio.h>
#define MOD 1000000007
long long N, A[100001], M, B[100001], C[100001], Ans;
void input(void)
{
int i;
long long temp;
scanf("%lld",&N);
for(i=1 ; i<=N ; i++)
{
scanf("%lld",&temp);
C[i]=temp;
B[temp]=1;
A[temp]+=temp;
A[temp]%=MOD;
if(M<temp)
M=temp;
}
for(i=M-1 ; i>=1 ; i--)
{
A[i]+=A[i+1];
A[i]%=MOD;
}
for(i=1 ; i<=M ; i++)
if(B[i])
{
B[i]=i*A[i+1];
B[i]%=MOD;
}
for(i=M-1 ; i>=1 ; i--)
{
B[i]+=B[i+1];
B[i]%=MOD;
}
}
void process(void)
{
int i;
for(i=1 ; i<=N ; i++)
{
Ans+=C[i]*B[C[i]+1];
Ans%=MOD;
}
}
void output(void)
{
printf("%lld",Ans);
}
int main(void)
{
input();
process();
output();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
3432 KB |
Output is correct |
2 |
Correct |
0 ms |
3432 KB |
Output is correct |
3 |
Correct |
0 ms |
3432 KB |
Output is correct |
4 |
Correct |
0 ms |
3432 KB |
Output is correct |
5 |
Correct |
0 ms |
3432 KB |
Output is correct |
6 |
Correct |
0 ms |
3432 KB |
Output is correct |
7 |
Correct |
0 ms |
3432 KB |
Output is correct |
8 |
Correct |
0 ms |
3432 KB |
Output is correct |
9 |
Correct |
0 ms |
3432 KB |
Output is correct |
10 |
Correct |
0 ms |
3432 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
3432 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
3432 KB |
Output is correct |
2 |
Correct |
0 ms |
3432 KB |
Output is correct |
3 |
Correct |
0 ms |
3432 KB |
Output is correct |
4 |
Correct |
0 ms |
3432 KB |
Output is correct |
5 |
Correct |
0 ms |
3432 KB |
Output is correct |
6 |
Correct |
0 ms |
3432 KB |
Output is correct |
7 |
Correct |
0 ms |
3432 KB |
Output is correct |
8 |
Correct |
0 ms |
3432 KB |
Output is correct |
9 |
Correct |
0 ms |
3432 KB |
Output is correct |
10 |
Correct |
0 ms |
3432 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
3432 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
16 ms |
3432 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
16 ms |
3432 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |