# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
9780 |
2014-09-28T08:54:25 Z |
dominyellow |
Uniting (kriii2_U) |
C++ |
|
0 ms |
1236 KB |
#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;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1236 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |