机试_1_暴力求解_习题

C++:LNK2005:xxx already defined in main.obj 问题描述   使用一个全局变量测试多线程同时访问一个变量的性能,结果却报错了   多重定义了,于是顺藤摸瓜,找到了变量thread_index的位置 // MyThread.h int thread_index = 0;   以及使用这个变量的地方—— // Source.cpp #include"MyThread.h" ... int main(){ ... thread_index+... 阅读详情

暴力求解——习题

学习完第一章–暴力求解之后,当然要做相应地练习啦~

https://blog.youkuaiyun.com/Window_mouse/article/details/128632426

注:上述习题都可以在牛客进行测试。

例如,第9题链接:xxx定律_牛客题霸_牛客网 (nowcoder.com),其他题目在“题目列表”中基本都可以找到。

另外,此文章仅仅是提供解题思路,并非最优解。


1 与7无关的数–北京大学

描述:

一个正整数,如果它能被7整除,或者它的十进制表示法中某个位数上的数字为7, 则称其为与7相关的数.现求所有小于等于n(n<100)的与7无关的正整数的平方和。

输入描述:

案例可能有多组。对于每个测试案例输入为一行,正整数n,(n<100)

输出描述:

对于每个测试案例输出一行,输出小于等于n的与7无关的正整数的平方和。

示例1

输入:

21

输出:

2336

题解:

与7相关的数,假设为num
num只需满足以下条件之一,即称num为与7相关的数

1.num能被7整除
num % 7 = 0

2.num中某个位的数字为7
依次求每个位上的数,判断是否含有7
#include <iostream>
#include <cstdio>

using namespace std;


/**
 * 判断正整数num是否为与7相关的数
 * @param num
 * @return true, 与7相关的数;false, 与7无关的数
 */
bool isRelevantNum(int num) {
    if (num % 7 == 0) {
        //num能被7整除
        return true;
    } else {
        //num的某个位数上为7
        while (num != 0) {
            if (num % 10 == 7) {
                return true;
            }
            num /= 10;
        }
    }
    return false;
}

/**
 * 与7无关的数--北京大学
 * @return
 */
int main() {
    int n;
    while (cin >> n) {
        int sum = 0;
        for (int num = 0; num <= n; ++num) {
            if (!isRelevantNum(num)) {
                //求和
                sum += num * num;
            }
        }
        //输出sum
        cout << sum << endl;
    }
    return 0;
}

2 百鸡问题–哈尔滨工业大学

描述:

用小于等于n元去买100只鸡,大鸡5元/只,小鸡3元/只,还有1/3元每只的一种小鸡,分别记为x只,y只,z只。编程求解x,y,z所有可能解。

输入描述:

测试数据有多组,输入n。

输出描述:

对于每组输入,请输出x,y,z所有可行解,按照x,y,z依次增大的顺序输出。

示例1

输入:

40

输出:

x=0,y=0,z=100
x=0,y=1,z=99
x=0,y=2,z=98
x=1,y=0,z=99

题解:

暴力求解,思路还是很好想的,三层for循环。
for循环中,稍微优化一下,减少循环次数,虽然感觉效果不明显。比如,300<n<500时,x最大为n/5即可;当n<300时,而y最大为n/3即可。

然后,再判断是否满足两个条件:
1. x+y+z=100
2. 5*x+3*y+z/3 <= n,但是有点小问题,z/3是会进行向下取整操作的。此外,除法结果的某些小数计算机是无法正确表示,即会出现精度问题。
所以,我们换个思路,将乘除法换成乘法,问题即可迎刃而解。
5*x+3*y+z/3 <= n  转化成  3*5*x+3*3*y+z = 15*x+9*y+z <= 3*n
#include <iostream>
#include <cstdio>

using namespace std;

/**
 * 百鸡问题--哈尔滨工业大学
 * @return
 */
int main() {
    int n;
    while (cin >> n) {
        for (int x = 0; x <= 100; ++x) {
            for (int y = 0; y <= 100; ++y) {
                for (int z = 0; z <= 100; ++z) {
                    //满足x+y+z=100只
                    if (x + y + z == 100) {
                        if (15 * x + 9 * y + z <= 3 * n) {
                            printf("x=%d,y=%d,z=%d\n", x, y, z);
                        }
                    }
                }
            }
        }
    }
    return 0;
}
#include <iostream>
#include <cstdio>

