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
import sys | |
import subprocess | |
from html.parser import HTMLParser | |
from microsofttranslator import Translator | |
client_id = "" | |
client_secret = "" | |
class TestHTMLParser(HTMLParser): |
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
import com.intellij.notification.Notification; | |
import com.intellij.notification.NotificationType; | |
import com.intellij.notification.Notifications; | |
import com.intellij.openapi.actionSystem.AnAction; | |
import com.intellij.openapi.actionSystem.AnActionEvent; | |
import com.intellij.openapi.wm.WindowManager; | |
import javax.swing.*; | |
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
class TrieTree: | |
def __init__(self): | |
size = 256 | |
self.table = [[None for c in range(size)] for n in range(size)] | |
self.node_value = [None for n in range(size)] | |
self.last_node = 0 | |
def insert(self, key, value): |
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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int longestCommonSubsequence(string s, string t) { | |
vector<vector<int>> v(s.size() + 1, vector<int>(t.size() + 1, 0)); | |
for (int i = 0; i < s.size() + 1; ++i) { |
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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <map> | |
using namespace std; | |
map<pair<string, string>, int> memo; | |
int longestCommonSubsequence(string s, string t) { |
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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <map> | |
using namespace std; | |
vector<int> v_list; | |
vector<int> w_list; |
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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <map> | |
using namespace std; | |
vector<int> v_list; | |
vector<int> w_list; |
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
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int longestIncreasingSubsequence(const vector<int> &v) { | |
vector<int> dp(v.size(), INT_MAX); | |
for (int n : v ) { | |
*lower_bound(dp.begin(), dp.end(), n) = n; |
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
import sys | |
# 各ノードのコスト | |
nodes = {"BOS": 0, "EOS": 0, | |
"さ": 100, "さか": 200, "さかな": 100, "かな": 200, "なだ": 200, "だ": 10, "よ": 10} | |
# ノードのつながりのコスト | |
edges = {("BOS", "さ"): 30, | |
("BOS", "さか"): 30, | |
("BOS", "さかな"): 30, |
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
import sys | |
from collections import defaultdict | |
import queue | |
class Node: | |
def __init__(self, id_, name, weight): | |
self.id = id_ | |
self.name = name | |
self.weight = weight |
OlderNewer