Skip to content

Instantly share code, notes, and snippets.

View mizuhara's full-sized avatar

Masaya Mizuhara mizuhara

View GitHub Profile
#include <iostream>
#include <string>
#include <vector>
#include <regex>
#include <boost/lexical_cast.hpp>
using namespace std;
vector<string> split(string const& src, string const& separator)
{
// clang++ -stdlib=libc++ -std=c++1y raswi.cpp
#include <vector>
#include <string>
#include <numeric>
#include <iostream>
#include <functional>
#include <unordered_map>
using namespace std;
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <sstream>
using namespace std;
enum color { Red = 0, Green, Blue, };
#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <cassert>
using namespace std;
typedef pair<int, int> point_t;
typedef vector<vector<string>> board_t;
package yhpg
import scala.math.BigInt
object Main extends App {
def makeStream(from: BigInt): Stream[BigInt] = from #:: makeStream(from + 1)
def isSquare(n: BigInt): Boolean = Math.pow(Math.round(Math.sqrt(n.toDouble)), 2) == n
def isCubic(n: BigInt): Boolean = Math.pow(Math.round(Math.cbrt(n.toDouble)), 3) == n
#include <iostream>
#include <string>
#include <vector>
using namespace std;
const int size = 1100;
vector<int> sqrt_nums(const vector<bool> &v, int to)
{
#include <iostream>
#include <cstring>
#include <climits>
using namespace std;
constexpr int FIELD_SIZE = 5;
int field[FIELD_SIZE][FIELD_SIZE];
int memo[10][FIELD_SIZE][FIELD_SIZE];
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
typedef vector<vector<char>> field_t;
import scala.collection.mutable._
object Problem
{
private def format(m: Map[String, Array[Int]]): String = {
val keys = m.keys.toArray.sorted
( for(key <- keys) yield key + "_" + m.get(key).get.sorted.mkString(":") ).mkString("|")
}
private def solve(a: Array[String], m: Map[String, Array[Int]]): String = {
var _ = require('underscore');
function toInt(src) {
return parseInt(src, 10);
}
function getSchedules(src) {
var schedules = {};
_.each(src.split(','), function(e) {
if( _.isUndefined(schedules[e[0]]) ) {