using namespace std;

/**
 * 百鸡问题--哈尔滨工业大学
 * @return
 */
int main() {
    int n;
    int xMax = 100;
    int yMax = 100;
    if (n <= 5 * 100) {
        xMax = n / 5;
    } else if (n <= 3 * 100) {
        yMax = n / 3;
    }
    while (cin >> n) {
        for (int x = 0; x <= xMax; ++x) {
            for (int y = 0; y <= yMax; ++y) {
                for (int z = 0; z <= 100; ++z) {
                    //满足x+y+z=100只
                    if (x + y + z == 100) {
                        if (15 * x + 9 * y + z <= 3 * n) {
                            printf("x=%d,y=%d,z=%d\n", x, y, z);
                        }
                    }
                }
            }
        }
    }
    return 0;
}

3 Old Bill–上海交通大学

描述:

Among grandfather’s papers a bill was found. 72 turkeys $679 The first and the last digits of the number that obviously represented the total price of those turkeys are replaced here by blanks (denoted _), for they are faded and are illegible. What are the two faded digits and what was the price of one turkey? We want to write a program that solves a general version of the above problem. N turkeys $XYZ The total number of turkeys, N, is between 1 and 99, including both. The total price originally consisted of five digits, but we can see only the three digits in the middle. We assume that the first digit is nonzero, that the price of one turkeys is an integer number of dollars, and that all the turkeys cost the same price. Given N, X, Y, and Z, write a program that guesses the two faded digits and the original price. In case that there is more than one candidate for the original price, the output should be the most expensive one. That is, the program is to report the two faded digits and the maximum price per turkey for the turkeys.

在这里插入图片描述

输入描述:

The first line of the input file contains an integer N (0<N<100), which represents the number of turkeys. In the following line, there are the three decimal digits X, Y, and Z., separated by a space, of the original price $XYZ.

输出描述:

For each case, output the two faded digits and the maximum price per turkey for the turkeys.

示例1

输入:

72
6 7 9
5
2 3 7
78
0 0 5

输出:

3 2 511
9 5 18475
0

题解:

只要看懂了题目,其实本题还是比较基础的。

分析:
已知条件:
1.火鸡的数量n
2.总价格sumPrice的千、百、十位数,sumPrice = _XYZ_ = aXYZb,其中XYZ已知

求:
火鸡的单价price(有多个则求最大单价maxPrice),总价格的第一位和最后一位,分别设为a、b

注意点:
1.火鸡的单价price为整数,所以满足 sumPrice % n == 0
2.a != 0
#include <iostream>
#include <cstdio>

using namespace std;

/**
 * Old Bill--上海交通大学
 * @return
 */
int main() {
    int n;
    int x, y, z;
    while (cin >> n >> x >> y >> z) {
        int price = 0;
        int maxPrice = 0;
        int sumPrice = 0;
        int a, b;
        //第一个数字非0,所以从1开始循环
        for (int i = 1; i <= 9; ++i) {
            for (int j = 0; j <= 9; ++j) {
                //_XYZ_ 总价格
                sumPrice = i * 10000 + x * 1000 + y * 100 + z * 10 + j;
                /*
                 * 因为要保证火鸡的单格为整数,而 单价=总价格/数量
                 * 所以,通过sumPrice%n==0过滤不整除的情况
                 */
               if (sumPrice % n == 0) {
                    price = sumPrice / n;
                    a = i;
                    b = j;
                    //多个单价,则求最大单价
                    if (price > maxPrice) {
                        maxPrice = price;
                    }
                }
            }
        }

        if (maxPrice != 0) {
            printf("%d %d %d\n", a, b, maxPrice);
        } else {
            //特殊情况 price=0
            printf("0\n");
        }
    }
    return 0;
}

4 Hello World for U–浙江大学

