5.2
handwritten pile
Luogu p3378
1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <algorithm> 5 using namespace std; 6 const int maxn = 2e6 + 5; 7 8 int heap[maxn],heap_size,n; 9 10 void put(int x) 11 { 12 int now,nxt; 13 heap[++heap_size] = x; 14 now = heap_size; 15 while (now > 1) 16 { 17 nxt = now >> 1; 18 if (heap[now] >= heap[nxt]) return; 19 swap(heap[now],heap[nxt]); 20 now = nxt; 21 } 22 } 23 24 void del() 25 { 26 int now,nxt,res = heap[1]; 27 heap[1] = heap[heap_size];heap_size--; 28 now = 1; 29 while (now*2 <= heap_size) 30 { 31 nxt = now * 2; 32 if (nxt <= heap_size && heap[nxt + 1] < heap[nxt]) nxt++; 33 if (heap[now] <= heap[nxt]) return; 34 swap(heap[now],heap[nxt]); 35 now = nxt; 36 } 37 return; 38 } 39 40 int get() {return heap[1];} 41 42 int main() 43 { 44 scanf("%d",&n); 45 int cmd,x; 46 heap_size = 0; 47 for (int i = 1;i <= n;i++) 48 { 49 scanf("%d",&cmd); 50 if (cmd == 1) 51 { 52 scanf("%d",&x); 53 put(x); 54 } 55 else if (cmd == 2) printf ("%d\n",get()); 56 else del(); 57 } 58 return 0; 59 }
5.3
The trajectory of life has changed qaqaq
5.4
It's going to be cold again... The cold without preparation always seems to be more uncomfortable than the cold with preparation. Some qaqaq
-------- faint secant line-----
Okay, I dumped the pot on the face to the wifi downstairs that KFC is in a hurry
Determine the direction of the 3D image by the tag of the dicom image
5.5
Li Xia
py processes dicom, simply read in and display. I found that the picture displayed by python has a little color effect, which is better than matlab's qwq
1 import numpy as np 2 import pdb 3 import dicom 4 import os 5 import scipy.ndimage 6 import pylab 7 from skimage import measure 8 9 dcm = dicom.read_file('test.dcm') 10 print (dcm.dir("pat")) 11 12 data_element = dcm.data_element("PatientsName") 13 print (data_element.VR,data_element.value) 14 15 pixel_bytes = dcm.PixelData 16 17 pix = dcm.pixel_array 18 print (pix) 19 20 pylab.imshow(dcm.pixel_array,cmap = pylab.cm.bone) 21 pylab.show()
5.6
EM Algorithm and Image Segmentation
EM algorithm does not understand mathematics qaqqaqaq
5.7
Common medical image processing
5.8
In the process of processing, we need to find the convex hull... qaqaq It turns out that this is also ready-made