各位在剛剛算法班的課堂上,應該都透過講師大大體驗到 sl
(Steam Locomotive) 的魅力了,相信大家都認為它是個好東西,
不過大家只看到在 Linux 上能享受 sl
,想必身為 Windows 使用者的你一定很不是滋味吧!
在這裡,我將告訴大家如何在 Windows 上也能讓 sl
帶給你滿滿的趣味,讓你不再因為打錯 ls
而感到難過。(才怪)
- MinGW (如果有 DevC++ 或 CodeBlocks 應該就有)
#include <iostream> | |
#include <vector> | |
#include <assert.h> | |
#include <algorithm> | |
#include <queue> | |
#define debug 1 | |
#define DBG if (debug) cout | |
#define A first | |
#define B second | |
#define ll long long |
#!/usr/bin/python3 | |
import json | |
import sys | |
import requests | |
def get_stats(uid): | |
return json.loads(requests.post("http://neoj.sprout.tw/api/user/{}/statistic".format(uid), | |
data="{}").text) |
// 不用 pointer 的 implementation, 然後其實是 doubly linked list | |
// 雙向 linked list 刪除比較好做 | |
// 我其實沒編譯過 | |
typedef struct linked_list_node { | |
int data; // 資料 | |
int prev = -1, next = -1; // 上下一個的 index,所謂 doubly linked | |
// 一般其實是用 pointer 存啦 | |
} node; |
#include <iostream> | |
#include <queue> | |
#include <cmath> | |
using namespace std; | |
#define debug true | |
#define DBG if (debug) cout | |
struct Solution { |
R = lambda: map(int, input().split()) | |
n, k = R() | |
mex = 10**9 | |
for i in range(m): | |
l, r = R() | |
mex = min(mex, r - l + 1) | |
print(mex) |
#include <stdio.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <algorithm> | |
#include <queue> | |
#include <map> | |
#define INF 0x7fffffff | |
using namespace std; | |
priority_queue<int> wow[4 * 10001]; |
#include <stdio.h> | |
#include <string.h> | |
int ans[32]; | |
int gcd(int a, int b) { | |
if (!a) return b; | |
return gcd(b % a, a); | |
} |
#include <stdio.h> | |
#define min(x, y) (x > y) ? y : x | |
int main() { | |
int val, noc, dp[1001] = {0}, denoms[9] = {1, 5, 10, 30, 50, 70, 100, 110, 500}; | |
int i, j; | |
dp[0] = 0; | |
for (i = 1; i <= 1000; i++) dp[i] = 0x878787; | |
for (i = 0; i < 8; i++) { |
<svg id="code39"></svg> |