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
package main | |
import ( | |
"fmt" | |
) | |
func Sqrt1(x float64) float64 { | |
//z := 1.0 | |
z := float64(1) | |
for i := 0; i < 10; i++ { |
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
import sys | |
while True: | |
input_ = sys.stdin.readline() | |
if input_ == '': | |
break | |
sys.stdout.write(input_) |
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
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; | |
} |
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
{ | |
// 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');", |
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
// Maze Master | |
#include <iostream> | |
#include <vector> | |
#include <math.h> | |
#include <string> | |
#include <map> | |
#include <stdio.h> | |
#include <string.h> | |
#include <initializer_list> |
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
FROM ubuntu:latest | |
MAINTAINER username | |
WORKDIR /home/projects | |
RUN apt-get update && apt-get install -y \ | |
vim \ | |
gcc \ | |
g++ \ | |
binutils \ | |
build-essential \ |
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
docker run --rm -v $PWD:/home/projects 9665b0eb66db /bin/bash -c "cd /home/projects; c++ test.cc" |
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
// テーブルを作る前処理 | |
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; | |
} |
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
// Maze Master | |
#include <iostream> | |
#include <vector> | |
#include <math.h> | |
#include <string> | |
#include <map> | |
#include <stdio.h> | |
#include <string.h> | |
#include <initializer_list> |
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
// Travel by Car | |
#include <iostream> | |
#include <vector> | |
#include <math.h> | |
#include <string> | |
#include <map> | |
#include <stdio.h> | |
#include <string.h> | |
#include <initializer_list> |
NewerOlder