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 <climits> | |
| using namespace std; | |
| int dice[10]; // 주사위의 입력값 | |
| int piece[4]; // 현재 말의 위치 | |
| int arr[34]; // 다음에 갈 위치 저장 | |
| int score[34]; // 윷놀이판 엔트리의 점수 | |
| int turn[34]; // 파란색 화살표가 있는 전환 지점 |
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 <climits> | |
| #include <vector> | |
| #include <string> | |
| using namespace std; | |
| int arr[8][8] = { 0, }; // 처음 방안의 벽과 cctv의 위치 배열 | |
| int range[8][8] = { 0, }; // cctv의 동작반경 | |
| int N, M; // N * M: 배열크기, C: cctv 갯수 | |
| vector< pair<int, int> > cctv; // cctv의 배열 |
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
| promos = [globals()[name] for name in globals() | |
| if name.endswith('_promo') | |
| and name != 'best_promo'] | |
| def best_promo(order): | |
| return max(promo(order) for promo in promos) |
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 abc import ABC, abstractmethod | |
| from collections import namedtuple | |
| Customer = namedtuple('Customer', 'named fidelity') | |
| class LineItem: | |
| def __init__(self, product, quantity, price): | |
| self.product = product | |
| self.quantity = quantity |
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 abc import ABC, abstractmethod | |
| from collections import namedtuple | |
| Customer = namedtuple('Customer', 'named fidelity') | |
| class LineItem: | |
| def __init__(self, product, quantity, price): | |
| self.product = product | |
| self.quantity = quantity |
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 time | |
| from threading import Thread | |
| COUNT = 50000000 | |
| def countdown(n): | |
| while n>0: | |
| n -= 1 | |
| t1 = Thread(target=countdown, args=(COUNT//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
| import time | |
| from threading import Thread | |
| COUNT = 50000000 | |
| def countdown(n): | |
| while n>0: | |
| n -= 1 | |
| start = time.time() |
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 <vector> | |
| using namespace std; | |
| int arr[100][100] = {0, }; | |
| int N, L; | |
| bool check_slope(vector<int> &v){ | |
| // 모든 칸의 높이가 같은 경우 true 반환 | |
| bool same = true; |
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 <stdio.h> | |
| #define MAX_N 100001 | |
| typedef struct { | |
| int first; | |
| int second; | |
| } pii; | |
| struct pq{ | |
| pii heap[MAX_N]; | |
| int index[MAX_N]; |
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
| class Solution { | |
| private: | |
| bool hash[500001] = {0, }; | |
| public: | |
| int firstMissingPositive(vector<int>& nums) { | |
| int cnt; | |
| for (int i=0; i<nums.size(); i++){ | |
| if(nums[i] <= 0 || nums[i] > nums.size()) continue; | |
| else hash[nums[i]] = true; | |
| } |
NewerOlder