ld terminated with signal 11 [Segmentation fault]

有没有懂工具链的朋友?只要CPP里包括#include 就报
ld terminated with signal 11 [Segmentation fault], core dumped 的错误

cpp

1个回答

http://blog.csdn.net/ai2000ai/article/details/46519169
如果iostream都不行,就重装重配你的编译器

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
HPL make过程中出现ld terminated with signal 11
![图片说明](https://img-ask.csdn.net/upload/202001/20/1579471505_300997.png) 我尝试增加swap交换空间,但是还是一样报错
C语言MPI 出现 segmentation fault: 11
Primary job terminated normally, but 1 process returned a non-zero exit code. Per user-direction, the job has been aborted. mpirun noticed that process rank 0 with PID 0 on node dyn-118-139-43-116 exited on signal 11 (Segmentation fault: 11). C语言运行MPI的时候出现的,不知道怎么解决,求大神帮忙瞅瞅。 这个是什么情况呢? ``` #include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> #include <string.h> #include "mpi.h" int main(int argc, char** argv) { int iX,iY; const int iXmax = 8000; // default const int iYmax = 8000; // default double Cx, Cy; const double CxMin = -2.5; const double CxMax = 1.5; const double CyMin = -2.0; const double CyMax = 2.0; double PixelWidth = (CxMax - CxMin)/iXmax; double PixelHeight = (CyMax - CyMin)/iYmax; const int MaxColorComponentValue = 255; static unsigned char color[3]; double Zx, Zy; double Zx2, Zy2; /* Zx2 = Zx*Zx; Zy2 = Zy*Zy */ int Iteration; const int IterationMax = 2000; // default const double EscapeRadius = 400; double ER2 = EscapeRadius * EscapeRadius; unsigned char color_array[iYmax*iXmax*3]; //8000*8000*3 array clock_t start, end; double cpu_time_used; int my_rank, processors, rows_per_procs,tag=0; MPI_Status stat; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); MPI_Comm_size(MPI_COMM_WORLD, &processors); if(my_rank == 0){ printf("Computing Mandelbrot Set. Please wait...\n"); } start = clock(); if(my_rank == 0){ rows_per_procs = iYmax / processors; MPI_Bcast(& rows_per_procs, 1, MPI_INT, 0, MPI_COMM_WORLD); } else { int counter = 0; for(iY = rows_per_procs*my_rank; iY < rows_per_procs*(my_rank+1); iY++) { Cy = CyMin + (iY * PixelHeight); if (fabs(Cy) < (PixelHeight / 2)) { Cy = 0.0; /* Main antenna */ } for(iX = 0; iX < iXmax; iX++) { Cx = CxMin + (iX * PixelWidth); /* initial value of orbit = critical point Z= 0 */ Zx = 0.0; Zy = 0.0; Zx2 = Zx * Zx; Zy2 = Zy * Zy; /* */ for(Iteration = 0; Iteration < IterationMax && ((Zx2 + Zy2) < ER2); Iteration++) { Zy = (2 * Zx * Zy) + Cy; Zx = Zx2 - Zy2 + Cx; Zx2 = Zx * Zx; Zy2 = Zy * Zy; }; /* compute pixel color (24 bit = 3 bytes) */ if (Iteration == IterationMax) { // Point within the set. Mark it as black color[0] = 0; color[1] = 0; color[2] = 0; } else { // Point outside the set. Mark it as white double c = 3*log((double)Iteration)/log((double)(IterationMax) - 1.0); if (c < 1) { color[0] = 0; color[1] = 0; color[2] = 255*c; } else if (c < 2) { color[0] = 0; color[1] = 255*(c-1); color[2] = 255; } else { color[0] = 255*(c-2); color[1] = 255; color[2] = 255; } } color_array[counter*iX*3] = color[0]; color_array[counter*iX*3+1] = color[1]; color_array[counter*iX*3+2] = color[2]; } counter++; } } if(my_rank == 0) { //unsigned char color_array[iYmax*iXmax*3]; //8000*8000*3 array FILE * fp; char *filename = "Mandelbrot.ppm"; char *comment = "# "; /* comment should start with # */ fp = fopen(filename, "wb"); /* b - binary mode */ fprintf(fp,"P6\n %s\n %d\n %d\n %d\n", comment, iXmax, iYmax, MaxColorComponentValue); printf("File: %s successfully opened for writing.\n", filename); for(int i = 0; i<processors;i++) { MPI_Recv(color_array, rows_per_procs*iXmax*3,MPI_UNSIGNED_CHAR, i, tag, MPI_COMM_WORLD, &stat); } fwrite(color_array, 1, sizeof(color_array), fp); fclose(fp); printf("Completed Computing Mandelbrot Set.\n"); printf("File: %s successfully closed.\n", filename); } else { MPI_Send(color_array, sizeof(color_array),MPI_UNSIGNED_CHAR, 0, tag, MPI_COMM_WORLD); } // Get the clock current time again // Subtract end from start to get the CPU time used. end = clock(); cpu_time_used = ((double)(end - start)) / CLOCKS_PER_SEC; printf("%dMandelbrot computational process time: %lf\n", my_rank,cpu_time_used); MPI_Finalize(); return 0; } ```
UBUNTU启动不了(段错误)
安装的时候就报unable to find a medium containing a live file system的错误,试了很多方法都没解决,无奈将硬盘接到同事的电脑上并且安装成功,把硬盘重新接到自己的电脑上启动Ubuntu提示03i30【160】terminated by signal 11[segmentation fault]。主板是GA-H81M-DS2。
xshell 插入u盘就报错
root@atlas7-arm:/media/disk# [ 1507.634089] systemd-udevd[8893]: inotify_add_watch(6, /dev/sda, 10) failed: No such file or directory [ 1508.011484] systemd-udevd[8750]: inotify_add_watch(6, /dev/sda1, 10) failed: No such file or directory [ 1508.386449] systemd-udevd[8839]: '/usr/bin/mtpprobe ' [11848] terminated by signal 11 (Segmentation fault) [ 1580.636244] systemd-udevd[12005]: inotify_add_watch(6, /dev/sda, 10) failed: No such file or directory [ 1581.050256] systemd-udevd[11861]: inotify_add_watch(6, /dev/sda1, 10) failed: No such file or directory [ 1582.764703] systemd-udevd[12005]: inotify_add_watch(6, /dev/sda, 10) failed: No such file or directory [ 1583.156302] systemd-udevd[11861]: inotify_add_watch(6, /dev/sda1, 10) failed: No such file or directory [ 1584.884514] systemd-udevd[12005]: inotify_add_watch(6, /dev/sda, 10) failed: No such file or directory [ 1585.261268] systemd-udevd[11861]: inotify_add_watch(6, /dev/sda1, 10) failed: No such file or directory [ 1585.705340] systemd-udevd[11952]: '/usr/bin/mtpprobe ' [13196] terminated by signal 11 (Segmentation fault)
tensorflow 报错You must feed a value for placeholder tensor 'Placeholder_1' with dtype float and shape [?,32,32,3],但是怎么看数据都没错,请大神指点
调试googlenet的代码,总是报错 InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'Placeholder_1' with dtype float and shape [?,32,32,3],但是我怎么看喂的数据都没问题,请大神们指点 ``` # -*- coding: utf-8 -*- """ GoogleNet也被称为InceptionNet Created on Mon Feb 10 12:15:35 2020 @author: 月光下的云海 """ import tensorflow as tf from keras.datasets import cifar10 import numpy as np import tensorflow.contrib.slim as slim tf.reset_default_graph() tf.reset_default_graph() (x_train,y_train),(x_test,y_test) = cifar10.load_data() x_train = x_train.astype('float32') x_test = x_test.astype('float32') y_train = y_train.astype('int32') y_test = y_test.astype('int32') y_train = y_train.reshape(y_train.shape[0]) y_test = y_test.reshape(y_test.shape[0]) x_train = x_train/255 x_test = x_test/255 #************************************************ 构建inception ************************************************ #构建一个多分支的网络结构 #INPUTS: # d0_1:最左边的分支,分支0,大小为1*1的卷积核个数 # d1_1:左数第二个分支,分支1,大小为1*1的卷积核的个数 # d1_3:左数第二个分支,分支1,大小为3*3的卷积核的个数 # d2_1:左数第三个分支,分支2,大小为1*1的卷积核的个数 # d2_5:左数第三个分支,分支2,大小为5*5的卷积核的个数 # d3_1:左数第四个分支,分支3,大小为1*1的卷积核的个数 # scope:参数域名称 # reuse:是否重复使用 #*************************************************************************************************************** def inception(x,d0_1,d1_1,d1_3,d2_1,d2_5,d3_1,scope = 'inception',reuse = None): with tf.variable_scope(scope,reuse = reuse): #slim.conv2d,slim.max_pool2d的默认参数都放在了slim的参数域里面 with slim.arg_scope([slim.conv2d,slim.max_pool2d],stride = 1,padding = 'SAME'): #第一个分支 with tf.variable_scope('branch0'): branch_0 = slim.conv2d(x,d0_1,[1,1],scope = 'conv_1x1') #第二个分支 with tf.variable_scope('branch1'): branch_1 = slim.conv2d(x,d1_1,[1,1],scope = 'conv_1x1') branch_1 = slim.conv2d(branch_1,d1_3,[3,3],scope = 'conv_3x3') #第三个分支 with tf.variable_scope('branch2'): branch_2 = slim.conv2d(x,d2_1,[1,1],scope = 'conv_1x1') branch_2 = slim.conv2d(branch_2,d2_5,[5,5],scope = 'conv_5x5') #第四个分支 with tf.variable_scope('branch3'): branch_3 = slim.max_pool2d(x,[3,3],scope = 'max_pool') branch_3 = slim.conv2d(branch_3,d3_1,[1,1],scope = 'conv_1x1') #连接 net = tf.concat([branch_0,branch_1,branch_2,branch_3],axis = -1) return net #*************************************** 使用inception构建GoogleNet ********************************************* #使用inception构建GoogleNet #INPUTS: # inputs-----------输入 # num_classes------输出类别数目 # is_trainning-----batch_norm层是否使用训练模式,batch_norm和is_trainning密切相关 # 当is_trainning = True 时候,它使用一个batch数据的平均移动,方差值 # 当is_trainning = Flase时候,它就使用固定的值 # verbos-----------控制打印信息 # reuse------------是否重复使用 #*************************************************************************************************************** def googlenet(inputs,num_classes,reuse = None,is_trainning = None,verbose = False): with slim.arg_scope([slim.batch_norm],is_training = is_trainning): with slim.arg_scope([slim.conv2d,slim.max_pool2d,slim.avg_pool2d], padding = 'SAME',stride = 1): net = inputs #googlnet的第一个块 with tf.variable_scope('block1',reuse = reuse): net = slim.conv2d(net,64,[5,5],stride = 2,scope = 'conv_5x5') if verbose: print('block1 output:{}'.format(net.shape)) #googlenet的第二个块 with tf.variable_scope('block2',reuse = reuse): net = slim.conv2d(net,64,[1,1],scope = 'conv_1x1') net = slim.conv2d(net,192,[3,3],scope = 'conv_3x3') net = slim.max_pool2d(net,[3,3],stride = 2,scope = 'max_pool') if verbose: print('block2 output:{}'.format(net.shape)) #googlenet第三个块 with tf.variable_scope('block3',reuse = reuse): net = inception(net,64,96,128,16,32,32,scope = 'inception_1') net = inception(net,128,128,192,32,96,64,scope = 'inception_2') net = slim.max_pool2d(net,[3,3],stride = 2,scope = 'max_pool') if verbose: print('block3 output:{}'.format(net.shape)) #googlenet第四个块 with tf.variable_scope('block4',reuse = reuse): net = inception(net,192,96,208,16,48,64,scope = 'inception_1') net = inception(net,160,112,224,24,64,64,scope = 'inception_2') net = inception(net,128,128,256,24,64,64,scope = 'inception_3') net = inception(net,112,144,288,24,64,64,scope = 'inception_4') net = inception(net,256,160,320,32,128,128,scope = 'inception_5') net = slim.max_pool2d(net,[3,3],stride = 2,scope = 'max_pool') if verbose: print('block4 output:{}'.format(net.shape)) #googlenet第五个块 with tf.variable_scope('block5',reuse = reuse): net = inception(net,256,160,320,32,128,128,scope = 'inception1') net = inception(net,384,182,384,48,128,128,scope = 'inception2') net = slim.avg_pool2d(net,[2,2],stride = 2,scope = 'avg_pool') if verbose: print('block5 output:{}'.format(net.shape)) #最后一块 with tf.variable_scope('classification',reuse = reuse): net = slim.flatten(net) net = slim.fully_connected(net,num_classes,activation_fn = None,normalizer_fn = None,scope = 'logit') if verbose: print('classification output:{}'.format(net.shape)) return net #给卷积层设置默认的激活函数和batch_norm with slim.arg_scope([slim.conv2d],activation_fn = tf.nn.relu,normalizer_fn = slim.batch_norm) as sc: conv_scope = sc is_trainning_ph = tf.placeholder(tf.bool,name = 'is_trainning') #定义占位符 x_train_ph = tf.placeholder(shape = (None,x_train.shape[1],x_train.shape[2],x_train.shape[3]),dtype = tf.float32) x_test_ph = tf.placeholder(shape = (None,x_test.shape[1],x_test.shape[2],x_test.shape[3]),dtype = tf.float32) y_train_ph = tf.placeholder(shape = (None,),dtype = tf.int32) y_test_ph = tf.placeholder(shape = (None,),dtype = tf.int32) #实例化网络 with slim.arg_scope(conv_scope): train_out = googlenet(x_train_ph,10,is_trainning = is_trainning_ph,verbose = True) val_out = googlenet(x_test_ph,10,is_trainning = is_trainning_ph,reuse = True) #定义loss和acc with tf.variable_scope('loss'): train_loss = tf.losses.sparse_softmax_cross_entropy(labels = y_train_ph,logits = train_out,scope = 'train') val_loss = tf.losses.sparse_softmax_cross_entropy(labels = y_test_ph,logits = val_out,scope = 'val') with tf.name_scope('accurcay'): train_acc = tf.reduce_mean(tf.cast(tf.equal(tf.argmax(train_out,axis = -1,output_type = tf.int32),y_train_ph),tf.float32)) val_acc = tf.reduce_mean(tf.cast(tf.equal(tf.argmax(val_out,axis = -1,output_type = tf.int32),y_test_ph),tf.float32)) #定义训练op lr = 1e-2 opt = tf.train.MomentumOptimizer(lr,momentum = 0.9) #通过tf.get_collection获得所有需要更新的op update_op = tf.get_collection(tf.GraphKeys.UPDATE_OPS) #使用tesorflow控制流,先执行update_op再进行loss最小化 with tf.control_dependencies(update_op): train_op = opt.minimize(train_loss) #开启会话 sess = tf.Session() saver = tf.train.Saver() sess.run(tf.global_variables_initializer()) batch_size = 64 #开始训练 for e in range(10000): batch1 = np.random.randint(0,50000,size = batch_size) t_x_train = x_train[batch1][:][:][:] t_y_train = y_train[batch1] batch2 = np.random.randint(0,10000,size = batch_size) t_x_test = x_test[batch2][:][:][:] t_y_test = y_test[batch2] sess.run(train_op,feed_dict = {x_train_ph:t_x_train, is_trainning_ph:True, y_train_ph:t_y_train}) # if(e%1000 == 999): # loss_train,acc_train = sess.run([train_loss,train_acc], # feed_dict = {x_train_ph:t_x_train, # is_trainning_ph:True, # y_train_ph:t_y_train}) # loss_test,acc_test = sess.run([val_loss,val_acc], # feed_dict = {x_test_ph:t_x_test, # is_trainning_ph:False, # y_test_ph:t_y_test}) # print('STEP{}:train_loss:{:.6f} train_acc:{:.6f} test_loss:{:.6f} test_acc:{:.6f}' # .format(e+1,loss_train,acc_train,loss_test,acc_test)) saver.save(sess = sess,save_path = 'VGGModel\model.ckpt') print('Train Done!!') print('--'*60) sess.close() ``` 报错信息是 ``` Using TensorFlow backend. block1 output:(?, 16, 16, 64) block2 output:(?, 8, 8, 192) block3 output:(?, 4, 4, 480) block4 output:(?, 2, 2, 832) block5 output:(?, 1, 1, 1024) classification output:(?, 10) Traceback (most recent call last): File "<ipython-input-1-6385a760fe16>", line 1, in <module> runfile('F:/Project/TEMP/LearnTF/GoogleNet/GoogleNet.py', wdir='F:/Project/TEMP/LearnTF/GoogleNet') File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "F:/Project/TEMP/LearnTF/GoogleNet/GoogleNet.py", line 177, in <module> y_train_ph:t_y_train}) File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\tensorflow\python\client\session.py", line 900, in run run_metadata_ptr) File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\tensorflow\python\client\session.py", line 1135, in _run feed_dict_tensor, options, run_metadata) File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\tensorflow\python\client\session.py", line 1316, in _do_run run_metadata) File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\tensorflow\python\client\session.py", line 1335, in _do_call raise type(e)(node_def, op, message) InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder_1' with dtype float and shape [?,32,32,3] [[Node: Placeholder_1 = Placeholder[dtype=DT_FLOAT, shape=[?,32,32,3], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]] [[Node: gradients/block4/inception_4/concat_grad/ShapeN/_45 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_23694_gradients/block4/inception_4/concat_grad/ShapeN", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]] ``` 看了好多遍都不是喂数据的问题,百度说是summary出了问题,可是我也没有summary呀,头晕~~~~
Program terminated with status: 1. stderr follows
# Program terminated with status: 1. stderr follows: Error: C:\Users\AppData\Local\Temp\tmpx6oir6n9: syntax error in line 1 near ‘’ 大家好:我正在做吴恩达老师第四课第二周练习一:Keras - Tutorial - Happy House 碰到了一个奇怪的问题,找了很久都不知道原因,望大家能帮忙找出原因,在下不胜感激。 ## 代码:(最后一个cell) plot_model(happyModel,to_file=‘HappyModel.png’) SVG(model_to_dot(happyModel).create(prog=‘dot’, format=‘svg’)) ## **错误:** InvocationException Traceback (most recent call last) in 6 #plot_model(happyModel,to_file=‘HappyModel.png’) 7 #plot_model(happyModel,to_file=‘E:/software/python/Jupyter/COURSE 4 Convolutional Neural Networks/Week 02/KerasTutorial/HappyModel.png’) ----> 8 plot_model(happyModel,to_file=‘HappyModel.png’) 9 SVG(model_to_dot(happyModel).create(prog=‘dot’, format=‘svg’)) 10 #import os E:\software\Anaconda\lib\site-packages\keras\utils\vis_utils.py in plot_model(model, to_file, show_shapes, show_layer_names, rankdir, expand_nested, dpi) 238 “”" 239 dot = model_to_dot(model, show_shapes, show_layer_names, rankdir, –> 240 expand_nested, dpi) 241 _, extension = os.path.splitext(to_file) 242 if not extension: E:\software\Anaconda\lib\site-packages\keras\utils\vis_utils.py in model_to_dot(model, show_shapes, show_layer_names, rankdir, expand_nested, dpi, subgraph) 77 from …models import Sequential 78 —> 79 _check_pydot() 80 if subgraph: 81 dot = pydot.Cluster(style=‘dashed’, graph_name=model.name) E:\software\Anaconda\lib\site-packages\keras\utils\vis_utils.py in _check_pydot() 26 # Attempt to create an image of a blank graph 27 # to check the pydot/graphviz installation. —> 28 pydot.Dot.create(pydot.Dot()) 29 except OSError: 30 raise OSError( E:\software\Anaconda\lib\site-packages\pydot_ng_init_.py in create(self, prog, format) 1889 raise InvocationException( 1890 ‘Program terminated with status: %d. stderr follows: %s’ % ( -> 1891 status, stderr_output)) 1892 elif stderr_output: 1893 print(stderr_output) **InvocationException: Program terminated with status: 1. stderr follows: Error: C:\Users\AppData\Local\Temp\tmpx6oir6n9: syntax error in line 1 near ‘’**
unix系统调用getenv() 出core
在获取当地时间时, localtime调用到getenv函数出现core,,不是第一次调用的时候, 是在连续很快的调用情况下会出现core。 大家帮忙看看什么原因。 代码如下: struct tm* ts; ts = localtime(&now.tv_sec); if (ts == NULL) { printf("localtime : %d, %s\n", errno, strerror(errno)); return ; } core 信息如下: Program terminated with signal 11, Segmentation fault. SEGV_MAPERR - Address not mapped to object #0 0xc000000000338420:0 in getenv+0x1160 () from /usr/lib/hpux64/libc.so.1 (gdb) where #0 0xc000000000338420:0 in getenv+0x1160 () from /usr/lib/hpux64/libc.so.1 #1 0xc000000000333a50:0 in tzset+0x110 () from /usr/lib/hpux64/libc.so.1 #2 0xc000000000330510:0 in localtime_r+0x120 () from /usr/lib/hpux64/libc.so.1 #3 0xc0000000003301d0:0 in localtime+0x30 () from /usr/lib/hpux64/libc.so.1
Queue Sequence 队列的算法
Problem Description There's a queue obeying the first in first out rule. Each time you can either push a number into the queue (+i), or pop a number out from the queue (-i). After a series of operation, you get a sequence (e.g. +1 -1 +2 +4 -2 -4). We call this sequence a queue sequence. Now you are given a queue sequence and asked to perform several operations: 1. insert p First you should find the smallest positive number (e.g. i) that does not appear in the current queue sequence, then you are asked to insert the +i at position p (position starts from 0). For -i, insert it into the right most position that result in a valid queue sequence (i.e. when encountered with element -x, the front of the queue should be exactly x). For example, (+1 -1 +3 +4 -3 -4) would become (+1 +2 -1 +3 +4 -2 -3 -4) after operation 'insert 1'. 2. remove i Remove +i and -i from the sequence. For example, (+1 +2 -1 +3 +4 -2 -3 -4) would become (+1 +2 -1 +4 -2 -4) after operation 'remove 3'. 3. query i Output the sum of elements between +i and -i. For example, the result of query 1, query 2, query 4 in sequence (+1 +2 -1 +4 -2 -4) is 2, 3(obtained by -1 + 4), -2 correspond. Input There are less than 25 test cases. Each case begins with a number indicating the number of operations n (1 ≤ n ≤ 100000). The following n lines with be 'insert p', 'remove i' or 'query i'(0 ≤ p ≤ length (current sequence), 1 ≤ i, i is granted to be in the sequence). In each case, the sequence is empty initially. The input is terminated by EOF. Output Before each case, print a line "Case #d:" indicating the id of the test case. After each operation, output the sum of elements between +i and -i. Sample Input 10 insert 0 insert 1 query 1 query 2 insert 2 query 2 remove 1 remove 2 insert 2 query 3 6 insert 0 insert 0 remove 2 query 1 insert 1 query 2 Sample Output Case #1: 2 -1 2 0 Case #2: 0 -1
Queue Sequence 队列的顺序
Problem Description There's a queue obeying the first in first out rule. Each time you can either push a number into the queue (+i), or pop a number out from the queue (-i). After a series of operation, you get a sequence (e.g. +1 -1 +2 +4 -2 -4). We call this sequence a queue sequence. Now you are given a queue sequence and asked to perform several operations: 1. insert p First you should find the smallest positive number (e.g. i) that does not appear in the current queue sequence, then you are asked to insert the +i at position p (position starts from 0). For -i, insert it into the right most position that result in a valid queue sequence (i.e. when encountered with element -x, the front of the queue should be exactly x). For example, (+1 -1 +3 +4 -3 -4) would become (+1 +2 -1 +3 +4 -2 -3 -4) after operation 'insert 1'. 2. remove i Remove +i and -i from the sequence. For example, (+1 +2 -1 +3 +4 -2 -3 -4) would become (+1 +2 -1 +4 -2 -4) after operation 'remove 3'. 3. query i Output the sum of elements between +i and -i. For example, the result of query 1, query 2, query 4 in sequence (+1 +2 -1 +4 -2 -4) is 2, 3(obtained by -1 + 4), -2 correspond. Input There are less than 25 test cases. Each case begins with a number indicating the number of operations n (1 ≤ n ≤ 100000). The following n lines with be 'insert p', 'remove i' or 'query i'(0 ≤ p ≤ length (current sequence), 1 ≤ i, i is granted to be in the sequence). In each case, the sequence is empty initially. The input is terminated by EOF. Output Before each case, print a line "Case #d:" indicating the id of the test case. After each operation, output the sum of elements between +i and -i. Sample Input 10 insert 0 insert 1 query 1 query 2 insert 2 query 2 remove 1 remove 2 insert 2 query 3 6 insert 0 insert 0 remove 2 query 1 insert 1 query 2 Sample Output Case #1: 2 -1 2 0 Case #2: 0 -1
Queue Sequence 序列的问题
Problem Description There's a queue obeying the first in first out rule. Each time you can either push a number into the queue (+i), or pop a number out from the queue (-i). After a series of operation, you get a sequence (e.g. +1 -1 +2 +4 -2 -4). We call this sequence a queue sequence. Now you are given a queue sequence and asked to perform several operations: 1. insert p First you should find the smallest positive number (e.g. i) that does not appear in the current queue sequence, then you are asked to insert the +i at position p (position starts from 0). For -i, insert it into the right most position that result in a valid queue sequence (i.e. when encountered with element -x, the front of the queue should be exactly x). For example, (+1 -1 +3 +4 -3 -4) would become (+1 +2 -1 +3 +4 -2 -3 -4) after operation 'insert 1'. 2. remove i Remove +i and -i from the sequence. For example, (+1 +2 -1 +3 +4 -2 -3 -4) would become (+1 +2 -1 +4 -2 -4) after operation 'remove 3'. 3. query i Output the sum of elements between +i and -i. For example, the result of query 1, query 2, query 4 in sequence (+1 +2 -1 +4 -2 -4) is 2, 3(obtained by -1 + 4), -2 correspond. Input There are less than 25 test cases. Each case begins with a number indicating the number of operations n (1 ≤ n ≤ 100000). The following n lines with be 'insert p', 'remove i' or 'query i'(0 ≤ p ≤ length (current sequence), 1 ≤ i, i is granted to be in the sequence). In each case, the sequence is empty initially. The input is terminated by EOF. Output Before each case, print a line "Case #d:" indicating the id of the test case. After each operation, output the sum of elements between +i and -i. Sample Input 10 insert 0 insert 1 query 1 query 2 insert 2 query 2 remove 1 remove 2 insert 2 query 3 6 insert 0 insert 0 remove 2 query 1 insert 1 query 2 Sample Output Case #1: 2 -1 2 0 Case #2: 0 -1
Polly Nomials 程序怎么来写
Description The Avian Computation Mission of the International Ornithologists Union is dedicated to the study of intelligence in birds, and specifically the study of computational ability. One of the most promising projects so far is the "Polly Nomial" project on parrot intelligence, run by Dr. Albert B. Tross and his assistants, Clifford Swallow and Perry Keet. In the ACM, parrots are trained to carry out simple polynomial computations involving integers, variables, and simple arithmetic operators. When shown a formula consisting of a polynomial with non-negative integer coefficients and one variable x, each parrot uses a special beak-operated PDA, or "Parrot Digital Assistant," to tap out a sequence of operations for computing the polynomial. The PDA operates much like a calculator. It has keys marked with the following symbols: the digits from 0 through 9, the symbol 'x', and the operators '+','*', and '='. (The x key is internally associated with an integer constant by Al B. Tross for testing purposes, but the parrot sees only the 'x'.) For instance, if the parrot were presented with the polynomial x3 + x + 11 the parrot might tap the following sequence of symbols: x, *, x, *, x, +, x, +, 1, 1, = The PDA has no extra memory, so each * or + operation is applied to the previous contents of the display and whatever succeeding operand is entered. If the polynomial had been x3 + 2x2 + 11 then the parrot would not have been able to \save" the value of x3 while calculating the value of 2x2.Instead, a different order of operations would be needed, for instance: x, +, 2, *, x, *, x, +, 1, 1, = The cost of a calculation is the number of key presses. The cost of computing x3+x+11 in the example above is 11 (four presses of the x key, two presses of '*', two presses of '+', two presses of the digit '1',and the '=' key). It so happens that this is the minimal cost for this particular expression using the PDA. You are to write a program that finds the least costly way for a parrot to compute a number of polynomial expressions. Because parrots are, after all, just bird-brains, they are intimidated by polynomials whose high-order coefficient is any value except 1, so this condition is always imposed. Input Input consists of a sequence of lines, each containing a polynomial and an x value. Each polynomial anxn+an-1xn-1+...+a0 is represented by its degree followed by the non-negative coefficients an , ... , a0 of decreasing powers of x, where an is always 1. Degrees are between 1 and 100. The coefficients are followed on the same line by an integer value for the variable x, which is always either 1 or -1. The input is terminated by a single line containing the values 0 0. Output For each polynomial, print the polynomial number followed by the value of the polynomial at the given integer value x and the minimum cost of computing the polynomial; imitate the formatting in the sample output. Sample Input 3 1 0 1 11 1 3 1 0 2 11 -1 0 0 Sample Output Polynomial 1: 13 11 Polynomial 2: 8 11
String Equations 字符串等式
Problem Description We all understand equations such as: 3 + 8 = 4 + 7 But what happens if we look at equations with strings instead of numbers? What would addition and equality mean? Given two strings x and y, we define x + y to be the concatenation of the two strings. We also define x = y to mean that x is an anagram of y. That is, the characters in x can be permuted to form y. You are given n distinct nonempty strings, each containing at most 10 lowercase characters. You may also assume that at most 10 distinct characters appear in all the strings. You need to determine if you can choose strings to put on both sides of an equation such that the "sums" on each side are "equal" (by our definitions above). You may use each string on either side 0 or more times, but no string may be used on both sides. Input The input consists of a number of cases. Each case starts with a line containing the integer n (2 <= n <= 100). The next n lines contain the n strings. The input is terminated with n = 0. Output For each case, print either "yes" or "no" on one line indicating whether it is possible to form an equation as described above. If it is possible, print on each of the next n lines how many times each string is used, with the strings listed in the same order as the input. On each line, print the string, followed by a space, followed by the letter "L", "R", or "N" indicating whether the string appears on the left side, the right side, or neither side in the equation. Finally, this is followed by a space and an integer indicating how many times the string appears in the equation. Each numeric output should fit in a 64-bit integer. If there are multiple solutions, any solution is acceptable. Sample Input 2 hello world 7 i am lord voldemort tom marvolo riddle 0 Sample Output no yes i L 1 am L 1 lord L 1 voldemort L 1 tom R 1 marvolo R 1 riddle R 1
str2int 字符串转换的问题
Problem Description In this problem, you are given several strings that contain only digits from '0' to '9', inclusive. An example is shown below. 101 123 The set S of strings is consists of the N strings given in the input file, and all the possible substrings of each one of them. It's boring to manipulate strings, so you decide to convert strings in S into integers. You can convert a string that contains only digits into a decimal integer, for example, you can convert "101" into 101, "01" into 1, et al. If an integer occurs multiple times, you only keep one of them. For example, in the example shown above, all the integers are 1, 10, 101, 2, 3, 12, 23, 123. Your task is to calculate the remainder of the sum of all the integers you get divided by 2012. Input There are no more than 20 test cases. The test case starts by a line contains an positive integer N. Next N lines each contains a string consists of one or more digits. It's guaranteed that 1≤N≤10000 and the sum of the length of all the strings ≤100000. The input is terminated by EOF. Output An integer between 0 and 2011, inclusive, for each test case. Sample Input 5 101 123 09 000 1234567890 Sample Output 202
Eloh 用什么办法编写
Problem Description In 3201, The humans have conquered the whole universe. During the conquest ,we found lots of magical phenomena overthrown our previous cognition. For example, the Eloh is a hole like the black hole but has its own property. And if something is around the Eloh, there is a force between them, named “EF”(Eloh Force). Every Eloh has a circle area around it, and the Eloh is the center of the circle area. The circle is called “EFL” (Eloh Force Line). If there is a thing that has the mass(m) and the volume(v), the EF will satisfy the following properties:   1. In the EFL, EF = v / m and the force performs as the gravitational force.   2. Out the EFL, EF = m / v and the force performs as the repulsion force    One day, Farmer John was grazing his robot cows in the universe. The number of cows is N and every cow has its own mass(mi) and volume(vi). Suddenly, he encountered such an Eloh. At first he and his cows are in the EFL. Sadly, the Eloh is swept away some of his cows that stressed the most powerful EF from the Eloh. In other words, sort all the cows’EF from large to small and choose some cows from the front to the back. Luckily, he and the rest of cows escaped to the external of the EFL. To leave the Eloh quickly, he put the reminding cows packaged as a connecting body, i.e, the overall performance of the mass M = sum(mi) (the cow[i] is not swept by the Eloh) and the volume V = sum(vi) (like the previous). Because of the panic, he don’t know exactly how many cows were swept away, just know that not all been swept away, nor is the zero. As a magical uncle grazing in the universe, Farmer John can create a wormhole through the Eloh center and the outside world. Farmer John can exchange some pair of the cows(pick some cows in the Eloh and choose the same number of cows outside the cave). The connecting body’s M and V will calculator again after exchanging. Now, Farmer John would like to know when how many cows were swept away in the beginning, there is an exchange scheme can make his EF bigger. To ensure that no two cows have the same density(m/v). Input There are multiple test cases. The first line of the case contains a number N(0 < N <= 200000) The following N lines, each of two number mi and vi.(0 < mi,vi <= 100000), the sequence will be in density ascending order. The input is terminated by a line containing 0. Output For each case of input, the output should consist of one line giving the number Q of the exchange schemes, following Q lines that contain a number K meaning if in the beginning, there are K cows swept away, Farmer John can find an exchange program to help him. Of course, you should output them from small to big. Sample Input 5 1 3 3 8 4 10 1 2 5 9 0 Sample Output 2 1 2
REDIES异常终止,大神可否指点一二
REDIS异常日志如下: 5389:M 03 Jun 08:15:45.564 * Background saving started by pid 27834 5389:M 03 Jun 11:11:26.573 # Background saving terminated by signal 9 5389:M 03 Jun 11:11:27.042 * 1 changes in 900 seconds. Saving... 5389:M 03 Jun 11:11:29.635 * Background saving started by pid 1929 5389:M 03 Jun 11:29:05.541 # Background saving terminated by signal 9 5389:M 03 Jun 11:29:05.689 * 1 changes in 900 seconds. Saving... 5389:M 03 Jun 11:29:08.293 * Background saving started by pid 2613 5389:M 03 Jun 11:31:33.365 # Background saving terminated by signal 9 5389:M 03 Jun 11:31:33.521 * 1 changes in 900 seconds. Saving... 5389:M 03 Jun 11:31:36.128 * Background saving started by pid 2699 5389:M 03 Jun 11:31:48.191 # Background saving terminated by signal 9 5389:M 03 Jun 11:31:48.303 * 1 changes in 900 seconds. Saving... 5389:M 03 Jun 11:31:50.893 * Background saving started by pid 2700 5389:M 03 Jun 11:32:04.061 # Background saving terminated by signal 9 5389:M 03 Jun 11:32:04.167 * 1 changes in 900 seconds. Saving... 5389:M 03 Jun 11:32:06.780 * Background saving started by pid 2726 5389:M 03 Jun 11:48:51.552 # Background saving terminated by signal 9 5389:M 03 Jun 11:48:51.725 * 1 changes in 900 seconds. Saving... 5389:M 03 Jun 11:48:54.324 * Background saving started by pid 3345 5389:M 03 Jun 11:49:19.028 # Background saving terminated by signal 9 5389:M 03 Jun 11:49:19.141 * 1 changes in 900 seconds. Saving...
Paint Mix 问题的一个计算
Description You are given two large pails. One of them (known as the black pail) contains B gallons of black paint. The other one (known as the white pail) contains W gallons of white paint. You will go through a number of iterations of pouring paint first from the black pail into the white pail, then from the white pail into the black pail. More specifically, in each iteration you first pour C cups of paint from the black pail into the white pail (and thoroughly mix the paint in the white pail), then pour C cups of paint from the white pail back into the black pail (and thoroughly mix the paint in the black pail). B, W, and C are positive integers; each of B and W is less than or equal to 50, and C < 16 * B (recall that 1 gallon equals 16 cups). The white pail's capacity is at least B+W. As you perform many successive iterations, the ratio of black paint to white paint in each pail will approach B/W. Although these ratios will never actually be equal to B/W one can ask: how many iterations are needed to make sure that the black-to-white paint ratio in each of the two pails differs from B/W by less than a certain tolerance. We define the tolerance to be 0.00001. Input The input consists of a number of lines. Each line contains input for one instance of the problem: three positive integers representing the values for B, W, and C, as described above. The input is terminated with a line where B = W = C = 0. Output Print one line of output for each instance. Each line of output will contain one positive integer: the smallest number of iterations required such that the black-to-white paint ratio in each of the two pails differs from B/W by less than the tolerance value. Sample Input 2 1 1 2 1 4 3 20 7 0 0 0 Sample Output 145 38 66
Team Arrangement 安排的问题
Problem Description Barry Bennett, the coach of the Bings football team, wants to arrange his team for an important match against the Bangs. He decides on the formation he wants to play, for example 4-4-2, meaning that there will be four defenders, four midfielders, and two strikers (and of course, one goalkeeper). Your task is to determine the players who will play. For each available player, we know his role (e.g. midfielder). For each role, the players are selected in ascending order of their numbers. When the players are selected, you must determine the captain too, who is the player with the longest record in the team play. In case two players have the same record, the one with bigger number is chosen. Note that the captain is chosen among the players that are selected in the arrange. Input The input consists of multiple test cases. The first 22 lines of each test case contain the data for the 22 available players in this format: number name role year1–year'1 year2–year'2 ... number is the player number (unique positive integer less than 100). name is a string of at most 20 letters. role is a single character among G, D, M, S, for goalkeeper, defender, midfielder, and striker respectively. Each yeari –year'i pair (yeari ≤ year'i) shows the player has been a member of the team between the specified years (inclusive). The years are in four-digit format. There is at least one and at most 20 such pairs, and the same year is not repeated more than once in the list. There is a 23rd line describing the desired formation, like 4-4-2 in that format. Note that there are only three numbers in the formation (so, 4-3-2-1 is not valid), none of them is zero, and their sum is always 10. The input is terminated by a line containing a single 0. Output For each test case, output a list of 11 players chosen in the arrange. Each line must contain the player number, his name and his role, separated by single blank characters. The players must be sorted according to their role, in the order of goalkeeper, defenders, midfielders, and strikers. The players with the same role are sorted according to ascending order of their numbers. There is an exception that the captain always comes as the first player in the entire list. If it is not possible to arrange the team conforming to the desired formation, write a single line containing IMPOSSIBLE TO ARRANGE in the output. There should be a blank line after the output for each test case. Sample Input 9 PlayerA M 2000-2001 2003-2006 2 PlayerB M 2004-2006 10 PlayerC D 2001-2005 1 PlayerD D 2000-2001 2002-2004 11 PlayerE S 2003-2006 8 PlayerF M 2005-2006 22 PlayerG S 2005-2006 25 PlayerH G 2000-2001 2002-2003 2005-2006 6 PlayerI D 2003-2006 26 PlayerJ D 2003-2004 2000-2001 18 PlayerK M 2003-2004 19 PlayerL M 2000-2001 2003-2006 7 PlayerM S 2003-2006 1999-2001 21 PlayerN S 2003-2006 13 PlayerO S 2005-2006 15 PlayerP G 2001-2006 14 PlayerQ D 2003-2004 5 PlayerR S 2000-2005 20 PlayerS G 2000-2002 2003-2003 12 PlayerT M 2004-2005 3 PlayerU D 2000-2005 4 PlayerV M 2001-2004 4-4-2 0 Sample Output 7 PlayerM S 15 PlayerP G 1 PlayerD D 3 PlayerU D 6 PlayerI D 10 PlayerC D 2 PlayerB M 4 PlayerV M 8 PlayerF M 9 PlayerA M 5 PlayerR S
Kadj Squares 几何的问题
Problem Description In this problem, you are given a sequence S1, S2, ..., Sn of squares of different sizes. The sides of the squares are integer numbers. We locate the squares on the positive x-y quarter of the plane, such that their sides make 45 degrees with x and y axes, and one of their vertices are on y=0 line. Let bi be the x coordinates of the bottom vertex of Si. First, put S1 such that its left vertex lies on x=0. Then, put S1, (i > 1) at minimum bi such that bi > bi-1 and the interior of Si does not have intersection with the interior of S1...Si-1. The goal is to find which squares are visible, either entirely or partially, when viewed from above. In the example above, the squares S1, S2, and S4 have this property. More formally, Si is visible from above if it contains a point p, such that no square other than Si intersect the vertical half-line drawn from p upwards. Input The input consists of multiple test cases. The first line of each test case is n (1 ≤ n ≤ 50), the number of squares. The second line contains n integers between 1 to 30, where the ith number is the length of the sides of Si. The input is terminated by a line containing a zero number. Output For each test case, output a single line containing the index of the visible squares in the input sequence, in ascending order, separated by blank characters. Sample Input 4 3 5 1 4 3 2 1 2 0 Sample Output 1 2 4 1 3
Hot Expo 的编写
Problem Description Sunny wants to go to the Shanghai Expo this month and he intends to visit n (1 <= n <= 100 ) country pavilions. As we all know, in each pavilion, there is always a wonderful performance every day. Every performance will always be played only one time each day. And performance i begins at beg[i] second and ends at end[i] second (0<=beg[i], end[i] <24 * 3600). Sunny can not visit more than one country pavilion at the same time. Sunny wouldn't like to miss any performance in the country pavilions that he plans to visit. However, it's also well known that getting accommodation in Shanghai is a little expensive, so he has to make a good arrangement to make his staying time (in days) there minimum. Input The input contains several test cases. Each test case begins with an integer number n. Then n lines follow and each contains two integers representing the begin time and end time of the performance in the corresponding day. Input is terminated by a value of zero (0) for n. Output Output the minimum days that Sunny should spend in visiting in a seperated line for each test case. Sample Input 2 1 4 4 5 2 2 3 4 6 0 Sample Output 2 1
130 个相见恨晚的超实用网站,一次性分享出来
相见恨晚的超实用网站 持续更新中。。。
我花了一夜用数据结构给女朋友写个H5走迷宫游戏
起因 又到深夜了,我按照以往在csdn和公众号写着数据结构!这占用了我大量的时间!我的超越妹妹严重缺乏陪伴而 怨气满满! 而女朋友时常埋怨,认为数据结构这么抽象难懂的东西没啥作用,常会问道:天天写这玩意,有啥作用。而我答道:能干事情多了,比如写个迷宫小游戏啥的! 当我码完字准备睡觉时:写不好别睡觉! 分析 如果用数据结构与算法造出东西来呢? ...
对计算机专业来说学历真的重要吗?
我本科学校是渣渣二本,研究生学校是985,现在毕业五年,校招笔试、面试,社招面试参加了两年了,就我个人的经历来说下这个问题。 这篇文章很长,但绝对是精华,相信我,读完以后,你会知道学历不好的解决方案,记得帮我点赞哦。 先说结论,无论赞不赞同,它本质就是这样:对于技术类工作而言,学历五年以内非常重要,但有办法弥补。五年以后,不重要。 目录: 张雪峰讲述的事实 我看到的事实 为什么会这样 ...
字节跳动视频编解码面经
三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时想着能进去就不错了,管他哪个岗呢,就同意了面试...
win10系统安装教程(U盘PE+UEFI安装)
一、准备工作 u盘,电脑一台,win10原版镜像(msdn官网) 二、下载wepe工具箱 极力推荐微pe(微pe官方下载) 下载64位的win10 pe,使用工具箱制作启动U盘打开软件, 选择安装到U盘(按照操作无需更改) 三、重启进入pe系统 1、关机后,将U盘插入电脑 2、按下电源后,按住F12进入启动项选择(技嘉主板是F12) 选择需要启...
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch, ...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小人工智障。 思路可以运用在不同地方,主要介绍的是思路。
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
Ol4网格生成以及优化
概述 先描述一下大致场景:以0.05为单元格大小生成网格,并在地图上绘制,绘制的时候需要区分海陆。本文以此需求为契机,简单描述一下该需求的实现以及如何来优化。 效果 实现 优化前 var source = new ol.source.Vector({ features: [] }); var vector = new ol.layer.Vector({ source...
11月19日科技资讯|华为明日发布鸿蒙整体战略;京东宣告全面向技术转型;Kotlin 1.3.60 发布
「极客头条」—— 技术人员的新闻圈! CSDN 的读者朋友们早上好哇,「极客头条」来啦,快来看今天都有哪些值得我们技术人关注的重要新闻吧。扫描上方二维码进入 CSDN App 可以收听御姐萌妹 Style 的人工版音频哟。 一分钟速览新闻点! 6G 专家组成员:速率是 5G 的 10 至 100 倍,预计 2030 年商用 雷军:很多人多次劝我放弃WPS,能坚持下来并不是纯粹的商业决定 ...
C语言魔塔游戏
很早就很想写这个,今天终于写完了。 游戏截图: 编译环境: VS2017 游戏需要一些图片,如果有想要的或者对游戏有什么看法的可以加我的QQ 2985486630 讨论,如果暂时没有回应,可以在博客下方留言,到时候我会看到。 下面我来介绍一下游戏的主要功能和实现方式 首先是玩家的定义,使用结构体,这个名字是可以自己改变的 struct gamerole { char n...
iOS Bug 太多,苹果终于坐不住了!
开源的 Android 和闭源的 iOS,作为用户的你,更偏向哪一个呢? 整理 | 屠敏 出品 | CSDN(ID:CSDNnews) 毋庸置疑,当前移动设备操作系统市场中,Android 和 iOS 作为两大阵营,在相互竞争的同时不断演进。不过一直以来,开源的 Android 吸引了无数的手机厂商涌入其中,为其生态带来了百花齐放的盛景,但和神秘且闭源的 iOS 系统相比,不少网友...
Python语言高频重点汇总
Python语言高频重点汇总 GitHub面试宝典仓库 回到首页 目录: Python语言高频重点汇总 目录: 1. 函数-传参 2. 元类 3. @staticmethod和@classmethod两个装饰器 4. 类属性和实例属性 5. Python的自省 6. 列表、集合、字典推导式 7. Python中单下划线和双下划线 8. 格式化字符串中的%和format 9. 迭代器和生成器 10...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip installselenium -ihttps://pypi.tuna.tsinghua.edu.cn/simple/ ...
程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
程序员该看的几部电影
1、骇客帝国(1999) 概念:在线/离线,递归,循环,矩阵等 剧情简介: 不久的将来,网络黑客尼奥对这个看似正常的现实世界产生了怀疑。 他结识了黑客崔妮蒂,并见到了黑客组织的首领墨菲斯。 墨菲斯告诉他,现实世界其实是由一个名叫“母体”的计算机人工智能系统控制,人们就像他们饲养的动物,没有自由和思想,而尼奥就是能够拯救人类的救世主。 可是,救赎之路从来都不会一帆风顺,到底哪里才是真实的世界?如何...
蓝桥杯知识点汇总:基础知识和常用算法
文章目录基础语法部分:算法竞赛常用API:算法部分数据结构部分 此系列包含蓝桥杯绝大部分所考察的知识点,以及真题题解~ 基础语法部分: 备战蓝桥杯java(一):一般输入输出 和 快速输入输(BufferedReader&amp;BufferedWrite) 备战蓝桥杯java(二):java编程规范和常用数据类型 备战蓝桥杯java(三):常用功能符以及循环结构和分支结构 备战蓝桥杯java(四...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东...
@程序员,如何花式构建线程?
作者 |曾建责编 | 郭芮出品 | CSDN(ID:CSDNnews)在项目和业务的开发中,我们难免要经常使用线程来进行业务处理,使用线程可以保证我们的业务在相互处理之间可以保证原子性...
破14亿,Python分析我国存在哪些人口危机!
一、背景 二、爬取数据 三、数据分析 1、总人口 2、男女人口比例 3、人口城镇化 4、人口增长率 5、人口老化(抚养比) 6、各省人口 7、世界人口 四、遇到的问题 遇到的问题 1、数据分页,需要获取从1949-2018年数据,观察到有近20年参数:LAST20,由此推测获取近70年的参数可设置为:LAST70 2、2019年数据没有放上去,可以手动添加上去 3、将数据进行 行列转换 4、列名...
实现简单的轮播图(单张图片、多张图片)
前言 刚学js没多久,这篇博客就当做记录了,以后还会完善的,希望大佬们多多指点。ps:下面出现的都是直接闪动,没有滑动效果的轮播图。 单张图片的替换 · ...
强烈推荐10本程序员在家读的书
很遗憾,这个春节注定是刻骨铭心的,新型冠状病毒让每个人的神经都是紧绷的。那些处在武汉的白衣天使们,尤其值得我们的尊敬。而我们这些窝在家里的程序员,能不外出就不外出,就是对社会做出的最大的贡献。 有些读者私下问我,窝了几天,有点颓丧,能否推荐几本书在家里看看。我花了一天的时间,挑选了 10 本我最喜欢的书,你可以挑选感兴趣的来读一读。读书不仅可以平复恐惧的压力,还可以对未来充满希望,毕竟苦难终将会...
Linux自学篇——linux命令英文全称及解释
man: Manual 意思是手册,可以用这个命令查询其他命令的用法。 pwd:Print working directory 意思是密码。 su:Swith user 切换用户,切换到root用户 cd:Change directory 切换目录 ls:List files 列出目录下的文件 ps:Process Status 进程状态 mkdir:Make directory ...
Python实战:抓肺炎疫情实时数据,画2019-nCoV疫情地图
今天,群里白垩老师问如何用python画武汉肺炎疫情地图。白垩老师是研究海洋生态与地球生物的学者,国家重点实验室成员,于不惑之年学习python,实为我等学习楷模。先前我并没有关注武汉肺炎的具体数据,也没有画过类似的数据分布图。于是就拿了两个小时,专门研究了一下,遂成此文。
疫情数据接口api
返回json示例 { "errcode":0,//0标识接口正常 "data":{ "date":"2020-01-30 07:47:23",//实时更新时间 "diagnosed":7736,//确诊人数 "suspect":12167,//疑是病例人数 "death":170,//死亡人数 "cur...
相关热词 c# 为空 判断 委托 c#记事本颜色 c# 系统默认声音 js中调用c#方法参数 c#引入dll文件报错 c#根据名称实例化 c#从邮件服务器获取邮件 c# 保存文件夹 c#代码打包引用 c# 压缩效率
立即提问