#include <stdio.h>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
long modu = 1000000007;
long get_multi(vector<long> vec){
long res = vec[0]%modu;
for(int i=1; i<vec.size(); i++){
res = (res*(vec[i]%modu))%modu;
}
return res;
}
long get_permu(long a){
if(a == 2){
return 2;
}
return (a%modu * (a-1)%modu)%modu + get_permu(a-1);
}
int main(void){
long dept_count;
scanf("%ld", &dept_count);
vector<long> unite_cost;
long tmp;
for(int i=0; i<dept_count; i++){
scanf("%ld", &tmp);
unite_cost.push_back(tmp);
}
printf("%ld\n", get_multi(unite_cost));
printf("%ld\n", get_permu(dept_count));
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1236 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |