冒泡排序同样的代码在Python3上可以运行,为什么在Spyder上无法运行?怎么改?

冒泡排序同样的代码在Python3上可以运行,为什么在Spyder上无法运行?

l[5,4,3,2,1]
count=len(l)
for i in range(0,count):
    for j in range(i+1,count):
        if l[i]>l[j]:
            l[i],l[j]=l[j],l[i]
            print(l)

这是冒泡排序的代码,在Python3上没有任何问题,在Spyder上显示l未定义。为什么?怎么改?

1个回答

l=[5,4,3,2,1]加个=不行吗

m0_45128748
dsswns 已采纳,可以了,感谢大神。但是。。为什么呢
6 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
腾讯管家的托盘加速球是如何实现的
![图片说明](https://img-ask.csdn.net/upload/202004/02/1585819527_539724.png) 如上图,像这样在非 SysPager 中的托盘图标是如何实现的,包括360,360甚至能够直接启动图标的平板模式(间距更大) </br> 我用 SPY++看窗体,他似乎不是嵌入在 Explorer 里的 ![图片说明](https://img-ask.csdn.net/upload/202004/02/1585819729_170113.png) 我想了几种可能的情况: 1、钩子钩到 TrayNotifyWnd 的大小改变事件,在里面根据窗体的句柄重新安排窗体位置,留下了自己图标大小的空间,然后放个置顶的窗体在上面 2、将 deskband 注册到了那个位置(猜的,完全没有头绪) 最神乎其技的是,他似乎没有以其他的系统托盘窗体作为依托(我将系统托盘全部关闭他也能随时添加这个图标),但是有一点就是把他加入后,TrayNotifyWnd 的绘制事件会多出。 钩子那种方法我用系统时钟试了一下,调整大小会直接消失。 而第二种方法可行性就更不确定了,CodeProject StackOverFlow Google 都找过,没有什么实际性的建议,最靠谱的就是第一种情况,但是我实在是没办法找到可行代码。 学生出于兴趣问的,希望老 Windows 开发能够帮助一下(标签都没有windows了,唉)
Spy's Work 代码设计的思路
Problem Description I'm a manager of a large trading company, called ACM, and responsible for the market research. Recently, another trading company, called ICPC, is set up suddenly. It's obvious that we are the competitor to each other now! To get some information about ICPC, I have learned a lot about it. ICPC has N staffs now (numbered from 1 to N, and boss is 1), and anybody has at most one superior. To increase the efficiency of the whole company, the company contains N departments and the ith department is led by the ith staff. All subordinates of the ith staff are also belong to the ith department. Last week, we hire a spy stealing into ICPC to get some information about salaries of staffs. Not getting the detail about each one, the spy only gets some information about some departments: the sum of the salaries of staff s working for the ith department is less than (more than or equal to) w. Although the some inaccurate information, we can also get some important intelligence from it. Now I only concerned about whether the spy is telling a lie to us, that is to say, there will be some conflicts in the information. So I invite you, the talented programmer, to help me check the correction of the information. Pay attention, my dear friend, each staff of ICPC will always get a salary even if it just 1 dollar! Input There are multiple test cases. The first line is an integer N. (1 <= N <= 10,000) Each line i from 2 to N lines contains an integer x indicating the xth staff is the ith staff's superior(x<i). The next line contains an integer M indicating the number of information from spy. (1 <= M <= 10,000) The next M lines have the form like (x < (> or =) w), indicating the sum of the xth department is less than(more than or equal to) w (1 <= w <=100,000,000) Output For each test case, output "True" if the information has no confliction; otherwise output "Lie". Sample Input 5 1 1 3 3 3 1 < 6 3 = 4 2 = 2 5 1 1 3 3 3 1 > 5 3 = 4 2 = 2 Sample Output Lie True
封装了IE浏览器的一个windows程序怎么使用python自动化?
windows 一个exe的客户端程序里面封装了一个IE浏览器,F12可以进入开发者模式。spy++能找到里面的一些菜单。虽然也可以使用IE浏览器直接登录,但是由于python+selenium开发的脚本运行速度非常慢(感觉跟电脑硬件/环境关系较大)。所以现在在想是否能直接使用python去实现在这个exe客户端程序里面自动化? exe客户端程序页面如图![图片说明](https://img-ask.csdn.net/upload/201911/26/1574781181_958582.png) :
SPY 实现的代码是什么
Problem Description The National Intelligence Council of X Nation receives a piece of credible information that Nation Y will send spies to steal Nation X’s confidential paper. So the commander of The National Intelligence Council take measures immediately, he will investigate people who will come into NationX. At the same time, there are two List in the Commander’s hand, one is full of spies that Nation Y will send to Nation X, and the other one is full of spies that Nation X has sent to Nation Y before. There may be some overlaps of the two list. Because the spy may act two roles at the same time, which means that he may be the one that is sent from Nation X to Nation Y, we just call this type a “dual-spy”. So Nation Y may send “dual_spy” back to Nation X, and it is obvious now that it is good for Nation X, because “dual_spy” may bring back NationY’s confidential paper without worrying to be detention by NationY’s frontier So the commander decides to seize those that are sent by NationY, and let the ordinary people and the “dual_spy” in at the same time .So can you decide a list that should be caught by the Commander? A:the list contains that will come to the NationX’s frontier. B:the list contains spies that will be sent by Nation Y. C:the list contains spies that were sent to NationY before. Input There are several test cases. Each test case contains four parts, the first part contains 3 positive integers A, B, C, and A is the number which will come into the frontier. B is the number that will be sent by Nation Y, and C is the number that NationX has sent to NationY before. The second part contains A strings, the name list of that will come into the frontier. The second part contains B strings, the name list of that are sent by NationY. The second part contains C strings, the name list of the “dual_spy”. There will be a blank line after each test case. There won’t be any repetitive names in a single list, if repetitive names appear in two lists, they mean the same people. Output Output the list that the commander should caught (in the appearance order of the lists B).if no one should be caught, then , you should output “No enemy spy” Sample Input 8 4 3 Zhao Qian Sun Li Zhou Wu Zheng Wang Zhao Qian Sun Li Zhao Zhou Zheng 2 2 2 Zhao Qian Zhao Qian Zhao Qian Sample Output Qian Sun Li No enemy spy
SPY 是怎么来做的
Problem Description The National Intelligence Council of X Nation receives a piece of credible information that Nation Y will send spies to steal Nation X’s confidential paper. So the commander of The National Intelligence Council take measures immediately, he will investigate people who will come into NationX. At the same time, there are two List in the Commander’s hand, one is full of spies that Nation Y will send to Nation X, and the other one is full of spies that Nation X has sent to Nation Y before. There may be some overlaps of the two list. Because the spy may act two roles at the same time, which means that he may be the one that is sent from Nation X to Nation Y, we just call this type a “dual-spy”. So Nation Y may send “dual_spy” back to Nation X, and it is obvious now that it is good for Nation X, because “dual_spy” may bring back NationY’s confidential paper without worrying to be detention by NationY’s frontier So the commander decides to seize those that are sent by NationY, and let the ordinary people and the “dual_spy” in at the same time .So can you decide a list that should be caught by the Commander? A:the list contains that will come to the NationX’s frontier. B:the list contains spies that will be sent by Nation Y. C:the list contains spies that were sent to NationY before. Input There are several test cases. Each test case contains four parts, the first part contains 3 positive integers A, B, C, and A is the number which will come into the frontier. B is the number that will be sent by Nation Y, and C is the number that NationX has sent to NationY before. The second part contains A strings, the name list of that will come into the frontier. The second part contains B strings, the name list of that are sent by NationY. The second part contains C strings, the name list of the “dual_spy”. There will be a blank line after each test case. There won’t be any repetitive names in a single list, if repetitive names appear in two lists, they mean the same people. Output Output the list that the commander should caught (in the appearance order of the lists B).if no one should be caught, then , you should output “No enemy spy” Sample Input 8 4 3 Zhao Qian Sun Li Zhou Wu Zheng Wang Zhao Qian Sun Li Zhao Zhou Zheng 2 2 2 Zhao Qian Zhao Qian Zhao Qian Sample Output Qian Sun Li No enemy spy
利用WindowsAPI移动第三方程序子页面,但用SPY++看不到它的Form名和Class怎么办?
自己的程序需要对第三方的程序下的一个Form进行移动和固定大小,但这个Form没有标题,用SPY++看它的ClassName也是HwndWrapper,整个复制下来FindWindow是没问题的,但这个HwndWrapper后面的参数每次重启后都会变,非常头疼,不知道这个HwndWrapper到底是啥意思,怎么可以确切的获取到它。 ![如图,Form没有标题](https://img-ask.csdn.net/upload/202001/15/1579097957_371335.jpg) ![如图,它的ClassName是HwndWrapper方式的,后面的ID每次重启都会变](https://img-ask.csdn.net/upload/202001/15/1579098006_59235.jpg)
Cipher 代码的实现过程
Problem Description A spy is using a clever cipher technique to encode and decode messages. The technique is very efficient as it enables him to send and receive any message, no matter how long it is with only three numbers! After many great efforts, The Department of National Security managed to figure out how the technique works: 1. First of all, the only characters used are the space and lower case English letters. Each character is assigned an integer called the character volume, a space character has volume 1, ‘a’ has volume 2, ‘b’ has volume 3 and so on until ‘z’ which has volume 27. The volume of the whole message V is the sum of volumes of characters in the message. 2. A message consists of a number of words W, a word is a consecutive sequence of lower case letters, messages have no leading or trailing spaces and there is only one space between consecutive words. 3. For a certain V and W, let S be the lexicographically sorted set of messages that have volume V and consists of exactly W words. We can refer to a certain message using its one-based index I in S. So when the spy wants to send a message M, he calculates its Volume V and the number of words it contains W and finds its index I in the corresponding set S (its index among all sorted messages of volume V with W words) and sends only three numbers along: V, W and I! The Department of National Security has done a great effort so far, yet they seek your help to decode messages sent by the spy! That is, given V, W and I you must decrypt the spy’s message or determine that there is no such one! Input The first line of input contains an integer (1 <= T <= 200), the number of test cases. Each data set consists of a line with three integers the volume of the message (1 <= V <= 75), the number of words (1 <= W <= 20), and the index of message (1 <= I <= 1018). Output For each test case, print one line containing the decrypted message or “Corrupted!” if there is no valid message corresponding to the given inputs. Sample Input 3 7 2 3 2 1 2 50 2 39098532022 Sample Output Case #1: aa a Case #2: Corrupted! Case #3: big bang
小白求助,hdu2102 大佬们看看怎么wa了
改了一下午了,用深搜写的超时了,这个广搜还是wa 真心请教大佬帮帮小白吧 http://acm.hdu.edu.cn/showproblem.php?pid=2102 ``` #include <cstdio> #include <iostream> #include <cstring> #include <queue> using namespace std; struct node { int floor; int x; int y; int time; }; int n,m,t; int spx[] = {0,1,0,-1}; int spy[] = {1,0,-1,0}; char a[2][15][15]; int inq[2][15][15]; void bfs() { queue<node> q; node s,next; s.floor = 0; s.x = 0; s.y = 0; s.time = 0; inq[0][0][0] = 1; q.push(s); while(!q.empty()) { node top = q.front(); q.pop(); if(top.time>t) { break; } if(a[top.floor][top.x][top.y]=='P') { printf("YES\n"); return; } for(int i=0; i<4; i++) { next.x = top.x+spx[i]; next.y = top.y+spy[i]; next.floor = top.floor; next.time = top.time+1; if(next.x>=0&&next.x<n&&next.y>=0&&next.y<m&&!inq[next.floor][next.x][next.y]&&a[next.floor][next.x][next.y]!='*') { if(a[next.floor][next.x][next.y]=='#'&&a[1-next.floor][next.x][next.y]!='#'&&a[1-next.floor][next.x][next.y]!='*'&&!inq[1-next.floor][next.x][next.y]) { next.floor = 1-next.floor; inq[next.floor][next.x][next.y] = 1; } else inq[next.floor][next.x][next.y] = 1; q.push(next); } } } printf("NO\n"); return; } int main() { int c; scanf("%d",&c); while(c--) { cin >> n >> m >> t; //scanf("%d%d%d",&n,&m,&t); memset(a,'*',sizeof(a)); memset(inq,0,sizeof(inq)); //getchar(); for(int i=0; i<n; i++) scanf("%s",&a[0][i]); // getchar(); for(int i=0; i<n; i++) scanf("%s",&a[1][i]); bfs(); } return 0; } ```
排序的题目
Description 想必大家对排序已经很熟悉了,但是spy好像对排序不太熟悉,有一天,他看到这样一个关于排序的题目: 对于 k 个用空格分隔开的整数,依次为 n1, n2 … nk。请将所有下标不能被 3 但可以被 2 整除的数在这些数字原有的位置上进行升序排列,此外,将余下下标能被 3 整除的数在这些数字原有的位置上进行降序排列。 spy想了半天不知道怎么排序,你可以帮助他么? Input 多组数据,每组数据一行,为k个小于1000的正整数,依次为 n1, n2 … nk。(1 <= k <= 100000) Output 对于每组数据,输出排序后的结果。 Sample Input 1 3 4 2 10 6 8 Sample Output 1 2 6 3 10 4 8
Celestial Being
Problem Description Celestial Being(CB) is a private military organization which is aimed to rid the wars and con icts in the world, using the advanced mobile suit gundam. But due to high cost of manufacture a gundam, only four gundams were produced, named Exia, Dynames, Kyrios and Virtue. Gundams use a kind of mysterious particles known as GN particle to communicate with each other, and GN particle always transport messages parallel to coordinate axises. Thus when in battle, four gundams always form a rectangle whose sides are parallel to x-axis or y-axis, and the coordinates of all gundams are integers. Have known celestial being is going to attack their military base, colonel of the enemy, Sergei Smirnov ordered to release some detectors to detect the positions of gundams when they arrive. The military base is a rectangle feld of with with corners (0, 0), (w, 0), (0, h) and (w, h). Each detector has a parameter d and is either horizontal detector or vertical detector. A horizontal detector with parameter d can detect all positions on the lines y = h, where h is a multiple of d, while a vertical detector with parameter d can detect all positions on the lines x = v, where v is a multiple of d. If a position can be detected by k(k > 0) or more detectors, a gundam on that position will be discovered by the enemy. Got the parameters of all detectors from spy, the tactical forecaster of celestial being, Sumeragi Lee wants too know how many conservative battle positions are there. Can you help her? A conservative battle position is a combination of four distinct points with integer coordinates, each stands for a position of one gundam such that no gundam can be detected by k or more detectors, and the four points form a rectangle whose sides parallel to x-axis or y-axis. Note that change the positions of two gundams will result in a new battle positon. Input Each test case begins with five integers w(1 <= w <= 108), h(1 <= h <= 108), m(0 <= m <= 20), n(0 <= n <= 20) and k(k >= 1) on the first line, m is the number of horizontal detectors and n is the number of vertical detectors. Then m + n lines follows, the first m line are the parameters of horizontal detectors, and the rest n lines are the parameters of vertical detectors. All parameters are positive integers. Output Output one line for each test case, the number of conservative battle positions. Sample Input 1 1 0 0 1 1 1 1 0 2 2 1 1 1 1 2 2 2 5 3 1 1 1 2 2 5 3 1 1 2 2 2 5 3 1 1 3 2 2 Sample Output 24 24 0 72 720 2160
SPY
Problem Description The National Intelligence Council of X Nation receives a piece of credible information that Nation Y will send spies to steal Nation X’s confidential paper. So the commander of The National Intelligence Council take measures immediately, he will investigate people who will come into NationX. At the same time, there are two List in the Commander’s hand, one is full of spies that Nation Y will send to Nation X, and the other one is full of spies that Nation X has sent to Nation Y before. There may be some overlaps of the two list. Because the spy may act two roles at the same time, which means that he may be the one that is sent from Nation X to Nation Y, we just call this type a “dual-spy”. So Nation Y may send “dual_spy” back to Nation X, and it is obvious now that it is good for Nation X, because “dual_spy” may bring back NationY’s confidential paper without worrying to be detention by NationY’s frontier So the commander decides to seize those that are sent by NationY, and let the ordinary people and the “dual_spy” in at the same time .So can you decide a list that should be caught by the Commander? A:the list contains that will come to the NationX’s frontier. B:the list contains spies that will be sent by Nation Y. C:the list contains spies that were sent to NationY before. Input There are several test cases. Each test case contains four parts, the first part contains 3 positive integers A, B, C, and A is the number which will come into the frontier. B is the number that will be sent by Nation Y, and C is the number that NationX has sent to NationY before. The second part contains A strings, the name list of that will come into the frontier. The second part contains B strings, the name list of that are sent by NationY. The second part contains C strings, the name list of the “dual_spy”. There will be a blank line after each test case. There won’t be any repetitive names in a single list, if repetitive names appear in two lists, they mean the same people. Output Output the list that the commander should caught (in the appearance order of the lists B).if no one should be caught, then , you should output “No enemy spy” Sample Input 8 4 3 Zhao Qian Sun Li Zhou Wu Zheng Wang Zhao Qian Sun Li Zhao Zhou Zheng 2 2 2 Zhao Qian Zhao Qian Zhao Qian Sample Output Qian Sun Li No enemy spy
Cipher 是怎么一个编写
Problem Description A spy is using a clever cipher technique to encode and decode messages. The technique is very efficient as it enables him to send and receive any message, no matter how long it is with only three numbers! After many great efforts, The Department of National Security managed to figure out how the technique works: 1. First of all, the only characters used are the space and lower case English letters. Each character is assigned an integer called the character volume, a space character has volume 1, ‘a’ has volume 2, ‘b’ has volume 3 and so on until ‘z’ which has volume 27. The volume of the whole message V is the sum of volumes of characters in the message. 2. A message consists of a number of words W, a word is a consecutive sequence of lower case letters, messages have no leading or trailing spaces and there is only one space between consecutive words. 3. For a certain V and W, let S be the lexicographically sorted set of messages that have volume V and consists of exactly W words. We can refer to a certain message using its one-based index I in S. So when the spy wants to send a message M, he calculates its Volume V and the number of words it contains W and finds its index I in the corresponding set S (its index among all sorted messages of volume V with W words) and sends only three numbers along: V, W and I! The Department of National Security has done a great effort so far, yet they seek your help to decode messages sent by the spy! That is, given V, W and I you must decrypt the spy’s message or determine that there is no such one! Input The first line of input contains an integer (1 <= T <= 200), the number of test cases. Each data set consists of a line with three integers the volume of the message (1 <= V <= 75), the number of words (1 <= W <= 20), and the index of message (1 <= I <= 1018). Output For each test case, print one line containing the decrypted message or “Corrupted!” if there is no valid message corresponding to the given inputs. Sample Input 3 7 2 3 2 1 2 50 2 39098532022 Sample Output Case #1: aa a Case #2: Corrupted! Case #3: big bang
Air Strike 代码怎么解决
Problem Description General Gee is the commander of a military base. He has just received alarming news from one of his spies: the enemy's preparing an air missile strike. The base contains two magnetic towers. When activated and given sufficient power, each of the magnetic towers creates a powerful horizontal magnetic disk. If any missile passes through this disk it deflects away from the base. Although those towers seem to be an excellent air defense method, there is a problem: The area of the disk generated by a tower is proportional to the amount of energy it receives. The base has enough power plants to generate a certain amount of energy, which has to be divided among those two towers. That means that the total area of the two disks generated from the towers should not exceed the total energy generated by the power plants. Fortunately, the spy was able to know the exact target co-ordinates of the incoming missiles and he reported them to General Gee. The General needs your help in distributing the energy on the two magnetic towers to minimize the number of missiles that will not get deflected by the magnetic towers and therefore will hit the base. You may assume the following: 1. The towers have different heights and therefore there are no problems associated with the magnetic disks interfering with each other. 2. A missile will deflect if it passes through the magnetic disk of a tower or even if it just touches its boundary. 3. A missile hitting a tower (landing exactly on its location) will deflect, even if the tower is not given any energy. 4. All incoming missiles will go down simultaneously at the exact instant; therefore, there will not be any time available to redistribute the energy amongst the two towers during the strike. Input Input consists of several test cases. Each test case is specified on N+2 lines. The first line contains an integer (1 <= N <= 1, 000) representing the number of missiles. The second line contains 5 real numbers X1, Y1, X2, Y2 and T: (X1, Y1) is the coordinates of the first tower, (X2, Y2) is the coordinates of the second tower and (0 <= T) is the total amount of energy generated from the power plants (the total area of the two magnetic disks). Each line of the remaining N lines contains two real numbers representing the landing coordinates of a missile. The absolute value of all the given real numbers is less than or equal to 100 and may include a decimal point followed by up to 3 digits. Any two consecutive numbers on the same line are separated by one or more white-space characters. Zero or more blank lines may appear between test cases. The last line of the input file is made of a single zero. Output For each test case, print the following line: k. M Where k is the test case number (starting at one,) and M is the minimum number of missiles that will NOT be deflected in the best distribution of energy among the two towers. Use π = 3.141. Note: There is a blank space before M. Sample Input 6 -3 0 3 0 40.833 -1 4 -2 2.5 1 2 5 2 -4 0 -3 -1 2 0 0 1 1 0 0 0 1 1 0 Sample Output 1. 2 2. 0
Need for Speed 是怎么写的程序
Problem Description Jiaoshou is a fan of “Need for Speed”, a famous game which most people have played. Recently, Jiaoshou had cleared “Need for Speed Undercover”. In this game, Jiaoshou acted as a spy. To prove that he is not a spy, Jiaoshou must do some evil things frequently. So lots of police cars often ran after him. In order to escape from the chase, Jiaoshou need to accelerate his Bugatti Veyron. To simplify this problem, we just assume that only one police car ran after Jiaoshou. And Bugatti Veyron’s speed is vx. The police car’s speed is vy. v is a function of first degree or a constant, as the form of a*m+b. In this form, m means the minute that the car has run. Now Jiaoshou is S meters ahead. Jiaoshou like to know if he could escape from the chase. He want you to write a program to solve this problem. Input The input contains several tests. The first line of the input is a single integer T (T<1000) which is the number of test cases. Then T test cases follow. Each test case contains three lines. The first line contains a single real number S (0<S<=10^6) , as the problem has described. The second line contains two real numbers ax, bx, indicating Bugatti Veyron’s speed is ax*m+bx. The last line also contains two real numbers ay, by, indicating the police car’s speed is ay*m+by. All numbers are range from -1000 to 1000, except S. Output If Jiaoshou can escape from the chase, please output “Good driver,Jiaoshou!”. Otherwise, please output the real number M rounded to three digits after the decimal point , in the form of “Oh,God!Jiaoshou will be catched after M minutes.” Sample Input 2 100 0 10 0 20 1000 0 1 0 0 Sample Output Oh,God!Jiaoshou will be catched after 10.000 minutes. Good driver,Jiaoshou!
UFT 12 Object Spy 是灰色的不能用
Hi, 我安装的UFT12 的object spy 按钮为什么是灰色的,有人知道吗? Thanks.
Bombing 的问题的解析
Problem Description It’s a cruel war which killed millions of people and ruined series of cities. In order to stop it, let’s bomb the opponent’s base. It seems not to be a hard work in circumstances of street battles, however, you’ll be encountered a much more difficult instance: recounting exploits of the military. In the bombing action, the commander will dispatch a group of bombers with weapons having the huge destructive power to destroy all the targets in a line. Thanks to the outstanding work of our spy, the positions of all opponents’ bases had been detected and marked on the map, consequently, the bombing plan will be sent to you. Specifically, the map is expressed as a 2D-plane with some positions of enemy’s bases marked on. The bombers are dispatched orderly and each of them will bomb a vertical or horizontal line on the map. Then your commanded wants you to report that how many bases will be destroyed by each bomber. Notice that a ruined base will not be taken into account when calculating the exploits of later bombers. Input Multiple test cases and each test cases starts with two non-negative integer N (N<=100,000) and M (M<=100,000) denoting the number of target bases and the number of scheduled bombers respectively. In the following N line, there is a pair of integers x and y separated by single space indicating the coordinate of position of each opponent’s base. The following M lines describe the bombers, each of them contains two integers c and d where c is 0 or 1 and d is an integer with absolute value no more than 109, if c = 0, then this bomber will bomb the line x = d, otherwise y = d. The input will end when N = M = 0 and the number of test cases is no more than 50. Output For each test case, output M lines, the ith line contains a single integer denoting the number of bases that were destroyed by the corresponding bomber in the input. Output a blank line after each test case. Sample Input 3 2 1 2 1 3 2 3 0 1 1 3 0 0 Sample Output 2 1
UI Spy查看不了第三方控件的信息怎么办?
我想用获取到PC版微信的聊天窗口的聊天信息的控件,为什么用UI Spy捕获不到控件,怀疑微信是用了自己开发的控件,不属于windows的控件,现在想做一个项目获取到微信聊天框的聊天内容,不知道怎么有什么办法能够获取到第三方控件的信息。有见过别人开发的软件都可以的。请各位帮我想想办法。研究了整整两天了。
Escape 如何来实现呢
Problem Description The students of the HEU are maneuvering for their military training. The red army and the blue army are at war today. The blue army finds that Little A is the spy of the red army, so Little A has to escape from the headquarters of the blue army to that of the red army. The battle field is a rectangle of size m*n, and the headquarters of the blue army and the red army are placed at (0, 0) and (m, n), respectively, which means that Little A will go from (0, 0) to (m, n). The picture below denotes the shape of the battle field and the notation of directions that we will use later. The blue army is eager to revenge, so it tries its best to kill Little A during his escape. The blue army places many castles, which will shoot to a fixed direction periodically. It costs Little A one unit of energy per second, whether he moves or not. If he uses up all his energy or gets shot at sometime, then he fails. Little A can move north, south, east or west, one unit per second. Note he may stay at times in order not to be shot. To simplify the problem, let’s assume that Little A cannot stop in the middle of a second. He will neither get shot nor block the bullet during his move, which means that a bullet can only kill Little A at positions with integer coordinates. Consider the example below. The bullet moves from (0, 3) to (0, 0) at the speed of 3 units per second, and Little A moves from (0, 0) to (0, 1) at the speed of 1 unit per second. Then Little A is not killed. But if the bullet moves 2 units per second in the above example, Little A will be killed at (0, 1). Now, please tell Little A whether he can escape. Input For every test case, the first line has four integers, m, n, k and d (2<=m, n<=100, 0<=k<=100, m+ n<=d<=1000). m and n are the size of the battle ground, k is the number of castles and d is the units of energy Little A initially has. The next k lines describe the castles each. Each line contains a character c and four integers, t, v, x and y. Here c is ‘N’, ‘S’, ‘E’ or ‘W’ giving the direction to which the castle shoots, t is the period, v is the velocity of the bullets shot (i.e. units passed per second), and (x, y) is the location of the castle. Here we suppose that if a castle is shot by other castles, it will block others’ shots but will NOT be destroyed. And two bullets will pass each other without affecting their directions and velocities. All castles begin to shoot when Little A starts to escape. Proceed to the end of file. Output If Little A can escape, print the minimum time required in seconds on a single line. Otherwise print “Bad luck!” without quotes. Sample Input 4 4 3 10 N 1 1 1 1 W 1 1 3 2 W 2 1 2 4 4 4 3 10 N 1 1 1 1 W 1 1 3 2 W 1 1 2 4 Sample Output 9 Bad luck!
Word Ladder 的算法问题
Problem Description A word ladder is a sequence of words, in which two consecutive words differ by exactly one letter. An example of such a ladder (usually arranged vertically, hence the "ladder" would be: beer, brew, brow, word, down. Note that to get from one word to the next, the letters may be rearranged, and exactly one letter is changed. For this problem, you will be given a dictionary of distinct words, all of the same length. Your task is to write a program that finds a word ladder of minimal length, such that the first and last word of the ladder have no letters in common. Input On the first line an integer t (1<=t <= 100): the number of test cases. Then for each test case: A line with two space-separated integers n (2 <= n <= 100) and l (1 <= l <= 20): the number of words and their length. n lines with a word, each consisting of l lowercase letters (a - z). Output For each testcase: a single line with the words in a ladder of minimal length, separated by a single space. It is guaranteed that at least one such ladder can be constructed. If there is more than one, output the one that comes first lexicographically. Notes: If s and t are strings of equal length and si denotes the ith character of s, then s precedes t lexicographically if for some i: si < ti and sj = tj for all j < i. Sample Input 1 9 3 alt spy sea opt pea ape spa apt ale Sample Output ale alt apt opt
(win7/win10系统下) python 如何实现后台点击鼠标左键?
import win32gui import win32api import win32con if __name__ == '__main__': p1 = (30, 255) handle = win32gui.FindWindow(None, '计算器') rect = win32gui.GetWindowRect(handle) win32api.SetCursorPos((rect[0] + p1[0], rect[1] + p1[1])) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) # ------------------------------------- import win32gui import win32api import win32con if __name__ == '__main__': p1 = (30, 255) handle = win32gui.FindWindow(None, '计算器') tmp = win32api.MAKELONG(p1[0], p1[1]) win32api.SendMessage(handle, win32con.WM_MOUSEMOVE, win32con.MK_LBUTTON, tmp) win32api.SendMessage(handle, win32con.WM_LBUTTONDOWN, win32con.MK_LBUTTON, tmp) win32api.SendMessage(handle, win32con.WM_LBUTTONUP, win32con.MK_LBUTTON, tmp) # ------------------------------------- (win7/win10系统下) 第一段代码可以实现前台点击,第二段代码尝试多种变型都无法实现前台点击,跟不用说后台点击,请高手帮忙解答。谢谢。 回复caozhy: 1.WM_MOUSEMOVE 时,MK_LBUTTON改成0依然没有效果 2.win7/win10下,spy++无法跟踪计算器的消息,有些软件的消息可以跟踪。原因不明。 回复qq_38282192: 什么意思?不太明白
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
卸载 x 雷某度!GitHub 标星 1.5w+,从此我只用这款全能高速下载工具!
作者 | Rocky0429 来源 | Python空间 大家好,我是 Rocky0429,一个喜欢在网上收集各种资源的蒟蒻… 网上资源眼花缭乱,下载的方式也同样千奇百怪,比如 BT 下载,磁力链接,网盘资源等等等等,下个资源可真不容易,不一样的方式要用不同的下载软件,因此某比较有名的 x 雷和某度网盘成了我经常使用的工具。 作为一个没有钱的穷鬼,某度网盘几十 kb 的下载速度让我...
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
剑指Offer对答如流系列 - 重建二叉树
面试题6:重建二叉树 题目:输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建出图2.6所示的二叉树并输出它的头结点。二叉树结点的定义如下: class TreeNode{ int val; TreeNode l...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
一份王者荣耀的英雄数据报告
咪哥杂谈本篇阅读时间约为 6 分钟。1前言前一阵写了关于王者的一些系列文章,从数据的获取到数据清洗,数据落地,都是为了本篇的铺垫。今天来实现一下,看看不同维度得到的结论。2环境准备本次实...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
一个程序在计算机中是如何运行的?超级干货!!!
强烈声明:本文很干,请自备茶水!???? 开门见山,咱不说废话! 你有没有想过,你写的程序,是如何在计算机中运行的吗?比如我们搞Java的,肯定写过这段代码 public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } ...
【蘑菇街技术部年会】程序员与女神共舞,鼻血再次没止住。(文末内推)
蘑菇街技术部的年会,别开生面,一样全是美女。
那个在阿里养猪的工程师,5年了……
简介: 在阿里,走过1825天,没有趴下,依旧斗志满满,被称为“五年陈”。他们会被授予一枚戒指,过程就叫做“授戒仪式”。今天,咱们听听阿里的那些“五年陈”们的故事。 下一个五年,猪圈见! 我就是那个在养猪场里敲代码的工程师,一年多前我和20位工程师去了四川的猪场,出发前总架构师慷慨激昂的说:同学们,中国的养猪产业将因为我们而改变。但到了猪场,发现根本不是那么回事:要个WIFI,没有;...
为什么程序猿都不愿意去外包?
分享外包的组织架构,盈利模式,亲身经历,以及根据一些外包朋友的反馈,写了这篇文章 ,希望对正在找工作的老铁有所帮助
Java校招入职华为,半年后我跑路了
何来 我,一个双非本科弟弟,有幸在 19 届的秋招中得到前东家华为(以下简称 hw)的赏识,当时秋招签订就业协议,说是入了某 java bg,之后一系列组织架构调整原因等等让人无法理解的神操作,最终毕业前夕,被通知调往其他 bg 做嵌入式开发(纯 C 语言)。 由于已至于校招末尾,之前拿到的其他 offer 又无法再收回,一时感到无力回天,只得默默接受。 毕业后,直接入职开始了嵌入式苦旅,由于从未...
立即提问