Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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;
#include "Dominos.h"
#include <iostream>
using namespace std;
int main()
{
int test_case_number;
cin >> test_case_number;
for (int i = 0; i < test_case_number; i++)
@jason790228
jason790228 / 10284.cpp
Last active November 12, 2017 14:26
10284
#include <iostream>
#include <string>
#include "Checkerboard.h"
using namespace std;
Piece create_piece(const char c, const size_t &current_col, const size_t &current_row)
{
if (c == 'p') return Piece(eCountry::BLACK, eRank::PAWN, current_col, current_row);
if (c == 'n') return Piece(eCountry::BLACK, eRank::KNIGHT, current_col, current_row);
@jason790228
jason790228 / DataTansfer.cpp
Last active December 6, 2017 02:58
RemakeReport
#include "DataTansfer.h"
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <sstream>
using namespace std;
void DataTransfer::read_data(string filename)
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
void put_data(const int &input_data, vector<int> &stack, vector<int> &queue, vector<int> &priority_queue)
{
stack.push_back(input_data);
#include <vector>
#include <array>
#include <iostream>
#include <string>
using namespace std;
#define EACH_TEST_CASE_DATA_NUMBER 10
typedef vector<array<pair<string, int>, EACH_TEST_CASE_DATA_NUMBER>> test_case_struct;
typedef vector<vector<string>> result_struct;
@jason790228
jason790228 / 591.cpp
Last active April 18, 2018 10:41
591
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
int main()
{
#include <iostream>
#include <string>
using namespace std;
void translated(const long long& input, string& output, bool flag = true);
void translated(const long long& input, string& output, bool flag)
{
int kuti = input % 100;