Submission #2385

#TimeUsernameProblemLanguageResultExecution timeMemory
2385rbwhddl2000생일수 I (GA4_birthday1)C++98
0 / 100
0 ms1276 KiB
#include<stdio.h> #include<stdlib.h> int d[100001]; int compare(const void *a , const void *b){ return ( *(int*)a - *(int*)b ); } int main() { int n, i, j, k; long long sum=0, t; scanf("%d", &n); for(i=1;i<=n;i++)scanf("%d", &d[i]); qsort(d, n+1, sizeof(int), compare); for(i=1;i<=n;i++)for(j=i+1;j<=n;j++)for(k=j+1;k<=n;k++){ if(d[i] < d[j] && d[j] < d[k]){ t=d[i]*d[j]*d[k]; sum+=t; if(sum>1000000007)sum%=1000000007; } }printf("%lld", sum); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...