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 <string> | |
#include <iostream> | |
using namespace std; | |
bool is_palindrome(const string & s) | |
{ | |
if (s.length() == 1) return true; | |
for (size_t i = 0; i < s.length() / 2; i++) if (s[i] != s[s.length() - 1 - i]) return false; |
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 "gtest\gtest.h" | |
#include "Segment.h" | |
#include <iostream> | |
using namespace std; | |
void resize_pattern(const vector<char> &pattern, size_t size, vector<string> &result) | |
{ | |
result.resize(15,""); | |
result[0] += pattern[0]; |
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 <map> | |
#include <iostream> | |
#include <string> | |
int main() | |
{ | |
std::string input; | |
while (std::getline(std::cin, input)) | |
{ | |
std::map<char, std::pair<std::string, bool>> table = |
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 <string> | |
#include <iostream> | |
int main() | |
{ | |
std::string peak_table[10] = | |
{ | |
"", | |
"1\n\n", | |
"1\n22\n1\n\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 "gtest\gtest.h" | |
#include <iostream> | |
#include <vector> | |
#include "DangerSweeper.h" | |
using namespace std; | |
int main(int argc, char* argv[]) | |
{ | |
//testing::InitGoogleTest(&argc, argv); |
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 <map> | |
#include <vector> | |
#include <string> | |
#include <bitset> | |
using namespace std; | |
static const map<char, bitset<10>> ori = | |
{ |
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 <map> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
#include <sstream> | |
#include <ctype.h> | |
using namespace std; | |
void run(map<char, int>& input, string s) |
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 "FamilyTree.h" | |
using namespace std; | |
bool Familytree::join_member(People *new_member, People *parent) | |
{ | |
setup_relationship(new_member, !parent ? m_familytree_root : parent); | |
return true; | |
} |
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 "gtest\gtest.h" | |
#pragma once | |
#include "Guide.h" | |
#include <iostream> | |
using namespace std; | |
Direction::eDirection mapping_direction(char s) | |
{ | |
if (s == '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
// 10242.cpp : 定義主控台應用程式的進入點。 | |
// | |
#include "stdafx.h" | |
#include <iostream> | |
#include <map> | |
#include <vector> | |
#include <algorithm> | |
#include <string> | |
#include <sstream> |