描述:

Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, “helloworld” can be printed as: h d e l l r lowo That is, the characters must be printed in the original order, starting top-down from the left vertical line with n1 characters, then left to right along the bottom line with n2 characters, and finally bottom-up along the vertical line with n3 characters. And more, we would like U to be as squared as possible – that is, it must be satisfied that n1 = n3 = max { k| k <= n2 for all 3 <= n2 <= N } with n1 + n2 + n3 - 2 = N.

在这里插入图片描述

输入描述:

There are multiple test cases.Each case contains one string with no less than 5 and no more than 80 characters in a line. The string contains no white space.

输出描述:

For each test case, print the input string in the shape of U as specified in the description.

示例1

输入:

helloworld!
www.nowcoder.com

输出:

h   !
e   d
l   l
lowor
w    m
w    o
w    c
.    .
n    r
owcode

题解:

将长度为len字符串分为3段n1,n2,n3,其中n1和n3长度相同,且n1+n2+n3=len+2。
所以,n1=n2=(len+2)/3,n3=len+2-2*n1。

打印时,逐行打印即可。除去最后一行,其余行先打印1个n1的字符,再打印n2-2个空格,最后打印n3的字符。最后一行打印n2即可。

![在这里插入图片描述](https://img-blog.csdnimg.cn/a605ee54f7714bc7922bb87af8719fae.png#pic_center x=500x700)

#include <iostream>
#include <cstdio>

using namespace std;

/**
 * Hello World for U -- 浙江大学
 * @return
 */
int main() {
    string str;
    cin >> str;
    int len = str.length();
    int n1 = (len + 2) / 3;
    int n2 = len + 2 - 2 * n1;
    int n3 = n1;
    /*
     * 打印字符
     * 除去最后一行,所以循环n1-1次
     */
    for (int i = 0; i < n1 - 1; ++i) {
        //打印n1的字符
        cout << str[i];
        //打印n2-2个空格
        for (int j = 0; j < n2 - 2; ++j) {
            cout << " ";
        }
        //打印n3的字符
        cout << str[len - i - 1];
        //换行
        cout << endl;
    }

    /*
     * 打印最后一行
     */
    for (int k = 0; k < n2; ++k) {
        cout << str[n1 - 1 + k];
    }

    return 0;
}


5 日期累加–北京理工大学

描述:

设计一个程序能计算一个日期加上若干天后是什么日期。

输入描述:

输入第一行表示样例个数m,接下来m行每行四个整数分别表示年月日和累加的天数。

输出描述:

输出m行,每行按yyyy-mm-dd的个数输出。

示例1

输入:

1
2008 2 3 100

输出:

2008-05-13

题解:

分析:
year.month.day			dayNumber
2000-11-11				400

1. 先将"日"置0,2000-11-0  411
2. 判断dayNumber是否大于一个完整月的天数(注意判断闰年和平年)
    1. 若大于,则减去相应的天数,同时month++(注意若month为12,则需置0且year++)
    2. 若小于等于,则year-month-dayNumber即为最后的日期
3. 循环2
#include <iostream>
#include <cstdio>

using namespace std;

/*
 * 空间换时间
 * 二维数组保存平年和闰年0~12月份对应的天数
 */
int dayTable[2][13] = {
        {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},    //平年
        {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}     //闰年
};

/**
 * 判断是否为闰年
 * 若是闰年,则返回1,对应dayTable[1][];反之,返回0,对应dayTable[0][]
 * @param year
 * @return
 */
int isLeapYear(int year) {
    //return (year & 3 == 0 && year % 100 != 0) || year % 400 == 0;
    return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;
}

/**
 * 日期累加--北京理工大学
 * @return
 */
int main() {
    //m组样例
    int m;
    cin >> m;
    for (int i = 0; i < m; ++i) {
        int year, month, day;
        int dayNumber;
        //用户输入
        cin >> year >> month >> day >> dayNumber;
        //判断当前年份是否为闰年
        int row = isLeapYear(year);
        //先把“天数”单独拿出来,后续只需考虑年份和月份即可
        dayNumber += day;
        while (dayNumber > dayTable[row][month]) {
            //dayNumber减去一个完整月的天数
            dayNumber -= dayTable[row][month];
            //若月份为12,则年份需要+1,同时月份置为0
            if (month == 12) {
                month = 0;
                year++;
                row = isLeapYear(year);
            }
            month++;
        }
        //最后剩余不足一个完整月的天数
        day = dayNumber;

        //按照要求格式输出yyyy-mm-dd
        printf("%4d-%02d-%02d\n", year, month, day);
    }
    return 0;
}

6 日期差值–上海交通大学

描述:

有两个日期,求两个日期之间的天数,如果两个日期是连续的我们规定他们之间的天数为两天

输入描述:

有多组数据,每组数据有两行,分别表示两个日期,形式为YYYYMMDD

输出描述:

每组数据输出一行,即日期差值

示例1

输入:

20110412
20110422

输出:

11

题解:

假设日期为 year.month.day,我们分别计算两个日期与0001.01.01的差值
最后求两个差值相减去绝对值加1即可。
#include <iostream>
#include <cstdio>

using namespace std;

/*
 * 空间换时间
 * 二维数组保存平年和闰年0~12月份对应的天数
 */
int dayTable[2][13] = {
        {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},    //平年
        {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}     //闰年
};

/**
 * 判断是否为闰年
 * 若是闰年,则返回1,对应dayTable[1][];反之,返回0,对应dayTable[0][]
 * @param year
 * @return
 */
int isLeapYear(int year) {
    //return (year & 3 == 0 && year % 100 != 0) || year % 400 == 0;
    return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;
}

/**
 * 返回一个完整年的天数
 * 闰年366天,平年365天
 * @param year
 * @return
 */
int getDayNumOfYear(int year) {
    return isLeapYear(year) ? 366 : 365;
}

/**
 * 获取从 0001.01.01 至 year.month.day 之间的天数
 * @param year
 * @param month
 * @param day
 * @return
 */
int getSumDayNum(int year, int month, int day) {
    int dayNumber = 0;
    for (int i = 1; i < year; ++i) {
        dayNumber += getDayNumOfYear(i);
    }
    for (int j = 0; j < month; ++j) {
        dayNumber += dayTable[isLeapYear(year)][j];
    }
    dayNumber += day;
    return dayNumber;
}


/**
 * 日期差值--上海交通大学
 * @return
 */
int main() {
    string date01, date02;
    while (cin >> date01 >> date02) {
        int year01 = 0, month01 = 0, day01 = 0;
        int year02 = 0, month02 = 0, day02 = 0;

        /*
         * 格式化日期,获取年、月、日
         */
        for (int i = 0; i < date01.length(); ++i) {
            if (i <= 3) {
                year01 *= 10;
                year01 += date01[i] - '0';
            } else if (i > 3 && i <= 5) {
                month01 *= 10;
                month01 += date01[i] - '0';
            } else {
                day01 *= 10;
                day01 += date01[i] - '0';
            }

        }

        for (int j = 0; j < date02.length(); ++j) {
            if (j <= 3) {
                year02 *= 10;
                year02 += date02[j] - '0';
            } else if (j > 3 && j <= 5) {
                month02 *= 10;
                month02 += date02[j] - '0';
            } else {
                day02 *= 10;
                day02 += date02[j] - '0';
            }
        }

        int sumDay01 = getSumDayNum(year01, month01, day01);
        int sumDay02 = getSumDayNum(year02, month02, day02);
        int ans = abs(sumDay01 - sumDay02) + 1;
        cout << ans << endl;
    }
    return 0;
}

7 Day of Week–上海交通大学

描述:

We now use the Gregorian style of dating in Russia. The leap years are years with number divisible by 4 but not divisible by 100, or divisible by 400. For example, years 2004, 2180 and 2400 are leap. Years 2005, 2181 and 2300 are not leap. Your task is to write a program which will compute the day of week corresponding to a given date in the nearest past or in the future using today’s agreement about dating.

编写一个程序,计算给定的日期是星期几。

输入描述:

There is one single line contains the day number d, month name M and year number y(1000≤y≤3000). The month name is the corresponding English name starting from the capital letter.

输出描述:

Output a single line with the English name of the day of week corresponding to the date, starting from the capital letter. All other letters must be in lower case. Month and Week name in Input/Output: January, February, March, April, May, June, July, August, September, October, November, December Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday

示例1

输入:

9 October 2001
14 October 2001

复制

输出:

Tuesday
Sunday

题解:

隐含0001.01.01是周一,所以我们计算输入的日期与0001.01.01之间的差值天数,然后对7取模,即可知道偏移多少天。
#include <iostream>
#include <cstdio>

using namespace std;

/*
 * 二维数组保存平年和闰年0~12月份对应的天数
 */
int dayTable[2][13] = {
        {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},    //平年
        {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}     //闰年
};

/*
 * 星期名称的字符串
 */
char weekDayTable[8][15] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};


