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<regex> | |
| #include<iostream> | |
| #include<string> | |
| using namespace std; | |
| int main(int argc, char ** argv) | |
| { | |
| int test; cin >> test; | |
| while (test--) | |
| { | |
| string str; cin >> str; |
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 re | |
| test = input() | |
| for i in range(test): | |
| str = raw_input() | |
| result=re.match("[A-F]?A+F+C+$[A-F]?",str) | |
| if(result == None): | |
| print("Good") | |
| else: | |
| print("Infected!") |
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> | |
| #include <algorithm> | |
| #include <functional> | |
| using namespace std; | |
| template<typename type> | |
| class IndexTree { | |
| private: | |
| std::vector<type> elements; |
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
| template<typename type> | |
| class HeapTree { | |
| private: | |
| type max(type a, type b) { return a > b ? a : b; } | |
| type min(type a, type b) { return a > b ? b : a; } | |
| vector<type> m_ele, M_ele; | |
| size_t e_size, t_size; | |
| pair<type,type> qquery(size_t node, size_t begin, size_t end, size_t first, size_t second) | |
| { | |
| if (end < first || begin > second) |
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> | |
| #include <algorithm> | |
| using namespace std; | |
| template<typename type> | |
| class HeapTree { | |
| private: | |
| type max(type a, type b) { return a > b ? a : b; } | |
| type min(type a, type b) { return a > b ? b : a; } |
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> | |
| #include <algorithm> | |
| using namespace std; | |
| template <typename type> | |
| struct Comp { | |
| Comp(type val) : _val(val) {} | |
| bool operator() (const pair<type, vector<type>> & vec) const | |
| { |
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 <algorithm> | |
| #include <utility> | |
| #include <functional> | |
| #include <math.h> | |
| #include <vector> | |
| #define POINT std::pair<size_t, size_t> |
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> | |
| #include <iterator> | |
| #include <algorithm> | |
| #include <functional> | |
| #define max std::max | |
| #define min std::min |
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
| std::vector < _value_type > list(this->vertex_count + 1, MAX_COUNT); | |
| std::vector < bool > chk(this->vertex_count + 1, false); | |
| list.at(start) = 0; | |
| while (!chk.at(dest)) | |
| { | |
| std::priority_queue < std::pair <_count_type, _value_type>, std::vector < std::pair <_value_type, _count_type> >, | |
| std::greater < std::pair < _value_type, _count_type > > > pq; |
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
| template <typename object_type> void event_click(std::unordered_map <std::string, object_type> map, int x, int y, int wParam) | |
| { | |
| for_each(map.begin(), map.end(), [&, x, y, wParam](std::pair<std::string, object_type> arg) { | |
| if ((arg.second)->x() < x && (arg.second)->x2() > x && (arg.second)->y() < y && (arg.second)->y2() > y) | |
| { | |
| arg.second->event_click(x - arg.second->x(), y - arg.second->y(), wParam); | |
| } | |
| }); | |
| } | |
| template <typename type> void DrawCall(std::unordered_map<std::string, type> map, std::function<void(std::pair <std::string, type>)> procedure) |