URAL1091---Tmutarakan Exams(dp)

不锈钢液态模锻(压射成型)技术可行性研究报告.docx 工程资料 立即下载

University of New Tmutarakan trains the first-class specialists in mental arithmetic. To enter the University you should master arithmetic perfectly. One of the entrance exams at the Divisibility Department is the following. Examinees are asked to find K different numbers that have a common divisor greater than 1. All numbers in each set should not exceed a given number S. The numbers K and S are announced at the beginning of the exam. To exclude copying (the Department is the most prestigious in the town!) each set of numbers is credited only once (to the person who submitted it first).
Last year these numbers were K=25 and S=49 and, unfortunately, nobody passed the exam. Moreover, it was proved later by the best minds of the Department that there do not exist sets of numbers with the required properties. To avoid embarrassment this year, the dean asked for your help. You should find the number of sets of K different numbers, each of the numbers not exceeding S, which have a common divisor greater than 1. Of course, the number of such sets equals the maximal possible number of new students of the Department.
Input
The input contains numbers K and S (2 ≤ K ≤ S ≤ 50).
Output
You should output the maximal possible number of the Department’s new students if this number does not exceed 10000 which is the maximal capacity of the Department, otherwise you should output 10000.
Sample
input output

3 10

11

dp[i][j][k]前i个数选了j个数,gcd为k的方案数

/*************************************************************************
    > File Name: ural1091.cpp
    > Author: ALex
    > Mail: zchao1995@gmail.com 
    > Created Time: 2015年05月28日 星期四 15时08分59秒
 ************************************************************************/

#include <functional>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <map>
#include <bitset>
#include <set>
#include <vector>

using namespace std;

const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const double eps = 1e-15;
typedef long long LL;
typedef pair <int, int> PLL;

LL dp[55][55][55];

int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}

int main() {
    int K, S;
    while (~scanf("%d%d", &K, &S)) {
        for (int i = 0; i <= S; ++i) {
            for (int j = 0; j <= K; ++j) {
                for (int k = 1; k <= S; ++k) {
                    dp[i][j][k] = 0;
                }
            }
        }
        dp[1][1][1] = 1;
        for (int i = 1; i < S; ++i) {
            dp[i + 1][1][i + 1] = 1;
            for (int j = 1; j <= S; ++j) {
                for (int k = 1; k <= S; ++k) {
                    if (!dp[i][j][k]) {
                        continue;
                    }
                    dp[i + 1][j][k] += dp[i][j][k];
                    int g = gcd(k, i + 1);
                    dp[i + 1][j + 1][g] += dp[i][j][k];
                }
            }
        }
        LL ans = 0;
        for (int i = 2; i <= S; ++i) {
            ans += dp[S][K][i];
        }
        if (ans > 10000) {
            ans = 10000;
        }
        printf("%lld\n", ans);
    }
    return 0;
}
基于李雅普诺夫的MPC模型预测AUV水下航行器自主编队轨迹跟踪控制复现 内容概要:本文围绕“基于李雅普诺夫的MPC模型预测AUV水下航行器自主编队轨迹跟踪控制”展开,复现并改进了一种结合李雅普诺夫稳定性理论与模型预测控制(MPC)的先进控制策略,用于实现多个欠驱动自主水下航行器(AUV)的协同编队与精确轨迹跟踪。该方法通过构建合理的代价函数和系统动力学模型,在满足控制约束的同时,利用李雅普诺夫函数确保系统的渐近稳定性,提升了编队控制的鲁棒性与动态响应性能。文中提供了完整的Matlab仿真代码,涵盖环境建模、控制器设计、状态反馈与轨迹优化等关键环节,实现了对多AUV系统在复杂水下环境中自主编队与路径跟踪的高效仿真验证。; 适合人群:具备自动控制理论基础、熟悉Matlab/Simulink仿真环境,从事水下机器人、智能控制、多智能体协同控制等相关领域研究的研发人员与高校研究生。; 使用场景及目标:① 掌握基于李雅普诺夫的MPC控制在非线性欠驱动系统中的设计与实现方法;② 学习多AUV编队控制中稳定性分析与轨迹跟踪的协同优化策略;③ 借助提供的Matlab代码进行算法复现、性能调优与二次开发,应用于相关科研或工程项目。; 阅读建议:建议读者结合现代控制理论与非线性系统分析知识,重点理解李雅普诺夫函数与MPC代价函数的融合机制,并通过调试仿真代码直观感受控制效果,进而拓展至其他多智能体协同控制场景。 立即下载