/*
 * 月份名称的字符串
 */
char monthTable[13][15] = {"", "January", "February", "March", "April", "May", "June", "July", "August", "September",
                           "October", "November", "December"};

/**
 * 判断是否为闰年
 * @param year
 * @return
 */
int isLeapYear(int year) {
    //return (year & 3 == 0 && year % 100 != 0) || year % 400 == 0;
    return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;
}

/**
 * 返回一个完整年的天数
 * 闰年366天,平年365天
 * @param year
 * @return
 */
int getDayNumOfYear(int year) {
    return isLeapYear(year) ? 366 : 365;
}

/**
 * Day of Week--上海交通大学
 * @return
 */
int main() {
    int year;
    int month;
    string monthStr;
    int day;
    while (cin >> day >> monthStr >> year) {

        //确定月份
        for (int i = 0; i <= 12; ++i) {
            if (monthStr == monthTable[i]) {
                month = i;
                break;
            }
        }

        //计算距离0001.01.01的天数,0001.01.01是周一
        int dayNumber = 0;
        //年份要从0001开始,不可以从0000开始
        for (int j = 1; j < year; ++j) {
            dayNumber += getDayNumOfYear(j);
        }
        for (int k = 0; k < month; ++k) {
            dayNumber += dayTable[isLeapYear(year)][k];
        }
        dayNumber += day;

        //dayNumber%7即可
        cout << weekDayTable[dayNumber % 7] << endl;
    }
    return 0;
}


