This file contains hidden or 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
#include <iostream> | |
#include <queue> | |
#include <vector> | |
struct node { | |
int x, y; | |
double t; | |
int sq; | |
node(int _x = 0, int _y = 0, double _t=0) { |
This file contains hidden or 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
/* | |
list version | |
*/ | |
class LRUCache { | |
public: | |
list<pair<int,int>> q; | |
unordered_map<int,list<pair<int,int>>::iterator> hash; | |
list<pair<int,int>>::iterator it; |
This file contains hidden or 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
/* | |
deque version | |
Error with test data | |
["LRUCache","put","put","put","put","get","get"] | |
[[10],[99,27],[8,10],[6,29],[1,9],[6],[1]] | |
Because push_front and push_back cause iterator invaild. | |
*/ |
This file contains hidden or 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
from selenium import webdriver | |
import time | |
# 關閉通知 | |
options = webdriver.ChromeOptions() | |
prefs = { | |
'profile.default_content_setting_values': | |
{ | |
'notifications': 2 |
This file contains hidden or 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
# 全域變數 | |
A = 1 | |
def Sum(X,Y): | |
global tmp | |
tmp = X + Y | |
return tmp | |
# 呼叫並使用Function |
This file contains hidden or 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 -*- | |
""" | |
Created on Thu Jun 11 12:22:10 2020 | |
@author: Zino | |
""" | |
# 印出一列 | |
for j in [1,2,3,4,5]: | |
print("*", end =" ") |
This file contains hidden or 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
#引入函式庫 | |
import requests | |
import json | |
# 超連結 | |
url = 'https://www.google.com.tw/maps/preview/review/listentitiesreviews?authuser=0&hl=zh-TW&gl=tw&pb=!1m2!1y3765758546651144975!2y6093113884180453713!2m2!1i0!2i10!3e2!4m5!3b1!4b1!5b1!6b1!7b1!5m2!1sdzvaXrvAMImImAXHsLPICA!7e81' | |
# 發送get請求 | |
text = requests.get(url).text | |
# 取代掉特殊字元,這個字元是為了資訊安全而設定的喔。 | |
pretext = ')]}\'' |
This file contains hidden or 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 -*- | |
""" | |
Created on Fri May 29 00:38:13 2020 | |
@author: ASUS | |
""" | |
# 導入 模組(module) | |
import requests | |
# 導入 BeautifulSoup 模組(module):解析HTML 語法工具 |
This file contains hidden or 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 -*- | |
""" | |
Created on Tue May 12 04:38:47 2020 | |
@author: Zino | |
""" | |
# 導入 模組(module) | |
import requests | |
# 導入 BeautifulSoup 模組(module):解析HTML 語法工具 |
This file contains hidden or 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 -*- | |
""" | |
Created on Tue May 12 04:38:47 2020 | |
https://medium.com/p/a8216873a9d3 | |
@author: Zino | |
""" | |
# 導入 模組(module) | |
import requests |
NewerOlder