相关推荐

电力系统直流潮流计算研究【IEEE9节点】(Matlab代码实现)

内容概要:本文围绕《电力系统直流潮流计算研究【IEEE9节点】(Matlab代码实现)》展开,系统介绍了基于IEEE9标准测试系统的直流潮流计算方法及其Matlab编程实现过程。资源内容聚焦于电力系统稳态分析中的核心问题,详细阐述了直流潮流的数学模型构建、节点导纳矩阵形成、功率注入处理及线性方程组求解等关键技术环节,并提供完整的可运行Matlab代码,便于读者理解与复现。该研究不仅适用于电力系统规划、运行与控制的教学实践,还可作为复杂电网分析的前期基础工具,服务于故障分析、网络重构与优化调度等高级应用场景。该资源隶属于涵盖智能优化算法、机器学习、电力系统管理等多个方向的综合性科研资料体系,具有较高的工程参考价值和教学实用性。; 适合人群:具备电力系统分析基础知识及一定Matlab编程能力的高校电气工程及相关专业的本科生、研究生、科研人员,以及从事电力系统仿真、电网调度与自动化领域的工程技术人员。; 使用场景及目标:①深入理解直流潮流计算的基本原理及其在电力系统分析中的作用;②利用IEEE9节点系统开展教学实验、课程设计或科研验证,掌握潮流计算的数值实现方法;③作为电力系统高级应用(如最优潮流、可靠性评估、分布式电源接入分析)的前置模块进行扩展研究。; 阅读建议:建议读者结合经典电力系统分析教材同步学习,重点理解潮流计算的数学建模思路与Matlab代码的实现逻辑,通过实际运行、调试程序加深对算法流程的理解,并尝试将该方法迁移至其他IEEE标准测试系统(如IEEE14、IEEE30等)进行对比分析,以提升综合应用能力。

URAL 1091. Tmutarakan Exams(容斥原理)

题目链接 题意 : 给你两个数k,s,让你找k个数,这k个数都不大于s,并且这k个数的公约数大于1。 思路 : 枚举一下素数倍数,求组合数,最后容斥原理求最终结果。 当k=3,s=20的时候 : 2 : 2 4 6 8 10 12 14 16 18 20 3 :3 6 9 12 15 18 5 :5 10 15 20 只要从每个集合里边找出k个即可,这就是用组合数了。但是会有重复的,...

weixin_30375427的博客 191

Windows安装WSL子系统及docker,以及WSL和docker配置、使用及问题解决

在Windows操作系统中,Ubuntu子系统(也称为Windows Subsystem for Linux, WSL)为开发者提供了一个在Windows环境下运行Linux环境的平台。然而,有时用户在按照Ubuntu子系统或者使用WSL时,可能会遇到各种问题,下面总结一下解决方式。想要在Windows上安装Docker(实际上是基于Hyper-V或者WSL2这两项虚拟化技术),需要开启虚拟化功能,所以不管是对于系统还是硬件都有一定的要求。

sym的博客 9797

Ural 1091. Tmutarakan Exams(容斥原理+组合计数)

给出范围 [1,m] ,要求你从中找到 n 个数,使这 n 个数的 gcd > 1 ,但是个个数都不相同,问有几种选择 由于 n m 的范围都很小 (<=50),所以打一下小于 50 的素数表,我们可以让 gcd = 2 / 3 /4……但是 4 被 2 全包括了,所以只要统计 gcd 为素数的情况,所以又要利用容斥原理,处理 gcd 为多个质数相乘的情况,最后根据组合计数原理, m/gcd 个位置,放 n 个数,答案为。 const int N=50+5; in...

C_Dreamy的博客 524

本地大模型部署实战:LM Studio与Ollama的易用性与性能深度评测

