#include <iostream>
#include <vector>
using namespace std;
class Foo {
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
from urllib.parse import quote_plus, urlencode | |
import requests | |
from urllib.request import urlopen, Request | |
session = requests.Session | |
url = 'http://apis.data.go.kr/1160100/service/GetStocDiviInfoService/getDiviInfo' | |
queryParams = '?' + urlencode({ | |
quote_plus('ServiceKey') : 'gJzlDCS7IS9dZXyGkrtszUr0x5BophBoSedp7A6TEATYpeG9rzLVB8sOyNKf8kRUWl7cc50has2ogGw9KWGICw%3D%3D', | |
quote_plus('pageNo') : '1', |
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
typedef pair<int, int> point; | |
const int INF = 987654321; | |
//정점의 개수 | |
int V; | |
//그래프의 인접리스트 (연결된 정점 번호, 간선 가중치) | |
vector<point> adj; | |
vector<int> dijkstra(const int& src) { | |
vector<int> dist(V, INF); | |
dist[src] = 0; | |
priority_queue<point> pq; |
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
bool brackets(char word[], sList *list) { | |
for (int i = 0; i < strlen(word); i++) { | |
if (word[i] == '(' || word[i] == '{' || word[i] =='[') { | |
push(list, word[i]); | |
} | |
else { | |
if (!isEmpty(list)) { | |
switch (word[i]) { | |
case ')': | |
if (peek(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 <stdio.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct stack { | |
char data; | |
struct stack *next; | |
}Stack; |
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 <algorithm> | |
#include <vector> | |
#include <queue> | |
#include <limits> | |
#include <string> | |
#define endl '\n' | |
#define point pair<int, int> | |
using namespace std; |
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 <algorithm> | |
#include <vector> | |
#include <limits> | |
#include <string> | |
#define endl '\n' | |
#define point pair<int, int> | |
using namespace std; | |
enum {notChecked = -1, notGrouped, Grouped}; |
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> | |
using namespace std; | |
int f(int n, int prev = 0, int next = 1) { | |
if (not n) return prev; | |
return f(n - 1, next, prev + next); | |
} | |
int main(void) { | |
cout << f(4) << '\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
#include <iostream> | |
using namespace std; | |
int f(int a) { | |
a = 0; | |
return a; | |
} | |
int foo1(int b) { | |
return f(b) + 1; |
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> | |
using namespace std; | |
int f(int n) { | |
if (n < 0) return 0; | |
if (n < 2) return n; | |
return f(n - 1) + f(n - 2); | |
} | |
int main(void) { |
NewerOlder