A. k-Factorization 题意:给你一个n,问你这个数能否分割成k个大于1的数的乘积. 题解:因为n的取值范围很小,所以感觉dfs应该不会有很多种可能-- #include<bits/stdc++.h> using namespace std; long long n; int k; vector<int> ans; void dfs(int x,long long now,int st){ if(x==k&&now==n){ for(int i=0;i…
这场edu蛮简单的…… 连道数据结构题都没有…… A.随便质因数分解凑一下即可. #include<bits/stdc++.h> #define N 100005 using namespace std; int a[N],cnt,k,x,n; int main(){ scanf("%d%d",&n,&k); ;k>&&n>;i++) &&n%i==;--k,n/=i)a[++cnt]=i; ){puts(;} ;…
Description Petya recieved a gift of a string s with length up to 105 characters for his birthday. He took two more empty strings t and u and decided to play a game. This game has two possible moves: Extract the first character of s and append t with…
Description You are given sequence a1, a2, ..., an of integer numbers of length n. Your task is to find such subsequence that its sum is odd and maximum among all such subsequences. It's guaranteed that given sequence contains subsequence with odd su…
Description Given a positive integer n, find k integers (not necessary distinct) such that all these integers are strictly greater than 1, and their product is equal to n. Input The first line contains two integers n and k (2 ≤ n ≤ 100000, 1 ≤ k ≤ 20…