本文对两款主流本地大模型部署工具LM Studio和Ollama进行了深度评测。LM Studio凭借图形化界面和内置模型库,为新手提供了开箱即用的便捷体验,并支持OpenAI兼容API,易于生态集成。Ollama则以命令行驱动,轻量高效,凭借其原生API和Modelfile自定义能力,在自动化集成和性能方面表现突出。文章从易用性、模型生态、性能及扩展性多维度对比,帮助用户根据自身技术背景和使用场景做出最佳选择。

weixin_29039773的博客 533

从零开始:STM32C011开发板的硬件生态与快速验证

本文全面解析STM32C011开发板的硬件生态与快速验证方法,帮助开发者从零开始掌握这款基于ARM Cortex-M0+内核的微控制器。内容涵盖硬件架构解析、开发环境搭建、基础功能验证及性能优化技巧,为嵌入式开发提供实用指导。

swift5iosmith的博客 485

Ural 1091. Tmutarakan Exams 排列组合+容斥原理+质因数分解

1091. Tmutarakan Exams Time limit: 1.0 second Memory limit: 64 MB University of New Tmutarakan trains the first-class specialists in mental arithmetic. To enter the University you should ma

停不下的脚步 920

Zemax操作33--5倍激光扩束器

5倍扩束

lzy750750的博客 2938

URAL1091 Tmutarakan Exams

关键词:求前s个数中k个gcd为1的数的组数 题意:求k个数a1,a2…ak,使得gcd(a1,a2…ak)>1的数的组数,其中1=< ai<=s。 解法:容斥原理。

acmer的随记 455

CVPR 2024 LaTeX 模板实战:从匿名提交到图表排版的避坑指南

本文详细解析CVPR 2024 LaTeX模板的使用技巧,涵盖匿名提交设置、pdfLaTeX编译器选择、图表排版优化等关键环节。通过实战案例演示智能引用、公式编号、三线表制作等专业技巧,帮助研究者高效完成论文格式规范,规避常见排版错误。特别针对双栏格式下的图片定位、跨栏表格等复杂场景提供解决方案。

weixin_42561040的博客 462

Arduino读取串口接收到的数据并发送数据

Arduino读取串口接收到的数据并发送数据 源程序: void setup() { Serial.begin(115200); } void loop() { String comdata ; while (Serial.available() > 0) { comdata += char(Serial.read()); delay(2); } if (comdata.length() > 0) { Serial.print("串口接收到的数据:"); Serial.println(comd

perseverance51博客 1万+

URAL 1091 Tmutarakan Exams

题意求NN以内的大小为KK的数集个数,满足数集内的数的gcd>1gcd>1题解设f[x]表示公约数是x的倍数的情况数,g[x]表示公约数恰好是x的情况数 有: fn=∑n|dg(d)f_n=\sum_{n|d}g(d) gn=∑n|df(d)∗μ(dn)g_n=\sum_{n|d}f(d)*\mu(\frac{d}{n}) 其中fn=(⌊Nd⌋k)f_n=\binom{\lfloor\fra

yeziqing10的博客 445

[deprecated]第九章:SVM机制: 9-2 Linux HMM原理与实现详解

Linux内核HMM(异构内存管理)子系统为异构计算平台提供统一内存管理机制,支持CPU与GPU等设备共享虚拟地址空间,实现零拷贝数据访问。其核心功能包括:1)统一虚拟地址空间,设备可直接访问CPU进程内存;2)实时页表同步与失效通知,确保地址空间一致性;3)支持设备端page fault处理;4)管理多种内存类型(系统内存、设备私有内存等)。HMM通过mmu_interval_notifier机制感知地址空间变化,提供标准API简化驱动开发,显著提升异构计算性能和数据传输效率。

图形/计算GPU的驱动与虚拟化技术分享园地 2575

URAL 1091 Tmutarakan Exams (DP或容斥)

题意给出一个K和S,求从小于S的数里取出一个K元组的gcd大于1的K元组的数量。思路可以dp做,dp的话是经典的计数问题,而且因为数据比较小写起来也比较简单,dp[i][j][k]表示枚举到i时取了j个数此时的gcd为k的个数,则dp[i+1][j+1][gcd(k,i+1)]+=dp[i][j][k],dp[i+1][j][k]+=dp[i][j][k]。 或者容斥,因为所有合数都能用素数来表示

Winterfell30' Blog 571

原理和代码解读:用Diffusion Models高清图像修复(Image Inpainting)

