题解列表
简单题,取每一位的进制为max(max(A[i],B[i])+1,2LL)
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>//简单题 using namespace std;#define maxn 1010#define maxma 10001……
01背包(动态规划)
摘要:解题思路:动态规划
对于01背包问题选择方法的集合可以分成2种:
①不选第i个物品,并且总体积不大于j的集合所达到的最大值:f[i-1][j]
②选择1~i个物品,并且总体积不大于j的集合所达……
2846: 统计数字字符个数
摘要:```cpp
#include
#include
using namespace std;
int main()
{
int s=0;
char a[255];
……
2916: 谁考了第k名
摘要:```cpp
#include
using namespace std;
struct s
{
int xuehao;
double chengji;
};
int m……
2921: 整数奇偶排序
摘要:```cpp
#include
using namespace std;
int main()
{
int odd[10],even[10],num,i,j,l=0,r=0;
……
2907: 不与最大数相同的数字之和
摘要:```cpp
#include
using namespace std;
int main()
{
int N,a[100],sum=0,x=0;
cin>>N;
……
2905: 最大值和最小值的差
摘要:```cpp
#include
using namespace std;
int main()
{
int M,max=-10001,min=10001,x;
cin>>M……
2901: 查找特定的值
摘要:```cpp
#include
#include
using namespace std;
int main()
{
int m,n,a[10000],i=0;
mems……
1187: 假币问题
摘要:```cpp
#include
#include
using namespace std;
int main()
{
int n;
cin>>n;
while(……