Skip to content

Instantly share code, notes, and snippets.

@jason790228
jason790228 / 10018.cpp
Last active September 27, 2017 10:27
10018
#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;
@jason790228
jason790228 / 706.cpp
Created September 12, 2017 17:03
706
#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];
@jason790228
jason790228 / 10260.cpp
Created September 5, 2017 17:22
10260
#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 =
@jason790228
jason790228 / 488.cpp
Last active August 30, 2017 10:38
488
#include <string>
#include <iostream>
int main()
{
std::string peak_table[10] =
{
"",
"1\n\n",
"1\n22\n1\n\n",
@jason790228
jason790228 / 10279.cpp
Last active August 8, 2017 15:08
10279
#include "gtest\gtest.h"
#include <iostream>
#include <vector>
#include "DangerSweeper.h"
using namespace std;
int main(int argc, char* argv[])
{
//testing::InitGoogleTest(&argc, argv);
@jason790228
jason790228 / 10415.cpp
Last active July 26, 2017 10:56
10415
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <bitset>
using namespace std;
static const map<char, bitset<10>> ori =
{
#include <map>
#include <vector>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <ctype.h>
using namespace std;
void run(map<char, int>& input, string s)
#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;
}
#include "gtest\gtest.h"
#pragma once
#include "Guide.h"
#include <iostream>
using namespace std;
Direction::eDirection mapping_direction(char s)
{
if (s == 'N')
// 10242.cpp : 定義主控台應用程式的進入點。
//
#include "stdafx.h"
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>