在最近的Diffusion Models应用中,Image Inpainting+ControlNet/Lora等工作在模特衣服生成、家居场景重建等场景中得到了广泛的应用。这篇博客主要介绍Diffusion Models如何在修复高清图像的。

沉迷单车的追风少年 2499

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

F - Tmutarakan Exams URAL - 1091 -莫比乌斯函数-容斥 or DP计数

F - Tmutarakan Exams 题意 : 从 < = S 的 数 中 选出 K 个 不 同 的 数 并 且 gcd > 1 。求方案数。思路 :记 录 一 下 每 个 数 的 倍 数 vector 存 储 ,最后从 2 开始 遍历 一遍每个数 ,从 他的倍数中 挑选 k个 组合数求解。但是会有重复,因为 比如 K=2,S=15时 ,2倍数 : 2 ,4 , 6,...

weixin_30357231的博客 101

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

ural1091(莫比乌斯 容斥)

University of New Tmutarakan trains the first-class specialists in mental arithmetic. To enter the University you should master arithmetic perfectly. One of the entrance exams at the Divisibility Depar

zjy2015302395的博客 455

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

URAL 1091

题目大意:输入K和S,输出含有且仅有K个不超过S的具有不小于1的公因子的不同正整数的方案数(如果大于10000,输出10000)。 例如:input:3 10 output :11   //{2,4,6},{2,4,8},{2,4,10},{2,6,8},{2,6,10},{2,8,10},{4,6,8},{4,6,10},{4,8,10},{6,8,10},{3,6,9}. Time Li

我待程序如初见、、、 2万+

【URAL-1091-Tmutarakan Exams】 容斥原理+组合数

URAL-1091-Tmutarakan Exams 将题意简化一下就是给你一个数s,要用1-s构造一个长度为序列保证n个数的最大公约数为1,且n个数均不相同。 我们直接构造不太好想,于是我们想如何构造出不满足情况的序列,那么就是最大公约数&gt;=2.由于这道题s,k均&lt;=50.所以我们可以枚举gcd为2-S,同样如果一个序列的gcd为4,那么他一定被gcd为2的计算过,所以我们还是只...

lajiyuan的博客 245

URAL 1091 Tmutarakan Exams(容斥原理)

题目链接: URAL 1091 Tmutarakan Exams 题意: 求构造kk个不同的数,每个数不超过ss,且这些数的最大公约数大于1的方案数。方案数大于1000010000时,直接输出1000010000。 数据范围:2≤K≤S≤502 \leq K \leq S \leq50 分析: 我们只需要考虑最小非1公约数情况。假设最小非1公约数为p假设最小非1公约数为p,那么在这ss个

ramay7 653

【URAL】1091 Tmutarakan Exams (简单容斥原理)

题目大意:从不大于s的非负数中选择k个,并且k个数的最大公约数大于1,问有多少组。 思路: 这边我们可以枚举最小公约数,那么最小公约数的个数中选择k个即为一种方案, 因为最大数不超过50. 所以枚举的最小公约数即为小于30的所有质数。{2,3,5,7,11,13,17,19,23,29} 现在可以假设选择了以最小公约数为2的序列,已经最小公约数为3的序列,可以知道,最小公约为6的序列被多

Jason 926

ural 1091

题目:http://acm.timus.ru/problem.aspx?space=1&num=1091 题意:从 s 个数里挑出 k 个, 这个 k 个数的共因子大于 1 一共有多少种方法 直接暴搜,注意剪枝优化 View Code 1 typedef long long ll; 2 const int N = 60; 3 int ans,k,s; 4 boo...

weixin_30659829的博客 153

Tmutarakan Exams 简单的容斥定理

Tmutarakan Exams Time Limit:1000MS   Memory Limit:65536KB   64bit IO Format:%I64d & %I64u SubmitStatus Description University of New Tmutarakan trains the first-class s

vickey 720

URAL 1091. Tmutarakan Exams

http://acm.timus.ru/problem.aspx?space=1&num=1091

风儿-zsj的专栏 734
上一篇: hdu5249---KPI(二分+树状数组)
下一篇: POJ1337---A Lazy Worker(dp)
tokers
博客等级 码龄12年 71粉丝 700原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值