# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
20009 | ainta | 악수 (kriii4_D) | C++98 | 4000 ms | 1084 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
int n, F[11], cnt;
long long Mod = 1000000007, Res;
bool E[11][11], v[11];
long long Pow(long long a, int b){
long long r = 1;
while(b){
if(b&1)r=r*a%Mod;
a=a*a%Mod;
b>>=1;
}
return r;
}
void DFS(int a){
cnt++;
v[a]=true;
int i;
for(i=1;i<=n;i++)if(!v[i]&&E[a][i])DFS(i);
}
void Do(int cc){
int i,j;
cnt = 0;
for(i=1;i<=n;i++)v[i]=false;
DFS(1);
if(cnt == n){
Res = (Res + cc*Pow(F[n*(n-1)/2]/F[n*(n-1)/2-cc],Mod-2))%Mod;
return;
}
for(i=1;i<n;i++){
for(j=i+1;j<=n;j++){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |