Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
)
func Sqrt1(x float64) float64 {
//z := 1.0
z := float64(1)
for i := 0; i < 10; i++ {
import sys
while True:
input_ = sys.stdin.readline()
if input_ == '':
break
sys.stdout.write(input_)
template<class T>
bool isOK(vector<T> a, int index, T key)
{
// ここの比較でupper boundかlower bound か決まる
if (a[index] > key) {
return true;
}
else {
return false;
}
{
// Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// Maze Master
#include <iostream>
#include <vector>
#include <math.h>
#include <string>
#include <map>
#include <stdio.h>
#include <string.h>
#include <initializer_list>
FROM ubuntu:latest
MAINTAINER username
WORKDIR /home/projects
RUN apt-get update && apt-get install -y \
vim \
gcc \
g++ \
binutils \
build-essential \
docker run --rm -v $PWD:/home/projects 9665b0eb66db /bin/bash -c "cd /home/projects; c++ test.cc"
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++){
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
// Maze Master
#include <iostream>
#include <vector>
#include <math.h>
#include <string>
#include <map>
#include <stdio.h>
#include <string.h>
#include <initializer_list>
// Travel by Car
#include <iostream>
#include <vector>
#include <math.h>
#include <string>
#include <map>
#include <stdio.h>
#include <string.h>
#include <initializer_list>