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 <map> | |
#include <string> | |
// Assume Cow B in each line appeared before | |
class Solution { | |
public: | |
enum class Relation {BEFORE, AFTER}; | |
enum class Zodiac { |
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
Next to a great forest there lived a poor woodcutter with his wife and his two children. | |
The boy's name was Hansel and the girl's name was Gretel. He had but little to eat, and | |
once, when a great famine came to the land, he could no longer provide even their daily | |
bread. | |
One evening as he was lying in bed worrying about his problems, he sighed and said to his | |
wife, "What is to become of us? How can we feed our children when we have nothing for | |
ourselves?" | |
"Man, do you know what?" answered the woman. "Early tomorrow morning we will take the two |
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 <chrono> | |
void print_I64(long long num) { | |
// Try NOT using `if` statement, since it will make the program slower | |
char str[32] = {0}; | |
short idx = 31; | |
long long sign = num >> 63; // -1 for negative, 0 for positive | |
// by doing this we assume that the spaces are filled with num's sign bit | |
num ^= sign; |
NewerOlder