机试_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

Android 13 系统定制:实现第三方Launcher预置与原生Launcher3的共存切换

本文详细介绍了在Android 13系统中实现第三方Launcher预置与原生Launcher3共存切换的技术方案。通过修改ResolverActivity逻辑、处理首次启动设置以及优化用户切换机制,开发者可以灵活定制默认Launcher,同时保留用户自由选择权。文章还提供了常见问题排查指南和性能优化建议,帮助提升双Launcher方案的稳定性和用户体验。

weixin_30275415的博客 126

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

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

优快云Microsoft优快云的专栏 9224

LVGL高效加载外部Flash图片资源的实现与优化

本文深入探讨了在嵌入式UI开发中,如何为LVGL高效加载外部Flash中的图片资源。针对内部Flash容量不足的痛点,详细解析了LVGL的图片处理原理,并对比了内存映射与流式解码两种主流实现方案。文章重点提供了性能优化技巧与实战避坑指南,旨在帮助开发者实现流畅的图片加载体验,解决SPI Flash读取慢、内存占用高等核心挑战。

t1u2v的博客 462

利用随机矩阵理论(random matrix theory)确定微生物网络构建阈值

利用随机矩阵理论(random matrix theory)确定微生物网络构建阈值

微生物生态学分析 7637

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

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

xiaokuang513204的专栏 4326

airodump-ng、aircrack-ng使用教程

wifi破解、airodump-ng、aircrack-ng脚本

ssmbyss的博客 2231

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

关于上传漏洞的解决问题 [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万+

ElasticSearch读写性能调优

深层次理解,虽然是每隔一秒就会将内存中的segment数据刷新到segment file中,但实际上这里并没有直接到磁盘文件,而是先写入到OS Cache中。以refresh_interval为间隔时间,将保存在ES 内存缓存区中的数据 刷新到 os的文件系统缓存中,定期清空es的buffer,生成segment。注意:ES 的默认设置,已经综合考虑了数据可靠性,搜索的实时性,写入速度,一般不要盲目修改。将segment刷新到os cache中,并开放了查询权限,以提升搜索的实时性。

qq_44027353的博客 1811

基于Java的高校学生信息管理系统的设计与实现(论文+源码)

可以对本系统的数据进行良好的封装,Java可以对不想被访问的数据进行良好的隐藏,具备平台无关性,可移植,更加可靠与安全,具备多线程支持,进行网络交互更容易。它支持本系统的B/S模式。开发效益方面,本系统一旦开发成功并且面向社会,就会让大多数的学生教师体会到便利办公的乐趣,随之促进提高本系统的使用率和经济利润,所以在经济方面,对于零成本开发且高利润的学生管理系统是可行的。学生可以在学生端进行选课,查看自己的成绩,教师可以在教师端查看所任课程的选课情况,对学生成绩进行录入,对所任的课程进行结课等操作。

2402_82389843的博客 1091

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

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

weixin_42294283的博客 2129

AWR2243的等效相位中心与虚拟通道

在俯仰维方向上,不重合的虚拟通道有8个,排序为1:4,9:12。每个虚拟阵元之间的间隔为lambda/2。实际y轴方向虚拟阵列只跨越了8*lambda/2的距离。等效相位中心与虚拟通道类似,只是每个相位中心之间间隔为lambda/4,实际y轴方向等效相位中心只跨越了8*lambda/4=7.59mm的距离

qq_50974341的博客 1981

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

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

1万+

YOLO26涨点改进| TGRS 2026 | 独家创新首发、注意力改进篇| 引入LCGA局部曲率引导注意力,保持局部稳定性的同时突出关键几何区域,含多种创新改进,促进YOLO26所有任务高效涨点

🔥本文提出LCGA(局部曲率引导注意力)模块,通过引入曲率信息改进YOLO26网络模型。LCGA在局部窗口内利用深度卷积构造曲率代理,调制标准窗口注意力,使模型更关注道路、边界等曲线型结构,提升遥感图像超分辨率中的几何保真度。相比普通注意力,LCGA能精准聚焦关键几何区域,减少边缘断裂和轮廓偏移,同时保持较低计算开销。实验表明LCGA显著提升性能,在UCMerced数据集上PSNR提升0.2148dB。文章提供了三种改进方案。

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

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

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

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

qq_39520843的博客 4762

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

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

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

weixin_44621423的博客 1157

Devexpress16.2.6破解工具

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

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

王道机试课程总结

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、付费专栏及课程。

余额充值