ZOJ 2207 听说是简单题,结果我是被折磨得半死写出来的代码还特丑

北大POJ部分题目答案(一些基础题目) 很多的POJ题目答案!1000~1008,1011~1014,1016,1017,1019,1028,1032,1045,1046,1047,1050,1061,1067,1068,1088,1102,1159,1163,1183,1207,1218,1226,1247,1256,1258,1298,1316,1323,1326,1338,1363,1396,1401,1423,1455,1458,1468,1477,1488,1503,1504,1517,1519,1528,1543,1547,1552,1265,1579,1604,1629,1656,1657,1658,1663,1664,1665,1674,1799,1844,1862,1922,1953,1969,1979,2000,2013,2017,2027,2039,2070,2080,2105,2109,2136,2140,2141,2159,2190,2196,2242,2247,2249,2262,2301,2309,2328,2350,2386,2388,2389,2390,2403,2405,2453,2479,2487,2498,2509,2521,2533,2538,2551,2562,2575,2578,2583,2591,2593,2601,2602,2608,2636,2663,2707,2719,2739,2801,2840,2871,2909,2924,3006,3030,3062,3077,3085,3094,3100,3173,3176,3210,3224,3302,3325,3438,3673,3036,2503,1731,2503,1065,3636 立即下载

简单题对我这样的新手也很困难啊

 

//////////////////////////////////////////////////////////
//    ZOJ: 2207
//    简单题:通过枚举出所有ABCDE五个字母组成的120种组合然后
//            判断排名。
//////////////////////////////////////////////////////////
#include "stdio.h"

int ranking(char *duibi, char *input);    //用于每个数组里面对数的个数

