Submission #17445

#TimeUsernameProblemLanguageResultExecution timeMemory
17445atomzeno지우개 (GA4_eraser)C++98
100 / 100
18 ms1864 KiB
#include<cstdio> #define MOD 1000000007 long long a[100001]; long long x,y,z,answer; int main(){ int i,j,n; scanf("%d",&n); for(i=0; i<n; i++){ scanf("%d",&j); a[j]+=j; a[j]%=MOD; } for(i=1; i<=100000; i++){ x+=a[i]; x%=MOD; y+=a[i]*a[i]%MOD; y%=MOD; z+=a[i]*a[i]%MOD*a[i]%MOD; z%=MOD; } answer=x*x%MOD*x%MOD; answer-=3*x%MOD*y%MOD; answer+=MOD; answer%=MOD; answer+=2*z%MOD; answer%=MOD; answer*=166666668; answer%=MOD; printf("%lld",answer); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...