Skip to content

Instantly share code, notes, and snippets.

View G36maid's full-sized avatar
🇹🇼

G36maid G36maid

🇹🇼
View GitHub Profile
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
typedef struct node{
int64_t Udata,Tdata;
Node * next;
}Node;
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#define MAX_LINE_LENGTH 256
typedef unsigned char uch;
#pragma pack(2)
typedef struct BmpFileHeader {
#include<stdio.h>
#include<stdint.h>
#include<stdlib.h>
void swap(int *p1,int *p2){
int temp;
temp=*p1;
*p1=*p2;
*p2=temp;
}
#include <stdio.h>
#include <stdlib.h>
#define MAX_SET_NUM 200005
typedef struct {
int *array;
int *attack;
int size;
int capacity;
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
typedef struct {
long long *health;
long long *attack;
long long *index;
long long Total_Atk;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
int8_t Z1[2000006],Z2[2000006];
void getZarr(char* str, int8_t Z[]);
void search(char* text, char* pattern,int8_t re)
double get_cpu_usage(int pid) {
char filename[30];
sprintf(filename, "/proc/%d/stat", pid);
FILE* file = fopen(filename, "r");
if (file == NULL) {
printf("Failed to open file: %s\n", filename);
return -1;
}
// 讀取文件中的第一行
miku@DESKTOP-HLSSCVT:~$ cd Final
miku@DESKTOP-HLSSCVT:~/Final$ cd P3
miku@DESKTOP-HLSSCVT:~/Final/P3$ ls
a.out fin03.c linuxlist.h makefile schedule.c schedule.h
miku@DESKTOP-HLSSCVT:~/Final/P3$ make
gcc fin03.c schedule.c -lm -o fin03
In file included from schedule.h:4,
from schedule.c:5:
linuxlist.h:99: warning: "offsetof" redefined
99 | #define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
108
109
110
111
int N, M;
int maze [MAX_N] [MAX_M];
int dis [MAX_N][MAX_M];
112
int dijkstra(int sx, int sy, int tx, int ty)
1130 {
@G36maid
G36maid / vimrc
Created September 21, 2023 17:28
"################### Magic vimrc ###################
" ctrl+n Enable/disable mouse
" ctrl+b Switch to text/binary
" ctrl+j To utf-8 file
" ctrl+t Convert tab to spaces
" ctrl+l Toggle line breaking
" ctrl+f Switch to full/simple
"#######################################################
set nocompatible