8 日期类–北京理工大学

描述:

编写一个日期类,要求按xxxx-xx-xx 的格式输出日期,实现加一天的操作。

输入描述:

输入第一行表示测试用例的个数m,接下来m行每行有3个用空格隔开的整数,分别表示年月日。测试数据不会有闰年。

输出描述:

输出m行。按xxxx-xx-xx的格式输出,表示输入日期的后一天的日期。

示例1

输入:

2
1999 10 20
2001 1 31

输出:

1999-10-21
2001-02-01

备注:

注意个位数日期前面要有0。

题解:

#include <iostream>
#include <cstdio>

using namespace std;

/*
 * 二维数组保存平年和闰年0~12月份对应的天数
 */
int dayTable[2][13] = {
        {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},    //平年
        {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}     //闰年
};

/**
 * 判断是否为闰年
 * @param year
 * @return
 */
int isLeapYear(int year) {
    //return (year & 3 == 0 && year % 100 != 0) || year % 400 == 0;
    return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;
}

/**
 * 日期类--北京理工大学
 * @return
 */
int main() {
    int year, month, day;
    int m;
    cin >> m;
    for (int i = 0; i < m; ++i) {
        cin >> year >> month >> day;
        //若day刚好等于一个完整月,则month++,若
        if (day == dayTable[isLeapYear(year)][month]) {
            day = 1;
            month++;
            if (month == 12) {
                month = 1;
                year++;
            }
        } else {
            day++;
        }
        printf("%4d-%02d-%02d\n", year, month, day);
    }

    return 0;
}

9 XXX定律–浙江大学

描述:

对于一个数n,如果是偶数,就把n砍掉一半;如果是奇数,把n变成 3*n+ 1后砍掉一半,直到该数变为1为止。 请计算需要经过几步才能将n变到1,具体可见样例。

输入描述:

测试包含多个用例,每个用例包含一个整数n。(1<=n<=10000)

输出描述:

对于每组测试用例请输出一个数,表示需要经过的步数,每组输出占一行。

示例1

输入:

3
1

输出:

5
0

题解:

#include <iostream>
#include <cstdio>

