一些鬼題(day2上)

2021-08-10 01:22:28 字數 982 閱讀 6592

t1

dp從矮的跳向高的價值一定最小

然後排序,dp

dp[i][j],跳了i個樓,前乙個樓是j

列舉前乙個樓

列舉跳到那個樓,轉移一下

找小於的t的

#include

#include

#include

#include

#include

#include

using

namespace

std;

#include

int n,t;

int dp[51][51];

struct st

for(int i=n;i>=0;i--)

for(int j=1;j<=n;j++)

if(dp[i][j]<=t)

}

t2

b1,b2已知

列舉b3,由b3求出a1,a2,a3

推出a4,再推a5。。。。

#include

#include

#include

#include

#include

#include

using

namespace

std;

int n,m,vis[99999],a[99999],b[99999],tot,ans[399][999];

inline

void dfs(int x)

if(!t&&xreturn;

a[x]=b[t]-a[1];

for(int i=2;i<=x-1;i++)

if(x==n)

dfs(x+1);

}int main()

printf("%d\n",tot);

for(int i=1;i<=tot;i++)

}

有一些題(day2下)

t1 有一段括號序列,將乙個括號修改一次需要1的代價 將左括 號變成右括號或者相反 求最小代價使得括號序列合法。簡單的模擬題。include include char s 110000 int ans,l int main t2 兩個質數之間如果沒有其他質數,那麼則稱為相 鄰的質數。給定n,k,詢問...

一些變數常量的使用 day2

1.usr bin env puthon 讓python成為乙個可執行的程式 2.print hello word 輸出字串 hello word 是我接觸python後所執行的第一條 充滿了儀式感!3.python裡面的設定 檔案和 模板 python script 可以更改初始模板 4.name...

Leetcode刷題之旅(Day2)

給出兩個 非空 的鍊錶用來表示兩個非負的整數。其中,它們各自的位數是按照 逆序 的方式儲存的,並且它們的每個節點只能儲存 一位 數字。如果,我們將這兩個數相加起來,則會返回乙個新的鍊錶來表示它們的和。您可以假設除了數字 0 之外,這兩個數都不會以 0 開頭。示例 輸入 2 4 3 5 6 4 輸出 ...