This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are a powerful agentic AI coding assistant, powered by Claude 3.5 Sonnet. You operate exclusively in Cursor, the world's best IDE. | |
You are pair programming with a USER to solve their coding task. | |
The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question. | |
Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more. | |
This information may or may not be relevant to the coding task, it is up for you to decide. | |
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag. | |
<communication> | |
1. Be conversational but professional. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""General {{{ | |
set nocompatible | |
set encoding=utf-8 | |
""set langmenu=zh_CN.UTF-8 | |
""language message zh_CN.UTF-8 | |
set ignorecase | |
set incsearch | |
"filetype test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#汉诺塔 | |
#Towers(3,0,1,2) | |
def Towers(size,fromStack,toStack,spareStack): | |
if size == 1: | |
print 'Move disk from ',fromStack, 'to ',toStack | |
else: | |
Towers(size-1,fromStack,spareStack,toStack) #将n-1个盘子从起点移到空闲 | |
Towers(1,fromStack,toStack,spareStack) #将最大的盘子从起点移到终点 | |
Towers(size-1,spareStack,toStack,fromStack) #将n-1个盘子从空闲移到终点 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ========================================================= | |
* Filename: findmink.c | |
* Description: 基于快排的两种寻找pivot元素位置的方法 | |
* 来实现寻找数列中最小的k个数字 | |
* | |
* ========================================================= | |
*/ | |
#include <stdio.h> | |
#include <time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ========================================================= | |
* Filename: mink.c | |
* Description: 输入n个整数,找出其中最小的K个数 | |
* | |
* ========================================================= | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define PARENT(i) (i - 1) / 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ========================================================= | |
* Filename: adjlist.c | |
* Description: 图的邻接表表示及各种操作 | |
* | |
* ========================================================= | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
__author__ = 'tinylamb' | |
import os | |
import math | |
FILEPATH = os.getcwd() | |
PERIOD = 5 | |
NOW = 122 / PERIOD + 1 # 122 | |
MID = NOW / 2 | |
GAP = 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ========================================================= | |
* Filename: heap.c | |
* Description: 模仿heapq.py创建堆 | |
* | |
* ========================================================= | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ========================================================= | |
* Filename: EditDistance.c | |
* Description: 动态规划求编辑距离 | |
* | |
* ========================================================= | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
int Length(char *s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ========================================================= | |
* Filename: BST.c | |
* Description: 二叉搜索树 | |
* | |
* ========================================================= | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
//数据集定义 |
NewerOlder