Skip to content

Instantly share code, notes, and snippets.

View sifue's full-sized avatar

Soichiro Yoshimura sifue

View GitHub Profile
@sifue
sifue / gist:353ab724c8b521894b71e8a7d9a207ea
Created September 11, 2017 10:03
Windows上のVirtualBoxの共有フォルダでnpm installをするとError: ETXTBSYが出る場合にそれを回避するコマンド
rm -rf ./node_modules && mkdir -p ~/workspace_noshared/`basename \`pwd\``/node_modules && ln -s ~/workspace_noshared/`basename \`pwd\``/node_modules ./node_modules
@sifue
sifue / template.cpp
Created September 9, 2017 20:01
競技プログラミング用C++テンプレート 20170909
#include <bits/stdc++.h> // g++ -std=c++14 -o a a.cpp
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
@sifue
sifue / cp.sh
Created August 31, 2017 10:51
共有フォルダのワークスペースでインストールできない人のコマンド
mkdir ~/workspace2
cd workspace2
npm install request
cd ~/workspace/npm-training
rm -rf node_modules
cp - ../../workspace2/node_modules .
@sifue
sifue / geo_kakudo.cpp
Created August 20, 2017 05:13
書き直したらこんな感じ
#include <iostream>
#include <algorithm>
#include <set>
using namespace std;
int main(){
int N;
cin >> N;
int p[N][3];
int i, j;
for(i = 0; i < N; i++){
@sifue
sifue / 予習メモ 夏期合宿 吉村編.md
Last active August 9, 2017 00:26
予習メモ 夏期合宿 吉村編

N予備校ネット夏期合宿「プログラミング」公開授業

  • アンケートは大体80%ぐらいOKならば進む方針で
  • 練習はタイムオーバーしてたらやらない
  • できるだけ巻き目でやって可能なら挙手する

10:00 プログラミング体験をしてみよう 吉村

自己紹介 2分

  • あいさつ
  • 自己紹介
@sifue
sifue / vagrant_halt_ubuntu64_16.bat
Created June 17, 2017 02:37
vagrant_halt_ubuntu64_16.bat
@echo off
cd %USERPROFILE%\vagrant\ubuntu64_16
vagrant halt
@sifue
sifue / vagrant_up_ubuntu64_16.bat
Created June 17, 2017 02:37
vagrant_up_ubuntu64_16.bat
@echo off
cd %USERPROFILE%\vagrant\ubuntu64_16
vagrant up
@sifue
sifue / p2.cpp
Created June 5, 2017 05:21
プロジェクトオイラー問題2
#include <iostream>
using namespace std;
int main() {
int n2 = 0;
int n1 = 1;
int current = 2;
int sum = current;
@sifue
sifue / p1.js
Created June 5, 2017 05:20
プロジェクトオイラー問題1
let sum = 0;
for (let i = 1; i < 1000; i++) {
if (i % 3 === 0 || i % 5 === 0) sum = sum + i;
}
console.log(sum);
@sifue
sifue / index.js
Created May 29, 2017 13:15
Node.jsで競技プログラミングをする際のテンプレート
'use strict';
let input = require('fs').readFileSync('/dev/stdin', 'utf8');
let lines = input.split('\n');
let h1 = parseInt(lines[0]);
let h2 = parseInt(lines[1]);
console.log(h1 - h2);