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 <cstring> | |
| using namespace std; | |
| template<class T> | |
| class RCPtr { | |
| public: | |
| RCPtr(T* realPtr = 0); | |
| RCPtr(const RCPtr& rhs); | |
| ~RCPtr(); |
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 <memory> | |
| #include <algorithm> | |
| #include <string> | |
| #include <cassert> | |
| using namespace std; | |
| // library |
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
| // More Effective C++ Item 33: Make non-leaf classes abstrat | |
| class AbstractAnimal { | |
| protected: | |
| AbstractAnimal& operator=(const AbstractAnimal& rhs); | |
| public: | |
| virtual ~AbstractAnimal() = 0; // This must be implemented | |
| }; | |
| class Animal: public AbstractAnimal { |
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
| // Google Code Jam 2016 | |
| // Qualification Round | |
| // Problem A. Counting Sheep | |
| // https://code.google.com/codejam/contest/6254486/dashboard#s=p0 | |
| #include <iostream> | |
| #include <istream> | |
| #include <fstream> | |
| #include <bitset> |
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
| // Google Code Jam 2016 | |
| // Qualification Round | |
| // Problem B. Revenge of the Pancakes | |
| // https://code.google.com/codejam/contest/6254486/dashboard#s=p1 | |
| #include <istream> | |
| #include <fstream> | |
| #include <string> | |
| using namespace std; |
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
| // Google Code Jam 2016 | |
| // Qualification Round | |
| // Problem D. Fractiles | |
| // https://code.google.com/codejam/contest/6254486/dashboard#s=p3 | |
| #include <iostream> | |
| #include <istream> | |
| #include <fstream> | |
| #include <bitset> | |
| #include <vector> |
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 <string> | |
| #include <vector> | |
| #include <algorithm> | |
| using namespace std; | |
| #define PI 3.14159265 | |
| struct vec2 { |
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 <bits/stdc++.h> | |
| //////////// cos sin ////////////// | |
| #include <cmath> | |
| const double pi = std::acos(-1); | |
| double cosByDegree( double degree ) | |
| { | |
| const double radian = degree*pi/180.0; | |
| return cos(radian); |
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 <string> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <queue> | |
| #include <cassert> | |
| using namespace std; | |
| // for optimization |
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 <string> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <queue> | |
| #include <cassert> | |
| using namespace std; | |
| // for optimization |