using namespace std;

/**
 * XXX定律--浙江大学
 * @return
 */
int main() {
    int n;
    while (cin >> n) {
        //计数
        int count = 0;
        while (n != 1) {
            if ((n & 1) == 0) {
                //n为偶数
                n = n >> 1;
            } else {
                //n为奇数
                n = 3 * n + 1;
                n = n >> 1;
            }
            count++;
        }
        cout << count << endl;
    }
    return 0;
}

研究生复试上机基本题型及思路总结(上篇) 一、暴力求解 1. 枚举法 适用于问题规模较小,可以一个答案一个答案试统计所有的结果。一般问题的规模不能超过 10 的 6 次方。 2. 模拟法 按照题目的描述,直接编程输出即可。 2.1 图形排版 按照能否直接在输出图形中找到规律,采用两种方法。第一种是直接输出,适用于较为简单的题目,第二种方法是构造矩阵,改变矩阵直接输出,好处是可以从各个方向进行访问修改,... 阅读详情

相关推荐

王道机试指南(第二版)——题目OJ链接

计算机考研复试

weixin_51725225的博客 1万+

LNK2005 xxx already defined in libc.lib

原文地址:xxx already defined in libc.lib" style="text-decoration:none; color:rgb(106,63,48)">LNK2005 xxx already defined in libc.lib作者:海之子 原文网址: http://blog.sina.com.cn/s/blog_515526710100j5pp.html

wuliqunaowuliqunao的专栏 3542

【智能车学习】电磁循迹中的基本控制算法

今天心血来潮,突然想总结一下电磁车的一些基本算法,也希望可以给新手同学们一点帮助和参考。本篇主要讲述智能车电磁循迹中涉及到的基本算法,包括滤波算法,归一化算法,PID控制等

Carry_qing的博客 6万+

xxx.obj : error LNK2005 ................已经在x.obj中定义 ……

编程中经常能遇到LNK2005错误——重复定义错误,其实LNK2005错误并不是一个很难解决的错误。弄清楚它形成的原因,就可以轻松解决它了。        造成LNK2005错误主要有以下几种情况:       1.重复定义全局变量。可能存在两种情况:       A、对于一些初学编程的程序员,有时候会以为需要使用全局变量的地方就可以使用定义申明一下。其实这是错误的,全局变量是针对整个工程的

优快云Microsoft优快云的专栏 9224

Intel Realsense windows安装与入门

realsense400系列介绍: https://www.intelrealsense.com/stereo-depth/?utm_source=intelcom_website&utm_medium=button&utm_campaign=day-to-day&utm_content=D400_learn-more_button realsense 435i介绍: ...

hanshuning的专栏 1万+

EMQX 结合MySQL实现精细化ACL权限管理实战

本文详细介绍了如何通过EMQX结合MySQL实现精细化的ACL权限管理,提升物联网设备接入和消息传输的安全性。内容包括环境准备、基础配置、权限规则设计技巧以及高级应用与性能优化方案,帮助开发者快速掌握动态生效、便于管理的权限控制方法。

weixin_28683689的博客 196

SQL Server2005 登入 'xxx' 登入失敗。此登入的密碼已經逾期。

 转:http://www.dotblogs.com.tw/hunterpo/archive/2009/09/19/10714.aspx 今天系统突然出现:【提示】:无法连接数据库,登陆失败! 请检查数据库配置是否正确!用登陆名登陆,出现,您的密码已过期,请重新设置密码,设置之后,问题解决。后在网上看到此文,记录之。     前幾天 (2009/9/16) 晚上 7 點左右

xiaokuang513204的专栏 4326

CMN-700组件全解析:从XP路由器到HN-F主节点的实战配置指南

本文深入解析Arm CMN-700片上网络IP的核心组件与实战配置。重点剖析了XP网格路由器的拓扑规划与CHI通道管理,以及HN-F全一致性主节点在维护缓存一致性、管理SLC和地址映射中的关键作用。通过一个12×12网格的配置案例,为硬件工程师提供了从组件布局、地址映射到性能调优的系统级设计指南。

weixin_29313423的博客 281

关于上传漏洞的解决问题 [转]