int main(void)
{
    //枚举出所有情况的字母组合
    char sort[150][50] = {0};
    char szbuf[50] = {"AAAAA"};
    char temp[50] = {'A','B','C','D','E'};
    int i, j, x, y;
    int l = 0;
    int z;
    int k;

    for (i = 0; i < 5; i++)
    {
        szbuf[0] = temp[i];

        for (j = 0; j < 5; j++)
        {
            szbuf[1] = temp[j];

            if (szbuf[0] != szbuf[1])
            {
                for (x = 0; x < 5; x++)
                {   
                    szbuf[2] = temp[x];

                    if (szbuf[2] != szbuf[1] && szbuf[2] != szbuf[0])
                    {
                        for (y = 0; y < 5; y++)
                        {
                            szbuf[3] = temp[y];

                            if (szbuf[3] != szbuf[0] && szbuf[3] != szbuf[1] && szbuf[3] != szbuf[2])
                            {
                                for (z = 0; z < 5; z++)
                                {
                                    szbuf[4] = temp[z];

                                    if (szbuf[4] != szbuf[0] && szbuf[4] != szbuf[1]
                                        && szbuf[4] != szbuf[2] && szbuf[4] != szbuf[3])
                                    {
                                        for (k = 0; k < 6; k++)
                                        {
                                            sort[l][k] = szbuf[k];
                                        }

                                        l++;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
   
    int n;

    while(scanf("%d", &n))
    {
        if (n == 0)
            break;
       
        int value[200] = {0};
        int count = 0;
        int m;
        char cal[10] = {0};
        int resValue = -1;
        int m1;
        int index;

        while (n-- > 0)
        {
            scanf("%s", cal);
            //循环做判断并把值用一个结果数组保存
            for (m = 0; m < 120; m++)
            {
                value[m] += ranking(sort[m], cal);
            }
        }
        //从120字符串序列的结果值中找出距离值最小的并返回下标
        for (m1 = 0; m1 < 120; m1++)
        {
            if (resValue == -1)
            {
                resValue = value[m1];
                index = m1;
            }
            else
            {
                if (resValue > value[m1])
                {
                    resValue = value[m1];
                    index = m1;
                }
            }

        }

        printf("%s is the median ranking with value %d./n", sort[index], resValue);

    }

    return 0;
}
//用于判断的函数计算出每个字符串对比的结果距离值
int ranking(char *duibi, char *input)
{
    int result = 0;
    int i;
    int dui[10], in[10];
    //分别找出A B C D E五个字母的位置
    for (i = 0; i < 5; i++)
    {
        if (duibi[i]  == 'A')
            dui[0] = i;
        else if (duibi[i]  == 'B')
            dui[1] = i;
        else if (duibi[i]  == 'C')
            dui[2] = i;
        else if (duibi[i]  == 'D')
            dui[3] = i;
        else if (duibi[i] == 'E')
            dui[4] = i;
    }
    //参照字符串
    for (i = 0; i < 5; i++)
    {
        if (input[i]  == 'A')
            in[0] = i;
        else if (input[i]  == 'B')
            in[1] = i;
        else if (input[i]  == 'C')
            in[2] = i;
        else if (input[i]  == 'D')
            in[3] = i;
        else if (input[i] == 'E')
            in[4] = i;
    }
   
    int x, y, z = 0;
    int x1, y1, z1 = 0;
    int resa[100], resb[100];
    int o;
    //将五个字母中所有可能值列出
    for (x = 0; x < 5; x++)
    {
        for (y = x + 1; y < 5; y++)
        {
            resa[z++] = dui[x] - dui[y];
        }
    }

    for (x1 = 0; x1 < 5; x1++)
    {
        for (y1 = x1 + 1; y1 < 5; y1++)
        {
            resb[z1++] = in[x1] - in[y1];
        }
    }
    //搜索有产生排名变化的值 发生变化则结果值+1
    for (o = 0; o < z; o++)
    {
        if ((resa[o] > 0 && resb[o] < 0) || (resa[o] < 0 && resb[o] > 0))
        {
            ++result;
        }
    }

    return result;
}

Tailscale 自建 DERP 中继服务器 Tailscale自建DERP中继服务器 阅读详情

相关推荐

2023-2024深度学习框架之争——选pytorch还是tensorflow?

深度学习是人工智能领域的一个重要分支,它利用多层神经网络来模拟人类的学习和推理能力,解决各种复杂的问题,如图像识别、自然语言处理、语音识别、推荐系统等。深度学习框架是一种软件工具,它提供了构建、训练、测试和部署深度学习模型的便利,使得开发者和研究者可以更高效地进行深度学习的开发和应用。目前,市场上有许多不同的深度学习框架,如PyTorch、TensorFlow、Keras、MXNet、Caffe2等,它们各有优劣,适用于不同的场景和需求。

flchen_nchu的博客 6757

ZOJ-2207

好吧。。这题实在是不想用C写了,本来计算两个串的distance value函数都用C写好了,求全排列没有list用怎么想怎么麻烦,还是JAVA用起来顺手。。几下就搞定了 import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args

xhldtc的专栏 524

离散系统傅里叶变换的常用结论证明

本文介绍了离散系统傅里叶变换的三个重要结论:1)时域卷积对应频域相乘(公式1-3);2)时域相乘对应频域卷积(公式4-6);3)帕塞瓦尔定理(公式7)及其广义形式,证明信号能量在变换域保持不变。文末提供了MATLAB卷积运算演示程序,通过动画展示离散信号卷积过程(翻转、平移、相乘、累加),并以方波信号为例给出运行结果图。该程序直观呈现了卷积运算的步骤与结果。

newtton的博客 1305

zoj 2207 || poj 2038 Team Rankings(= =)

看题目看了半个小时才明白 = =。英语水平啊。。。ABCDE中两两相对位置共有4+3+2+1 = 10种。两个字符串比较,相对位置不同的存下,比如 ABCDE 和 ACBDE,相对位置就BC不一样,所以相差1。1就是value。给你n的串,求出一个ABCDE的排列,使得得出的这个排列跟这n个串的相对位置差累和最小。开始按自己想法,把位置记录下,排下序完事了 = =。再单独算value,算value用得很麻烦的方法。结果样例过了,但是是WA。呃。自己的想法没有得到证明是不能乱用的!!!搜题解。看人家题目就知道

小媛在努力~ 2189

大模型之Spring AI实战系列(二十一):Spring AI + MCP + 本地文件系统实战指南

在上一篇文章中,我们学习了如何使用 Spring AI 集成 Model Context Protocol (MCP),并通过 Brave Search 实现了互联网搜索能力的接入。本文将继续深入 Spring AI 的 MCP 实战能力,介绍如何将 **本地文件系统** 封装为 LLM 可调用的工具

寻道AI,探索AI无限可能! 2520

【Power Compiler手册】4.saif文件

功耗计算的准确性取决于切换活动数据的准确性。这些数据是通过使用RTL仿真或门级仿真生成的,并存储在SAIF文件中。在执行功耗优化和分析之前,应该使用SAIF文件来反标设计对象上的切换活动信息。SAIF是由Synopsys支持的ASCII格式,用于促进不同Synopsys工具之间的信息交换(参见IEEE 1801标准,附录J)。使用`read_saif`命令读取SAIF文件,使用`write_saif`命令写出SAIF文件。有关更多信息,请参见`read_saif`和`write_saif`命令的手册页。

QRBQ 2187

Undercut

  Undercut is a card game where two players each have five cards numbered one through five. At each round, each player selects a card, then simultaneously reveals it. If the cards are of equal value,

ziren235的专栏 1272

YOLOv11涨点改进| TGRS 2026 顶刊| 注意力改进篇| 引入MSEA多尺度边缘感知注意力,助力红外小目标检测、遥感目标检测、工业缺陷检测、图像去雨雾任务高效涨点

🔥本文提出了一种基于MSEA多尺度边缘感知注意力的YOLOv11改进模型,通过增强网络对边缘、纹理和细粒度信息的感知能力,显著提升复杂背景下的目标检测性能。MSEA模块采用多尺度空洞卷积提取上下文特征,并通过边缘监督和注意力融合机制强化目标边界信息。实验表明该方法在小目标、边界模糊目标和复杂纹理目标检测任务中表现优异,尤其在遥感、工业缺陷和红外检测等场景具有显著优势。文章详细介绍了MSEA的结构原理、核心代码实现、模块配置方法以及三种YOLOv11改进方案.

Ai缝合怪、助力小伙伴高效发论文 185

zoj 2207 Team Rankings

//由字符串“ABCDE”的所有排序(可以通过stl中的next_permutation直接得出)与input中 //的字符串进行比较,找出差距值最小的字符串! #include "iostream" #include "map" #include "algorithm" #include "string" #include "limits.h" using namespace std; str

yzl_rex 538

PID、模糊PID、SkyHook、LQR、H2/H∞、ADRC等悬架控制合集

PID、模糊PID、SkyHook、LQR、H2/H∞等悬架控制合集

Mr.邹的博客 2014

如何获取不同分区模板的基因表达矩阵,abagen: Allen 大脑图谱遗传数据工具箱的使用笔记

基因表达从根本上塑造了人类大脑的结构和功能结构。像Allen人脑图谱这样的开放获取转录组数据集提供了前所未有的能力来检查这些机制。abagen工具箱,这是一个用于处理转录组学数据的开放获取软件包,并使用它来检查方法可变性如何影响使用Allen人脑图谱的研究结果。

从事脑科学核磁共振方法学研究,在Nature communications等权威期刊发表研究论文,熟练掌握磁共振处理方法和统计学方法,欢迎大家和我交流。 3340

ZOJ--1057:Undercut

比较简单 直接上代码 import java.util.Scanner; public class ZOJ_1057 { static int n,a,b,flag=0; static int arr[]=new int[20],brr[]=new int[20]; public static void main(String[] args) { Scanner s=new

yf224的博客 520

fasterlio原理及代码框架梳理

Faster-LIO 的优势是在保持同等高精度的前提下,显著提升计算效率,以支持更极端的应用场景(如高速无人机)和更廉价的硬件平台。可以把 Faster-LIO 理解为用一把更快的“空间哈希筛子”(iVox)替换了原来精细的“动态平衡树”(ikd-Tree),从而在精度损失极小的情况下,实现了效率的显著提升。:只在实际有地图点的空间区域动态创建和保留体素单元,形成一个稀疏的体素地图。是关键:将去畸变点云中的每个点,在 iVox 维护的局部地图中搜索近邻(如5个最近点),构建点到面的距离残差。

Studying…… 246

ZOJ Problem Set - 1057||Undercut

Undercut Time Limit: 2 Seconds      Memory Limit: 65536 KB Undercut is a card game where two players each have five cards numbered one through five. At each round, each player selects a card, th

飞舞的指尖 445

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

fjnu 1824 Undercut

DescriptionUndercut is a card game where two players each have five cards numbered one through five. At each round, each player selects a card, then simultaneously reveals it. If the cards are of

异リ度ュ空ウ間(镜像站) 850

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

ZJU1057解题报告

UndercutTime limit: 1 Seconds   Memory limit: 32768K   Total Submit: 7787   Accepted Submit: 1832   Undercut is a card game where two players each have five cards numbered one through five. At each ro

枫风的专栏 1158

深度学习工具包 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")

zoj水题分类

zoj水题分类 zoj分类 简单题 #1001 -____-b  A+B。 #1110 Dick and Jane 胡乱枚举收缩一下情况就可以了。(这题脑筋还是要转一个弯的,不然做不出) #1115 a[i+1] = a[i] 的全部数位上的加起来,直到剩下一个,直接模拟。 #1414 太弱太弱,按照模 4 分类讨论一下即可。 #1713 简单的字符串截取

wuzhoudao的专栏 7775

poj 1001 浮点数高精度求幂

//===================================// // //    poj:1001 浮点数求幂 //  完成时间:2001.09.07 // //==================================// #include #include #include const int MAX_LEN = 150; using namespace std; int StringConvert(const string &str, int &t

Mur. 1566

HDU 1496 哈希表实现

HDU:1496这题太恶心,被后面的初始化害惨,由于是2000000的数据如果疏忽便会导致超时#include #include int hash[2000001];int main(void){ int a, b, c, d, x, y; while (scanf("%d %d %d %d", &a, &b, &c, &d) != EOF) {  if ((a > 0 && b > 0 && c > 0 && d > 0) || (a   {   printf("0/n");   continue;  }

Mur. 1181

ZOJ 1110 Dick and Jane 胡乱枚举实现。

<br />今天上ZOJ挑了道别人说比较简单的题目做了下:<br />一开始连题目都没看懂,然后参考了下别人的代码(惭愧),然后用暴力枚举收缩了下范围实现了。<br />代码如下:<br />#include "stdio.h"<br /><br /> int main(void)<br /> {<br />     int ans1;<br />     int ans2 ;<br />     int ans3;<br />     int s, p, y, j;<br />     in

Mur. 959

基础SPFA算法模板

<br />void SPFA(int s) <br /> {<br />     for(int i=1; i<=n; i++)<br />     {<br />         d[i] = MAX;        //对所有到原点的权值初始赋最大值即无限;MAX为常量<br />     }<br />     <br />     d[s] = 0;            //原点权值初始为0<br />     //此处N为一个常量<br />     int queue[N

Mur. 763

HDU1238 有详细注释

<br />#include <iostream><br /> using namespace std;<br /><br /> void sort(char (*data)[110], int count);<br /><br /> int main()<br /> {<br />     int n;<br /><br />     cin >> n;<br /><br />     while (n--)<br />     {<br />         int count;<br

Mur. 751

这是spfa 邻接表实现的版本

//邻接表定义 typedef struct _node {     int v;     int w;     _node *next; }edge; edge map[150]; void SPFA(int s) {     for(int i=1; i     {         d[i] = MAX;        //对所有到原点的权值初始赋最大值即无限;MAX为常量     }     d[s] = 0;            //原点权值初始为0     //此

Mur. 732

zoj 1716 又是一道简单题。直接暴力枚举实现!

<br />////////////////////////////////////////////////////////////<br /> //    ZOJ:1716<br /> //    本题使用枚举法实现效率可能不高,不过问题比较小时可以采用<br /> //    优点:算法会比较简单 <br /> ///////////////////////////////////////////////////////////<br /> #include "stdio.h"<br /><b

Mur. 729
上一篇: zoj 1745 又是简单题
下一篇: ZOJ 2480简单题,无亮点 随便搞
WowBanyan
博客等级 码龄18年 5粉丝 33原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值