git reimport
This commit is contained in:
77
archive/2019.02/2019.02.27 - Hello 2019/TaskD.java
Normal file
77
archive/2019.02/2019.02.27 - Hello 2019/TaskD.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package chelper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.InputReader;
|
||||
import io.OutputWriter;
|
||||
import prep.Algo;
|
||||
import prep.LongMod;
|
||||
import solutions.ChelperSolution;
|
||||
|
||||
|
||||
public class TaskD extends ChelperSolution {
|
||||
|
||||
@Override
|
||||
public void solve(int testNumber, InputReader in, OutputWriter out) {
|
||||
super.solve(testNumber, in, out);
|
||||
}
|
||||
|
||||
LongMod mod = new LongMod(1_000_000_007L);
|
||||
|
||||
long[][] matmul(long[][] a, long[][] b) {
|
||||
int n = a.length;
|
||||
|
||||
long[][] c = new long[n][n];
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int j = 0; j < n; j++) {
|
||||
for (int k = 0; k < n; k++) {
|
||||
c[i][j] = mod.sum(
|
||||
c[i][j],
|
||||
mod.prod(a[i][k], b[k][j])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
long[][] matpow(long[][] a, int b) {
|
||||
if (b == 1) {
|
||||
return a;
|
||||
}
|
||||
|
||||
if (b % 2 == 0) {
|
||||
long[][] c = matpow(a, b / 2);
|
||||
return matmul(c, c);
|
||||
} else {
|
||||
return matmul(
|
||||
a,
|
||||
matpow(a, b - 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// public long solvePrime(long prime, int power, int k) {
|
||||
//
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void solve(int testNumber) {
|
||||
long n = in.nextLong();
|
||||
int k = in.nextInt();
|
||||
|
||||
Map<Long, Integer> factorization = Algo.dumbFactorize(n);
|
||||
|
||||
long answer = 1;
|
||||
|
||||
for (Map.Entry<Long, Integer> entry : factorization.entrySet()) {
|
||||
long prime = entry.getKey();
|
||||
int power = entry.getValue();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user