关于上传漏洞的解决问题 [2005-4-19] 【关键字:上传漏洞 UPFILE.ASP】一、写在前面***这个上传漏洞利用的原理只是针对form格式上传的asp和php脚本***NC(Netcat)用于提交数据包DOS界面下运行:NC -vv www.***.com 80<1.txt-vv: 回显80: www端口1.txt: 就是你要发送的

AI 前沿技术实战博客:LLM / Agent / AI 制药 / 生信四大栏目日更,硬核干货 + 可复现代码,看完就能上手 1万+

Prism 入门02,区域介绍

什么是区域(Region)?区域,在Prism 框架中,区域是模块化的核心的功能之一,其主要作用是降低应用程序和模块之间的耦合度。使用方式:在应用程序的界面中,划分出某块区域,并为这个区域定义一个唯一的区域名称。那么通过这个区域名称,应用程序就可以找到指定的区域。并为这个区域动态放置一些容器或控件,从而呈现在界面中。

build2024 1125

目标检测YOLO实战应用案例100讲-【目标检测】缺陷检测(二)

在工业生产中总是经常遇到裂痕、划痕等产品的表面缺陷问题,机器视觉行业对于表面检测相比前几年已经有很大的突破,对于产品表面的划伤、污迹等检测已经不再是难点。在金属、玻璃、手机屏幕、液晶板等行业表面检测上应用广泛。但由于该类缺陷形状不规则、深浅对比度低,而且往往会被产品表面的自然纹理或图案所干扰。因此,表面划痕缺陷检测对于正确打光、相机分辨率、被检测部件与工业相机的相对位置、复杂的机器视觉算法等要求非常高。

qq_36130719的博客 728

王道机试指南习题链接集合

王道机试指南习题链接集合

weixin_42294283的博客 2129

浏览器解析HTML的过程及编程实现

需要注意的是,上述示例代码只是简化的演示,并未涵盖浏览器解析HTML的所有细节和复杂性。实际上,浏览器的HTML解析引擎还会处理一系列的特殊情况、错误容错和性能优化等方面的内容,以确保能够正确解析各种类型的HTML代码。HTML(超文本标记语言)是构建网页的基础语言,浏览器负责将HTML代码解析并渲染成可视化的网页。本文将详细介绍浏览器解析HTML的过程,并提供相应的编程示例代码。希望以上内容能帮助您理解浏览器解析HTML的过程,并通过提供的示例代码更好地了解如何在编程中实现这一过程。

ByteJolt的博客 321

【华为机试真题详解】机试题按知识点整理(入门指引)

【华为机试真题 Python实现】【2022 Q1 Q2 | 100分】《华为机试真题》专栏含牛客网华为专栏、华为面经试题、华为OD机试真题。如果您在准备华为的面试,期间有想了解的可以私信我,我会尽可能帮您解答,也可以给您一些建议!本文解法非最优解(即非性能最优)。专栏的题目,麻烦都收藏,点赞一下,支持一下,感谢!!【牛客网】 HJ5 进制转换 【牛客网】 HJ1 字符串最后一个单词的长度HJ17 坐标移动 (中等) HJ20 密码验证合格程序(中等) HJ33 整数与IP地址间的转换(中等)【机试真题】字

1万+

【OpenClaw从入门到精通】第26篇:从0到1构建OpenClaw二次发行版——企业专属AI平台实战指南(2026实测)

本文基于OpenClaw 2026.3.7开源内核,聚焦企业级AI平台的二次发行构建,从技术原理、实操流程到商业落地提供完整方法论。核心围绕“内核层-能力层-产品层”三层架构,详解源码编译、私有化部署、企业级特性开发(数据合规、国产化适配、业务系统集成)、产品化包装等关键步骤,并通过审计行业“智审助手”虚拟实战案例具象化落地路径。文章兼顾新手入门与进阶提升,提供可直接复用的代码、配置文件及执行结果,解决企业对AI Agent“开箱即用”“数据不出域”“业务适配”的核心诉求,助力开发者快速打造企业专属AI平台

专注于人工智能、软件开发、工控自动化、工厂数字化及智能化等领域,希望和大家共同进步! 710

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

