Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
(移至...)
首頁
密碼學
程式設計Programming
APP
計算機概論
▼
2024年7月26日 星期五
C++Floyd Warshall解Leetcode 1334 Find the City With the Smallest Number ...
C++Floyd Warshall解Leetcode 1334 Find the City With the Smallest Number of Neighbors at a Threshold
由於每對 (i, j) 都有許多最短路徑需要計算,採用 Floyd-Warshall 演算法比較划算。
---
2024年7月24日 星期三
Python C++速解排序問題Leetcode 2191 Sort the Jumbled Numbers
今日Leetcode的排序問題2191. Sort the Jumbled Numbers,主要有兩個部份,一個是把數字轉成另一個數字,用int就行,採Least Significant Digit First。然後排序,不建議用自訂Lambda,跑能過但非常慢;更不建議自製車輪去排序。比較快的方式是sort ((mapping(x), index),然後再從排序後的資料中取得 x
[Python code請進]
‹
›
首頁
查看網路版