| # | User | Rating |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3447 |
| 6 | Um_nik | 3387 |
| 7 | heuristica | 3322 |
| 8 | turmax | 3317 |
| 9 | tourist | 3307 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 156 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 141 |
| 5 | Errichto | 139 |
| 6 | adamant | 137 |
| 7 | AmShZ | 135 |
| 8 | BledDest | 132 |
| 9 | maroonrk | 131 |
| 10 | qwexd | 129 |
|
0
can you provide code? |
|
0
why my above solution is wrong? |
|
0
what is wrong in it? |
|
-8
In problem F Why always take diameter? |
|
0
please someone explain approach of Div-2 E in easy language? |
|
0
can some explain what is mean by "minimum expected number of turns" in problem E? |
|
0
please , explain proof. |
|
0
you can use HashMap in java but it takes O(n*MAX_SUM) and it will time out |
|
0
public void run() { InputReader sc = new InputReader(System.in); //Scanner sc=new Scanner(System.in); // Random sc=new Random(); PrintWriter out = new PrintWriter(System.out); int a=sc.nextInt();
int b=sc.nextInt();
int n=sc.nextInt();
long fact[]=new long[1000001];
fact[0]=1;
long mod=1000000007;
for (int i = 1; i <1000001 ; i++) {
fact[i]=(fact[i-1]*i)%mod;
}
long ans=0;
for (int noOfA = 0; noOfA <=n ; noOfA++) {
int noOfB=n-noOfA;
if(check(a*noOfA+b*noOfB,a,b)){
ans=(ans+(((fact[n]*modInv(fact[noOfA],mod))%mod)*modInv(fact[noOfB],mod))%mod)%mod;
}
}
out.println(ans);
out.close();
}
boolean check(int n,int a,int b){
while (n>0){
if(n%10==a || n%10==b){
n/=10;
}
else{
return false;
}
}
return true;
} |
|
0
so,this unique representation comes from greedy approach ? |
|
0
my solution is as follow --> i have checked if cell(x,y) is '#' or not. if it is, than i have checked for all 8 adjacent direction to it that whether at least one out of 8 it is possible to make 3X3 matrix.if it is than we can fill this cell and ans is YES and it is not possible to make 3X3 matrix than NO. --> if cell is not '#' than continue. my solution is . http://codeforces.me/contest/1059/submission/43840425 |
|
+4
please anyone explain,in problem c, why this algo. works? |
|
0
Does cut edge algorithm work for parallel edges? |
| Name |
|---|