王道考研机试指南第2版——题目提交链接

王道考研机试指南第2版——题目链接、代码

qq_39520843的博客 4762

VC中sqlite的使用

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

计算机考研机试指南第二版(王道)——第二章 暴力求解

机试指南第二章暴力求解。

weixin_44621423的博客 1157

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

王道机试课程总结

3)例题2.1 abc 先设计算法3个for循环,分析复杂度,与题目数据量进行对比,得出结果可以使用。4)多组输入,指定跳出:利用while循环输出多组数据,用if,break语句实现指定跳出。2)操作:1查询代码讲解,2合并代码讲解,3路径压缩代码讲解,4树高低代码讲解。3) 第k大数, 快速排序讲解, 快速排序代码讲解,改进求第k大数。2)例题8.3Fibonacci(分治法,递推法,矩阵快速幂,公式法)2)逆序数对,归并排序讲解,归并排序、求逆序数算法代码讲解。

m0_57741101的博客 1097

机试指南第二章 暴力求解

P10 习题2.1 #include <iostream> #include <iomanip> //http://t.cn/ using namespace std; bool judge(int x){ while (x!=0){ if (x%10 == 7 ){return true;} x = x/10; } ...

weixin_42562498的博客 287

王道机试 第二章 暴力求解 2.1 枚举

王道机试 第二章 暴力求解 2.1 枚举 例2.1 abcabcabc(清华大学复试上机题) #include <iostream> using namespace std; int main() { for (int a = 0; a < 10; a++){ for (int b = 0; b < 10; b++){ for (int c = 0; c &l...

Patience 374

[机试]第二章 暴力求解(枚举与模拟)

例题2.1 abc KY15 abc #define _CRT_SECURE_NO_DEPRECATE #include <cstdio> using namespace std; int main() { for (int a = 0; a <= 9; ++a) { for (int b = 0; b <= 9; ++b) { for (int c = 0; c <= 9; ++c) { if (a * 100 + b * 110 + c * 12 ==

“知识最大的敌人不是无知,而是错觉” 492

牛客网高校机试题/编程题/王道机试指南-习题(不定期更新,待续)

王道机试指南-习题(不定期更新,待续) 目录 王道机试指南-习题(不定期更新,待续) 第二章 暴力求解 2.1 枚举 习题2.2 百鸡问题-哈工大上机 习题2.3 Old Bill-上交大机试 第二章 暴力求解 2.1 枚举 习题2.2 百鸡问题-哈工大上机 F&Q1:在Visual Studio中,scanf被认为是不安全的,需要用scanf_s代替。 F&Q2:考虑到z/3之后,Z变为整数,必然是≤(double)z/3,这将有可能引起式子的判断失误,因为 /

个人博客 | 看博客描述联系我 891

求解出能被5整除的正整数的乘积_暴力求解习题解答(王道计算机机试指南)...

马上准备研究生了,这篇文章纯属用来记录自己的菜鸡编程,题目来源都是王道/牛客网。这一部分是暴力求解问题,随缘更新。2020/05/06更新。(暴力求解大概就做这么多,写别的题目去了)题目一:与7无关的数一个正整数,如果它能被7整除,或者它的十进制表示法中某个位数上的数字为7, 则称其为与7相关的数.现求所有小于等于n(n<100)的与7无关的正整数的平方和。链接地址:与7无关的数_牛客网​w...

weixin_39632291的博客 605

王道机试 第二章 暴力求解 2.2 模拟

王道机试 第二章 暴力求解 2.2 模拟 1、图形排版 例2.4 输出梯形(清华大学复试上机题) #include <iostream> #include <cstdio> using namespace std; int main() { int h; while (cin >> h){ for (int i = h - 1; i >= 0; ...

Patience 453

王道计算机机试指南练习题(复习、保研/考研刷题)

王道计算机机试指南练习题,用于复习、保研或考研刷题

m0_74317463的博客 1653

王道计算机考研机试指南----暴力求解

计算机考研机试指南---暴力求解

cldnit的博客 351
上一篇: 机试_1_暴力求解
下一篇: 机试_2_排序与查找
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

窝在角落里学习

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值